# xAI cURL Integration

> Use cURL to integrate xAI with Helicone to log your xAI LLM usage.

import { strings } from "/snippets/strings.mdx";
import LegacyWarning from "/snippets/legacy-provider-warning.mdx";

<LegacyWarning />

This integration is used to log usage with the [xAI](https://x.ai) API.

## {strings.howToIntegrate}

<Steps>
  <Step title={strings.generateKey}>
      <div dangerouslySetInnerHTML={{ __html: strings.generateKeyInstructions }} />
  </Step>
<Step title={strings.modifyBasePath}>

    ```bash
    curl -X POST https://x.helicone.ai/v1/chat/completions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer $XAI_API_KEY" \
      -H "Helicone-Auth: Bearer $HELICONE_API_KEY" \
      -d '{
        "model": "grok-4-latest",
        "messages": [
          {
            "role": "user",
            "content": "Hello, how are you?"
          }
        ],
        "max_tokens": 50,
        "temperature": 0.7
      }'
    ```

  </Step>
  
  <Step title={strings.verifyInHelicone}>
    <div dangerouslySetInnerHTML={{ __html: strings.verifyInHeliconeDesciption("xAI") }} />
  </Step>
</Steps>
