Skip to main content

X



Properties used to connect to xAI.

x

Service Types

Chat

  • Type: true | {
         model?: string,
         max_tokens?: number,
         temperature?: number,
         system_prompt?: string
    }
  • Default: {model: "grok-3-latest"}

Connect to X's chat API. You can set this property to true or configure it using an object:
model is the name of the X model to be used by the API.
max_tokens limits the maximum number of tokens in the generated response.
temperature controls the randomness of responses. Higher values produce more creative outputs.
system_prompt provides behavioral context and instructions to the model.

Example

<deep-chat
directConnection='{
"x": {
"key": "placeholder key",
"chat": {"system_prompt": "You are a helpful assistant.", "temperature": 0.7}
}
}'
></deep-chat>
info

Use stream to stream the AI responses.

Images

  • Type: true | {model?: string,n?: number}
  • Default: {model: "grok-2-image"}

Connect to X's image generation API. You can set this property to true or configure it using an object:
model is the name of the image generation model.
n is the number of images to generate.

Example

<deep-chat
directConnection='{
"x": {
"key": "placeholder key",
"images": true
}
}'
></deep-chat>