Skip to main content

xAI Grok

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

Sample configuration

The following example shows a starting llm parameter configuration you can use when you Start a conversational AI agent.


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

Key parameters

BODYrequired
  • url stringrequired

    The xAI chat completions endpoint. Set to https://api.x.ai/v1/chat/completions.

  • api_key stringrequired

    The xAI API key used to authenticate requests.

  • vendor stringrequired

    The LLM vendor. Set to xai.

  • params objectnullable

    Additional parameters passed directly to the xAI API.

    params

For more information, refer to the xAI Chat Completions documentation.