Ana içeriğe atla
xAI logosu

Grok 4.5 API

xAI

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

500k bağlam penceresi, görsel girişi ve üç akıl yürütme eforu seviyesiyle Cursor ile birlikte eğitilmiş xAI kodlama ve ajan modeli.

xai/grok-4.5

Dokümantasyon

Sohbet

Bir sohbet başlatın

500k bağlam penceresi, görsel girişi ve üç akıl yürütme eforu seviyesiyle Cursor ile birlikte eğitilmiş xAI kodlama ve ajan modeli.

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.5 API?

The Grok 4.5 API is live on UnificAlly as xai/grok-4.5, from $0.30 per 1M input tokens. Grok 4.5 is xAI's coding and agent model, released on the API on July 8, 2026 and trained jointly with Cursor on trillions of tokens of real editor sessions plus science, engineering, and math data. It accepts text and image input, outputs text, and runs on UnificAlly as xai/grok-4.5. The context window is 500k tokens, and reasoning effort is tunable at low, medium, or high, with high as the default. It is the mixture-of-experts base that Grok 4.6 was trained from, and the model xAI made the default inside Grok Build at launch.

Grok 4.5 API specs

Model IDxai/grok-4.5
EndpointPOST https://direct-api.unifically.com/v1/chat/completions
Request typesChat Completions, Responses (/v1/responses), Messages (/v1/messages)
InputText and images
OutputText
Context window500k tokens
Input rate$0.30/1M tokens
Output rate$0.90/1M tokens
Cache read rate$0.045/1M tokens

Billing is per token, with no subscription. The rates above apply to prompts of up to 200k tokens, and longer prompts bill at a higher rate. The pricing page shows the live Grok 4.5 API rate table.

How to use the Grok 4.5 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.5",
    "messages": [
      {"role": "user", "content": "Analyze the tradeoffs in this architecture."}
    ]
  }'

The response comes back synchronously with the completion:

{
  "id": "3f8e2a1c-7b4d-4e9a-9c2f-5d1e8b7a6c40",
  "object": "chat.completion",
  "created": 1710000000,
  "model": "xai/grok-4.5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "The main tradeoffs in this architecture are..."
      },
      "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
    }
  }
}

The usage object carries the token counts the request is billed on. Set "stream": true to receive tokens as they generate, and "reasoning_effort": "low" when you want a faster, cheaper answer. Send Grok 4.5 API requests to direct-api.unifically.com so long replies finish in full.

Grok 4.5 API parameters

ParameterTypeDefaultWhat it does
modelstringrequiredModel identifier. Use xai/grok-4.5
messagesarrayrequiredNon-empty array of message objects with role and content (a string or a content parts array). Allowed 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
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 requires a type and function definition
tool_choicestring or objectnoneControls which tool is called, if any. Options: none, auto, required, or a specific tool
response_formatobjectnoneSet { "type": "json_object" } to enable JSON mode when supported by the model

The Grok 4.5 API documentation has the full reference for all three endpoints.

Key features of Grok 4.5

Fourth on Terminal-Bench 2.1

79.3% resolution rate on the independent Terminal-Bench 2.1 board with the Cursor CLI harness, fourth of 17 entries, behind Claude Fable 5 at 83.8% and GPT-5.5 at 83.2% and just ahead of Claude Opus 4.8 at 78.9%. That run cost about $100 in tokens, the cheapest entry in the top ten.

Frontier-class intelligence, compact reasoning

Artificial Analysis scores it 56 on the Intelligence Index, #28 of 195 models and well above the class median of 36, at $0.43 per index task. It finished the index with 60M output tokens against a 71M median, so the thinking is short rather than chatty.

86.6% SWE-bench Verified, independently re-run

Vals AI's own harness puts Grok 4.5 at 86.6% on SWE-bench Verified, thirteenth of 88 models, at $0.54 per test. Grok 4.6 later took the same family to 95.6%, so this is the floor for the line, not the ceiling.

Fewer tokens per agent task

xAI's launch chart shows Grok 4.5 resolving SWE-Bench Pro tasks with 15,954 output tokens on average, about 4.2x fewer than Claude Opus 4.8 at max effort, and Artificial Analysis independently measures it as more concise than its class. Shorter agent loops cost less and finish sooner.

