Interface: XAIMessagesParams
@providerprotocol/ai / xai / XAIMessagesParams
Interface: XAIMessagesParams
Section titled “Interface: XAIMessagesParams”Defined in: src/providers/xai/types.ts:193
xAI Messages API parameters (Anthropic-compatible).
These parameters are passed through to the xAI /v1/messages endpoint.
The API is compatible with Anthropic’s Messages API, allowing developers
migrating from Anthropic to use familiar patterns.
Example
Section titled “Example”const params: XAIMessagesParams = { max_tokens: 1000, temperature: 0.7, thinking: { type: 'enabled', budget_tokens: 500 }, // Extended thinking};- XAICompletionsParams for Chat Completions API parameters
- XAIResponsesParams for Responses API parameters
Properties
Section titled “Properties”max_tokens?
Section titled “max_tokens?”
optionalmax_tokens:number
Defined in: src/providers/xai/types.ts:195
Maximum number of tokens to generate
metadata?
Section titled “metadata?”
optionalmetadata:object
Defined in: src/providers/xai/types.ts:210
Metadata for the request
user_id?
Section titled “user_id?”
optionaluser_id:string
stop_sequences?
Section titled “stop_sequences?”
optionalstop_sequences:string[]
Defined in: src/providers/xai/types.ts:207
Custom stop sequences
temperature?
Section titled “temperature?”
optionaltemperature:number
Defined in: src/providers/xai/types.ts:198
Temperature for randomness (0.0 - 1.0)
thinking?
Section titled “thinking?”
optionalthinking:object
Defined in: src/providers/xai/types.ts:215
Extended thinking configuration
budget_tokens
Section titled “budget_tokens”budget_tokens:
number
type:
"enabled"
tool_choice?
Section titled “tool_choice?”
optionaltool_choice:object
Defined in: src/providers/xai/types.ts:227
Tool selection strategy.
auto: Model decides when to use toolsany: Model must use at least one tooltool: Model must use the specific tool named inname
optionalname:string
type:
"auto"|"tool"|"any"
top_k?
Section titled “top_k?”
optionaltop_k:number
Defined in: src/providers/xai/types.ts:204
Top-k sampling
top_p?
Section titled “top_p?”
optionaltop_p:number
Defined in: src/providers/xai/types.ts:201
Top-p (nucleus) sampling (0.0 - 1.0)