Ana içeriğe atla
xAI logosu

Grok 4.20 API

xAI

Grok 4.20, Grok model ailesinin bir parçasıdırTüm Grok modellerini görüntüle

Düşünme modu açık xAI Grok 4.20: 1M bağlam penceresi, görsel girişi, ajan tabanlı araç çağırma ve saniyede 98.9 çıktı tokenı.

xai/grok-4.20-0309-reasoning

Dokümantasyon

Sohbet

Bir sohbet başlatın

Düşünme modu açık xAI Grok 4.20: 1M bağlam penceresi, görsel girişi, ajan tabanlı araç çağırma ve saniyede 98.9 çıktı tokenı.

Göndermek için Enter · Yeni satır için Shift+Enter

UnificAlly, LLM istemlerinizi ve yanıtlarınızı saklamaz. Faturalandırma amacıyla yalnızca token kullanım bilgilerini tutarız.

UnificAlly API anahtarınızla POST /v1/chat/completions kullanır. Uygun olduğunda sistem ve kullanıcı istemlerini, araçları, akışı ve düşünme modunu destekler.

Güncellendi:

What is the Grok 4.20 Reasoning API?

The Grok 4.20 Reasoning API is live on UnificAlly as xai/grok-4.20-0309-reasoning, from $0.1875/1M tokens of input and $0.375/1M tokens of output. Grok 4.20 Reasoning is the thinking model in xAI's Grok 4.20 line, a model built for speed, agentic tool calling, and strict prompt adherence, with a low hallucination rate as its headline claim. It went live on the API on March 10, 2026 as the 0309 snapshot and got refreshed weights in April 2026. It accepts text and image input and outputs text. The context window is 1M tokens. Thinking off (xai/grok-4.20-0309-non-reasoning) and Multi-Agent (xai/grok-4.20-multi-agent-0309) are modes of the same model: pick them with the switch in the playground above.

Grok 4.20 Reasoning API specs

Model IDxai/grok-4.20-0309-reasoning
EndpointPOST https://direct-api.unifically.com/v1/chat/completions
Other formatsPOST /v1/responses and POST /v1/messages
Request typesChat, streaming, tool calls
InputText and images
OutputText
Context window1M tokens
ThinkingOn
Input rate$0.1875/1M tokens
Output rate$0.375/1M tokens
Cache read rate$0.03/1M tokens

The Grok 4.20 Reasoning API bills per token, with no subscription. The rates above apply to prompts of up to 200K tokens, and longer prompts use a higher rate. The pricing page shows the live table.

How to use the Grok 4.20 Reasoning API

  1. Create an API key on the API keys page.
  2. Send a POST request to /v1/chat/completions on https://direct-api.unifically.com with the model ID and a messages array.
  3. Read the reply from choices[0].message.content in the same response.
curl -X POST https://direct-api.unifically.com/v1/chat/completions   -H "Content-Type: application/json"   -H "Authorization: Bearer YOUR_API_KEY"   -d '{
    "model": "xai/grok-4.20-0309-reasoning",
    "messages": [
      {"role": "user", "content": "Summarize the open risks in this incident thread and rank them by blast radius."}
    ]
  }'

The response comes back synchronously with the completion and the token usage:

{
  "id": "3f8e2a1c-7b4d-4e9a-9c2f-5d1e8b7a6c40",
  "object": "chat.completion",
  "created": 1710000000,
  "model": "xai/grok-4.20-0309-reasoning",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The three open risks, ranked by blast radius..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 28,
    "completion_tokens": 64,
    "total_tokens": 92,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 0
    }
  }
}

Set "stream": true to receive tokens as they generate. The stream is sent as server-sent events and ends with data: [DONE]. Send requests to direct-api.unifically.com so long replies are not cut short by a proxy timeout.

Grok 4.20 Reasoning API parameters

ParameterTypeDefaultWhat it does
modelstringrequiredModel identifier, xai/grok-4.20-0309-reasoning
messagesarrayrequiredNon-empty array of message objects with role and content (a string or an array of content parts). Roles: system, developer, user, assistant, tool, function
streambooleanfalseIf true, the response is streamed using server-sent events
stream_optionsobjectnoneSet { "include_usage": true } to get a final chunk with token usage. Only used when stream is true
temperaturenumbernoneSampling temperature between 0 and 2. Higher values produce more random output
max_tokensintegernoneMaximum number of tokens to generate in the completion
max_completion_tokensintegernoneAccepted as an alias for max_tokens
reasoning_effortstringnoneHow much the model reasons before answering, on models that support it
top_pnumbernoneNucleus sampling parameter. Alternative to temperature
stopstring or arraynoneUp to four sequences where the model stops generating further tokens
toolsarraynoneList of tools the model may call. Each tool needs a type and a function definition
tool_choicestring or objectnoneControls which tool, if any, is called: none, auto, required, or a specific tool
response_formatobjectnoneSet { "type": "json_object" } to enable JSON mode

The Grok 4.20 Reasoning API documentation has the full reference, including the Responses and Messages formats.

Key features of Grok 4.20 Reasoning

Fast for a thinking model