What Grok 4.5 is best for

  • Editor and CLI coding agents

    Fourth on Terminal-Bench 2.1 inside the Cursor CLI; strong at multi-file edits with tests.

  • Repository-scale bug fixing

    86.6% SWE-bench Verified on real GitHub issues in an independent re-run.

  • Long-horizon engineering runs

    Reinforcement-learning training on hundreds of thousands of multi-step software tasks.

  • Office and knowledge work

    Spreadsheets, slide decks, documents, finance, and legal tasks with structured outputs.

  • Visual input tasks

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

  • Cost-sensitive agent loops

    Compact reasoning and fewer output tokens per task keep long runs affordable.

Grok 4.5 use cases

Use Grok 4.5 behind coding agents that work a task end to end: read the repo, patch, run the tests, and keep going until they pass. It fits terminal automation, where it holds fourth place on Terminal-Bench 2.1. Office assistants are a stated training focus, so it does well building spreadsheets with multi-sheet formulas, drafting slide decks, and turning research into documents through function calling and structured JSON. With 500k tokens of context it takes a full design doc or issue thread in one request, with screenshots attached as image input. Add grok-build-latest style routing on your side and it doubles as the general reasoning model for Rust, C, and C++ work that smaller models fumble.

Grok 4.5 limitations

Grok 4.5 is not a chat-speed model. xAI quotes 80 tokens per second on its own serving, but Artificial Analysis measures 52 tokens per second and about 10 seconds to first token at high effort, both below the class median. Use low effort for quick replies.

The 500k context window is half of what Grok 4.3, Claude Fable 5, or GPT 5.6 Sol offer, which matters for the largest single-request workloads.

Knowledge reliability moved the wrong way against Grok 4.3: on AA-Omniscience its factual accuracy rose, but its hallucination rate roughly doubled from 25% to 54%. Ground it with retrieval for fact-heavy work.

On the harder Terminal-Bench 3.0 it drops to 17.8%, against 33.8% for Claude Fable 5 and 34.4% for GPT 5.6 Sol. Output is text only; image generation is the separate Grok Imagine family.

Grok 4.5 vs Grok 4.6

Grok 4.6 is Grok 4.5 trained further, and it wins every board they share. SWE-bench Verified rises from 86.6% to 95.6% on Vals AI's harness, the Artificial Analysis Intelligence Index moves from 56 to 61, and Grok 4.6 adds an xhigh effort level. Grok 4.5 keeps one edge: it is the model with the independent Terminal-Bench 2.1 result, and it thinks in fewer tokens. If your prompts and evals are already tuned for Grok 4.5, there is no rush; for new agent work start on Grok 4.6.

When to use Grok 4.5

Use Grok 4.5 when you want a proven agentic coder at a mid-range price point, especially for terminal and editor workflows, and when short reasoning traces matter more than the last few benchmark points. Skip it when you need sub-second first tokens, a 1M context window, or the strongest xAI model available, which is Grok 4.6.

SSS

Grok 4.5 hakkında sık sorulan sorular

xai/grok-4.5, 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.

Make a key on the API keys page and pass it as a Bearer token; the account balance is prepaid and charged by the tokens each request uses. Requests for xai/grok-4.5 go to https://direct-api.unifically.com, which lets long replies finish in full.

With "model": "xai/grok-4.5" and a messages array, /v1/chat/completions answers synchronously in choices[0].message.content and reports billed tokens in usage. Set "reasoning_effort": "low" for a faster, cheaper answer, or "stream": true to get tokens as they generate.

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

79.3% on Terminal-Bench 2.1 with the Cursor CLI harness, fourth of 17 entries on the independent board, and 86.6% on SWE-bench Verified in Vals AI's re-run, thirteenth of 88 models.

Three levels, low, medium, and high, with high as the default. Lower efforts answer faster and spend fewer tokens; high is the setting behind the benchmark numbers on this page.

Not for interactive chat. Artificial Analysis measures 52 output tokens per second and about 10 seconds to first token at high effort. It makes up for that with compact reasoning, finishing the Intelligence Index with 60M output tokens against a 71M median.

No. Grok 4.6 is the same family trained further and scores 95.6% on SWE-bench Verified against 86.6% for Grok 4.5, with an Artificial Analysis Intelligence Index of 61 against 56. Keep Grok 4.5 where prompts are already tuned for it; move new agent work to Grok 4.6.

Yes. It is a mixture-of-experts model trained jointly by xAI and Cursor on trillions of tokens of editor sessions plus science, engineering, and math data, and it is the model behind Grok Build and Cursor's Grok integration.