Authentication
authorization string required
All APIs require authentication via Bearer Token.
Get API Key:
Visit API Key Management Page to get your API Key
Usage:
Add to request header:
Authorization: Bearer YOUR_API_KEY
Model notes
Compared with the existing Grok 4 document, Grok 4.5 changes the model ID to grok-4.5, keeps text and image input, uses a 500000 token context window, and exposes configurable reasoning with low, medium, and high. The default reasoning effort is high, and reasoning cannot be disabled.
Compared with grok-4.3, the notable field changes are: context window changes from 1000000 to 500000; reasoning_effort no longer accepts none; default reasoning changes from low to high. xAI also documents Chat Completions and Responses API support, function calling, web search, X search, and code execution.
For reasoning requests, avoid sending presence_penalty, frequency_penalty, or stop, because upstream reasoning models reject those parameters.
Parameters
model string required
Model ID to use for the request.
Value: grok-4.5
messages array required
Array of message objects representing the conversation history.
role
stringrequiredMessage role.
Options:
user,assistant,system,developer
content
string | arrayrequiredText string or multimodal content array. Supports text and image input.
reasoning_effort string
Controls how much reasoning the model performs before answering. Reasoning cannot be disabled for this model.
Default: high
Options: low, medium, high
max_tokens integer
Maximum tokens to generate in the completion. The effective limit depends on the selected route and upstream response budget.
temperature number
Sampling temperature to use.
Default: 1.0
Range: 0.0 - 2.0
top_p number
Nucleus sampling parameter.
Default: 1.0
Range: 0.0 - 1.0
stream boolean
Whether to stream response incrementally.
Default: false
tools array
List of tools the model may call.
type
stringrequiredTool type.
Options:
function
function
objectrequiredFunction tool definition.
tool_choice string | object
Controls how the model selects tools.
Options: none, auto, required, or an explicit function selection object
response_format object
Format that the model must output. Used for structured outputs.
type
stringrequiredOutput format type.
Options:
text,json_object,json_schema