# xAI Grok (/en/ai/models/llm/xai)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

xAI provides access to Grok large language models through an OpenAI-compatible chat completions API for conversational AI applications.

### Sample configuration [#sample-configuration]

The following example shows a starting `llm` parameter configuration you can use when you [Start a conversational AI agent](/en/api-reference/api-ref/conversational-ai/join).

```json
"llm": {
  "url": "https://api.x.ai/v1/chat/completions",
  "api_key": "<your_llm_key>",
  "system_messages": [
    {
      "role": "system",
      "content": "You are a helpful chatbot."
    }
  ],
  "max_history": 32,
  "greeting_message": "Hello, how can I assist you?",
  "failure_message": "Please hold on a second.",
  "params": {
    "model": "grok-4.3"
  },
  "vendor": "xai"
}
```

### Key parameters [#key-parameters]

<ParameterList required="true">
  <Parameter name="url" type="string" required="true">
    The xAI chat completions endpoint. Set to `https://api.x.ai/v1/chat/completions`.
  </Parameter>

  <Parameter name="api_key" type="string" required="true">
    The xAI API key used to authenticate requests.
  </Parameter>

  <Parameter name="vendor" type="string" required="true">
    The LLM vendor. Set to `xai`.
  </Parameter>

  <Parameter name="params" type="object" required="false">
    Additional parameters passed directly to the xAI API.

    <ParameterList title="params">
      <Parameter name="model" type="string" required="true">
        The Grok model to use. For example, `grok-4.3`. For available models, refer to the [xAI models documentation](https://docs.x.ai/developers/models).
      </Parameter>
    </ParameterList>
  </Parameter>
</ParameterList>

For more information, refer to the [xAI Chat Completions documentation](https://docs.x.ai/developers/model-capabilities/legacy/chat-completions).