Artificial Analysis measures 98.9 output tokens per second, #46 of 195 models and well above the 70 median, with an Intelligence Index of 38 that beats the class median of 36. At launch its median speed on xAI's API was 267 tokens per second, so expect it to get faster again as capacity frees up.

Highest Arena rank in the Grok line

The 0309 reasoning build holds #35 on the Arena text leaderboard with an Elo of 1472 across 62,263 votes as of September 2, 2026, ahead of Grok 4.5 at #38 and Grok 4.6 high at #48. Human voters like its answers more than the raw benchmarks suggest.

Agentic tool calling with strict adherence

Function calling and structured outputs on the standard request, and a model xAI tuned to follow the prompt exactly. Grok 4.3 later pushed the same tool-calling line to 98% on Tau2-Bench Telecom.

A million tokens of context

Whole repositories, long transcripts, or document sets in one request, with image input for screenshots and charts.

What Grok 4.20 is best for

  • Tool-calling agents

    Agentic function calls with strict prompt adherence and a 1M-token working set.

  • Chat products

    Arena voters rank it above newer Grok models; good default for conversational apps.

  • Long-document reasoning

    Reads a million tokens and thinks before it answers.

  • Everyday coding

    72.2% SWE-bench Verified; fine for routine fixes and scripts.

  • Fact-sensitive replies

    Tuned for a low hallucination rate and exact instruction following.

  • Visual input tasks

    Screenshots, diagrams, and charts read as input for text answers.

Grok 4.20 use cases

Use Grok 4.20 Reasoning as the general model behind assistants that need a little thought per turn: support agents that call tools, research helpers that digest long threads, and internal chat over a million tokens of documents. It is a sensible default for conversational products, where Arena voters rank it above every other Grok model, and for pipelines that mix extraction with judgment calls. For routine code it holds its own; when the task turns into a real engineering job, hand off to Grok 4.5 or Grok 4.6, which share the same API shape.

Grok 4.20 limitations

Thinking costs time. Artificial Analysis measures about 16 seconds to first token at the default effort, so it is the wrong pick for chat that has to feel instant; Grok 4.20 Non-Reasoning answers in 0.64 seconds.

Its Intelligence Index of 38 and 72.2% SWE-bench Verified put it a step below Grok 4.5 and Grok 4.6 on hard problems, and Grok 4.3 now delivers the same price point with better tool-calling scores.

The 0309 ID has been refreshed once already; re-test prompts after each xAI weight update.

Grok 4.20 Reasoning vs Non-Reasoning

Same weights, same price, one difference. Reasoning scores 38 on the Intelligence Index against 22 for Non-Reasoning and wins any task with a hidden step in it. Non-Reasoning answers in 0.64 seconds to first token instead of about 16, at 95.8 tokens per second, and is the better fit for extraction, routing, and short replies. Run Reasoning by default and drop to Non-Reasoning where you can measure that thinking does not change the output.

When to use Grok 4.20 Reasoning

Use it when you want a 1M-context model that thinks, calls tools, and ranks well with human voters, at a mid-range cost. Skip it when first-token latency is the product, or when the work is frontier coding, where the newer Grok models are clearly better.

SSS

Grok 4.20 hakkında sık sorulan sorular

xai/grok-4.20-0309-reasoning, called through the OpenAI-compatible POST /v1/chat/completions endpoint with your UnificAlly API key. The same model ID also works on /v1/responses and /v1/messages.

Bearer authentication is all it takes: create a key on the API keys page and put it in the Authorization header of calls to https://direct-api.unifically.com. The model ID is xai/grok-4.20-0309-reasoning, and because the chat endpoint is OpenAI-compatible, an OpenAI SDK with its base_url set to UnificAlly works too.

Use /v1/chat/completions with "model": "xai/grok-4.20-0309-reasoning" and messages; the reasoned reply lands in choices[0].message.content in the same response. Stream it with "stream": true (server-sent events ending in data: [DONE]), or use the /v1/responses and /v1/messages formats with the same ID.

Text and image input, text output. The context window is 1M tokens, and function calling, structured outputs, and streaming all work through the standard chat completions request.

It is the March 9, 2026 snapshot that xAI made generally available on the API on March 10, 2026. xAI refreshed the weights in April 2026, which Artificial Analysis tracks as the 0309 v2 release, and the same ID serves the current version.

Artificial Analysis measures 98.9 output tokens per second, #46 of 195 models and above the 70 median, with about 16 seconds to first token at the default effort because of the thinking phase.

72.2% on SWE-bench Verified in Vals AI's independent re-run, fifty-sixth of 88 models. It is a step below Grok 4.5 at 86.6% and Grok 4.6 at 95.6%, so use it for everyday code and tool loops rather than hard engineering.

Same weights and same price, but this model thinks before it answers. Reasoning scores 38 on the Artificial Analysis Intelligence Index against 22 for Non-Reasoning, and Non-Reasoning answers in 0.64 seconds to first token instead of about 16.

The 0309 reasoning build sits at #35 on the Arena text leaderboard with an Elo of 1472 across 62,263 votes as of September 2, 2026, a few places ahead of Grok 4.5 and Grok 4.6 high.