inference-providers

Grok 4.5

by xai · family grok

Facts

Release date2026-07-16
Retired date
Knowledge cutoff
Context (max)500,000
Max output
Modalitiestext, image → text
Aliasesgrok-4.5
Open weightsno
DescriptionReasoning model; effort low/medium/high default high, cannot disable. xhigh silently treated as high.

Unknown values are shown as —.

Intelligence Index v4.1.1: 56 · high effort · Source: Artificial Analysis (accessed 2026-08-20)

Offerings

ProviderWire IDVariantEndpointProtocolStatusPrice (USD / Mtok)Reasoning
OpenCode Gogrok-4.5go-responsesopenai-responsesgaeffort · default on · mandatory · returns hidden · round-trips encrypted_content
OpenCode Zengrok-4.5responsesopenai-responsesga2.00 / 6.00effort · default on · mandatory · returns hidden · round-trips encrypted_content
OpenRouterx-ai/grok-4.5chat-completionsopenai-chatga2.00 / 6.00effort · default on · mandatory · returns reasoning_content · round-trips reasoning_content
xAIgrok-4.5v1-chat-completionsopenai-chatga2.00 / 6.00effort · default on · mandatory · returns reasoning_content
xAIgrok-4.5v1-responsesopenai-responsesga2.00 / 6.00effort · default on · mandatory · returns hidden · round-trips encrypted_content

Reasoning controls

OpenCode Go· grok-4.5· go-responses effort

reasoning.effort lowmediumhigh●

effort · default on · mandatory · returns hidden · round-trips encrypted_content

OpenCode Zen· grok-4.5· responses effort

reasoning.effort lowmediumhigh●

effort · default on · mandatory · returns hidden · round-trips encrypted_content

OpenRouter· x-ai/grok-4.5· chat-completions effort

reasoning.effort lowmediumhigh●xhighmax

effort · default on · mandatory · returns reasoning_content · round-trips reasoning_content

xAI· grok-4.5· v1-chat-completions effort

reasoning_effort lowmediumhigh●

effort · default on · mandatory · returns reasoning_content

xAI· grok-4.5· v1-responses effort

reasoning.effort lowmediumhigh●

effort · default on · mandatory · returns hidden · round-trips encrypted_content

Example requests

OpenCode Go · openai-responses · grok-4.5

curl 'https://opencode.ai/zen/go/v1/responses' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "grok-4.5",
  "input": "Tell me about the weather.",
  "reasoning": {
    "effort": "high"
  }
}'
Python (requests)
import requests

resp = requests.post(
    "https://opencode.ai/zen/go/v1/responses",
    headers={
      "Authorization": "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json"
    },
    json={
      "model": "grok-4.5",
      "input": "Tell me about the weather.",
      "reasoning": {
        "effort": "high"
      }
    },
)
print(resp.json())
TypeScript (fetch)
const resp = await fetch("https://opencode.ai/zen/go/v1/responses", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "grok-4.5",
    "input": "Tell me about the weather.",
    "reasoning": {
      "effort": "high"
    }
  }),
})
console.log(await resp.json())
  • ⚠ Responses include encrypted_content artifacts — pass them back unmodified on subsequent turns (dropping them triggers 400s or quality loss).

OpenCode Zen · openai-responses · grok-4.5

curl 'https://opencode.ai/zen/v1/responses' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "grok-4.5",
  "input": "Tell me about the weather.",
  "reasoning": {
    "effort": "high"
  }
}'
Python (requests)
import requests

resp = requests.post(
    "https://opencode.ai/zen/v1/responses",
    headers={
      "Authorization": "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json"
    },
    json={
      "model": "grok-4.5",
      "input": "Tell me about the weather.",
      "reasoning": {
        "effort": "high"
      }
    },
)
print(resp.json())
TypeScript (fetch)
const resp = await fetch("https://opencode.ai/zen/v1/responses", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "grok-4.5",
    "input": "Tell me about the weather.",
    "reasoning": {
      "effort": "high"
    }
  }),
})
console.log(await resp.json())
  • ⚠ Responses include encrypted_content artifacts — pass them back unmodified on subsequent turns (dropping them triggers 400s or quality loss).

OpenRouter · openai-chat · x-ai/grok-4.5

curl 'https://openrouter.ai/api/v1/chat/completions' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "x-ai/grok-4.5",
  "messages": [
    {
      "role": "user",
      "content": "Tell me about the weather."
    }
  ],
  "reasoning": {
    "effort": "high"
  }
}'
Python (requests)
import requests

resp = requests.post(
    "https://openrouter.ai/api/v1/chat/completions",
    headers={
      "Authorization": "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json"
    },
    json={
      "model": "x-ai/grok-4.5",
      "messages": [
        {
          "role": "user",
          "content": "Tell me about the weather."
        }
      ],
      "reasoning": {
        "effort": "high"
      }
    },
)
print(resp.json())
TypeScript (fetch)
const resp = await fetch("https://openrouter.ai/api/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "x-ai/grok-4.5",
    "messages": [
      {
        "role": "user",
        "content": "Tell me about the weather."
      }
    ],
    "reasoning": {
      "effort": "high"
    }
  }),
})
console.log(await resp.json())
  • ⚠ Responses include reasoning_content artifacts — pass them back unmodified on subsequent turns (dropping them triggers 400s or quality loss).

xAI · openai-chat · grok-4.5

curl 'https://api.x.ai/v1/chat/completions' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "grok-4.5",
  "messages": [
    {
      "role": "user",
      "content": "Tell me about the weather."
    }
  ],
  "reasoning_effort": "high"
}'
Python (requests)
import requests

resp = requests.post(
    "https://api.x.ai/v1/chat/completions",
    headers={
      "Authorization": "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json"
    },
    json={
      "model": "grok-4.5",
      "messages": [
        {
          "role": "user",
          "content": "Tell me about the weather."
        }
      ],
      "reasoning_effort": "high"
    },
)
print(resp.json())
TypeScript (fetch)
const resp = await fetch("https://api.x.ai/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "grok-4.5",
    "messages": [
      {
        "role": "user",
        "content": "Tell me about the weather."
      }
    ],
    "reasoning_effort": "high"
  }),
})
console.log(await resp.json())

xAI · openai-responses · grok-4.5

curl 'https://api.x.ai/v1/responses' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "grok-4.5",
  "input": "Tell me about the weather.",
  "reasoning": {
    "effort": "high"
  }
}'
Python (requests)
import requests

resp = requests.post(
    "https://api.x.ai/v1/responses",
    headers={
      "Authorization": "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json"
    },
    json={
      "model": "grok-4.5",
      "input": "Tell me about the weather.",
      "reasoning": {
        "effort": "high"
      }
    },
)
print(resp.json())
TypeScript (fetch)
const resp = await fetch("https://api.x.ai/v1/responses", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "grok-4.5",
    "input": "Tell me about the weather.",
    "reasoning": {
      "effort": "high"
    }
  }),
})
console.log(await resp.json())
  • ⚠ Responses include encrypted_content artifacts — pass them back unmodified on subsequent turns (dropping them triggers 400s or quality loss).