altrouter.ai
Models/xAI/Grok 4.5
GK

xAI: Grok 4.5

Textgrok-4.5

xAI's Grok 4.5: a frontier model for coding, agentic tasks and reasoning.

API docs
Playgroundgrok-4.5
Temperature
Top-p
Max tokens
Reasoning
Seed
Frequency penalty
Presence penalty
Web search
Throughput138 tok/s
24hnow
Latency0.89 s
24hnow
Specifications
Authorxai
ModalityText
Context256K tokens
Input$1.70/M tokens$2.00/M tokens
Output$5.10/M tokens$6.00/M tokens
Savings15%
Capabilitiesreasoning, tool calling, image input
Quick start
from openai import OpenAI

client = OpenAI(
    base_url="https://api.altrouter.ai/v1",
    api_key="ar-...",
)

resp = client.chat.completions.create(
    model="grok-4.5",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

Same OpenAI-compatible endpoint — just swap base_url and key.

API

OpenAI-compatible chat completions endpoint, with SSE streaming.

POST/v1/chat/completions
Body parameters
modelstringrequired"grok-4.5"
The model id.
messagesarrayrequired
The conversation: [{ role, content }].
streambooleandefault false
Stream the response over SSE.
temperaturenumber0–2default 1
Sampling randomness: lower is more deterministic, higher more creative.
top_pnumber0–1default 1
Nucleus sampling — the probability mass to sample from.
max_tokensnumber1–32000
Maximum tokens to generate.
reasoning_effortenumlow · medium · highdefault medium
Thinking budget for reasoning models.
seednumber0–2147483647
Seed for reproducibility.
frequency_penaltynumber-2–2
Penalizes tokens by their existing frequency.
presence_penaltynumber-2–2
Penalizes tokens that have already appeared.
web_searchbooleandefault false
Server-side web search — answers with live data.

Structured fields (tools, response_format, stop and more) are in the full parameter reference.

Response
idstring
Completion id.
choicesarray
Completions. Each: index, message { role, content, reasoning_content, tool_calls }, finish_reason.
usageobject
Tokens: prompt_tokens, completion_tokens, total_tokens.
Example
cURLPythonJSON
curl https://api.altrouter.ai/v1/chat/completions \
  -H "Authorization: Bearer ar-..." \
  -H "Content-Type: application/json" \
  -d '{
  "model": "grok-4.5",
  "messages": [
    {
      "role": "user",
      "content": "Hello!"
    }
  ],
  "reasoning_effort": "medium"
}'
Errors
400Invalid request.
401Missing or invalid API key.
402Insufficient credits, or the key’s spending cap is exhausted.
404Model not found.
429Rate limit exceeded.
More from xAI
Grok 4.3
grok-4.3
Grok Imagine
grok-imagine