Chuyển đến nội dung chính
Logo xAI

Grok 4.7 API

xAI

Grok 4.7 thuộc dòng mô hình GrokXem tất cả mô hình Grok

Mô hình xAI cho lập trình, tác nhân chạy dài hạn và công việc tri thức, với cửa sổ ngữ cảnh 500k và bốn mức độ suy luận.

xai/grok-4.7

Tài liệu

Cuộc trò chuyện

Bắt đầu cuộc trò chuyện

Mô hình xAI cho lập trình, tác nhân chạy dài hạn và công việc tri thức, với cửa sổ ngữ cảnh 500k và bốn mức độ suy luận.

Enter để gửi · Shift+Enter để xuống dòng

UnificAlly không lưu trữ prompt và câu trả lời LLM của bạn. Chúng tôi chỉ lưu thông tin số token sử dụng để tính phí.

Sử dụng POST /v1/chat/completions với khóa API UnificAlly của bạn. Hỗ trợ system prompt, user prompt, tools, streaming và chế độ suy nghĩ khi khả dụng.

Cập nhật

What is the Grok 4.7 API?

The Grok 4.7 API is live on UnificAlly as xai/grok-4.7, from $0.30/1M tokens of input and $0.90/1M tokens of output. Grok 4.7 is xAI's top language model, released September 21, 2026 for coding, long-running agents, and knowledge work. It accepts text and image input, outputs text, and runs on UnificAlly as xai/grok-4.7. The context window is 500k tokens, the knowledge cutoff is May 2026, and reasoning effort is tunable across four levels: low, medium, high (the default), and xhigh. Unlike Grok 4.6, which was Grok 4.5 trained further, Grok 4.7 sits on a new, larger base model with a longer reinforcement learning run weighted toward tasks that take hours.

Grok 4.7 API specs

Model IDxai/grok-4.7
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
Input rate$0.30/1M tokens
Output rate$0.90/1M tokens
Cache read rate$0.075/1M tokens

The Grok 4.7 API bills per token, with no subscription. The rates above apply to prompts up to 200k tokens. The pricing page shows the live table, including the rates for longer prompts.

How to use the Grok 4.7 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.7",
    "messages": [
      { "role": "user", "content": "Read this service agreement and list every clause that shifts liability to the customer." }
    ]
  }'

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.7",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Four clauses shift liability to the customer..."
      },
      "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. Send requests to direct-api.unifically.com so long replies are not cut short by a proxy timeout.

Grok 4.7 API parameters

ParameterTypeDefaultWhat it does
modelstringrequiredModel identifier, xai/grok-4.7
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
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.7 API documentation has the full reference, including the Responses and Messages formats.

What's new in Grok 4.7

Opus-level CursorBench 4.0 score at half the cost

46.3% on CursorBench 4.0 at Extra High effort, next to Claude Opus 5 Max at 46.6% and ahead of GPT-5.6 Sol Max at 41.7%. Cursor's board puts the average cost at $6.01 per task against $11.95 for Opus 5 Max. Claude Fable 5.1 Max still leads at 51.8%, at $17.28 per task.

Top five on agentic legal work

Vals AI ranks it fifth of 63 models on Harvey's Legal Agent Benchmark at 19.58%, up from 15.8% for Grok 4.6, and fifth of 37 on Public Benefits Bench at 68.54%. These are multi-step tasks over real case files, not quiz questions.

Built for tasks that run for hours

A new, larger base model and a longer reinforcement learning run on harder, many-hour problems. It checks its own work more often and manages long context better, which shows on Terminal-Bench 2.1: 76.03% on Vals AI, 14th of 67.

A small step up in general intelligence

Artificial Analysis scores it 46 on Intelligence Index v4.3.2, 16th of 655 models, against 44 for Grok 4.6. Claude Fable 5.1 and GPT-6 Astra lead that board at 53.

Four reasoning efforts on one model

low, medium, high, and xhigh trade speed and token spend against depth per request. On CursorBench 4.0 that is 33.1% at $1.58 per task at low and 46.3% at $6.01 at xhigh.

What Grok 4.7 is best for

  • Editor coding agents

    46.3% on CursorBench 4.0 at roughly half the per-task cost of the models around it.

  • Long-running agents

    Trained on many-hour tasks; verifies its own work across long chains of steps.

  • Legal and public-sector work

    Fifth on Harvey's Legal Agent Benchmark and on Public Benefits Bench in Vals AI's runs.

  • Documents and presentations

    Stronger than Grok 4.6 at office deliverables, with structured outputs and function calling.

  • Visual input tasks

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

  • Hard problems at xhigh effort

    When answer quality matters more than the wait, xhigh buys extra reasoning.

Grok 4.7 use cases

Use Grok 4.7 behind coding agents that take a real issue from report to green tests: read the repo, patch, run, and try again. It fits legal and compliance assistants that read case files, apply rules, and return structured JSON through function calling. Office agents that draft reports, spreadsheets, and slide decks are a stated training focus. With 500k tokens of context, long contracts, design docs, and issue threads fit in one request, with screenshots included as image input.

Grok 4.7 limitations

Grok 4.7 is slow and wordy on long tasks. Artificial Analysis counted 240M output tokens across its Intelligence Index run against a 92M median, and Vals AI measured about 27 minutes per test on the Vals Index. Token spend climbs on the longest agent runs: Vals AI logged $12.73 per test on Terminal-Bench 4.0, where it scored 12.12%, 16th of 29.

It is not a clean win over Grok 4.6 everywhere. On the Vals Index it scores 54.15%, 24th of 59, behind Grok 4.6 at 59.17%. Competition math and programming are weak spots: 39.39% on IOI and 34.00% on ProofBench v1.1.

The 500k context window is half the 1M tokens Grok 4.3 takes, which matters for the largest single-request workloads. Output is text only, and image generation is a separate Grok Imagine family.

Grok 4.7 vs Grok 4.6

Grok 4.7 is a new, larger base model, where Grok 4.6 was Grok 4.5 trained further. The gains are in long agent work: CursorBench 4.0 rises from 40.4% to 46.3%, Harvey's Legal Agent Benchmark from 15.8% to 19.6%, and the Artificial Analysis Intelligence Index from 44 to 46. The broad Vals Index goes the other way, 54.15% against 59.17%. Input and output tokens cost the same on both. Move coding-agent, legal, and office traffic to 4.7, and keep Grok 4.6 where your prompts are already tuned and scoring well.

When to use Grok 4.7

Use Grok 4.7 when the task is long and the finish line matters: multi-hour coding runs, case-file review, report and deck building, and tool-calling workflows that punish shallow answers. Skip it when you need fast first tokens or the cheapest possible bulk calls.

Câu hỏi thường gặp

Câu hỏi thường gặp về Grok 4.7

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

With an account in place, create a key on the API keys page and attach it as Authorization: Bearer <key>. Requests for xai/grok-4.7 go to https://direct-api.unifically.com/v1/chat/completions, and usage is paid per call from a prepaid balance.

Grok 4.7 reads a messages array sent with "model": "xai/grok-4.7" to /v1/chat/completions, for example a contract to check for liability clauses, and returns its answer synchronously in choices[0].message.content. Token counts are in usage, "stream": true switches to server-sent events, and the same ID works on /v1/responses and /v1/messages.

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.

For coding agents and long tasks, yes. CursorBench 4.0 rises from 40.4% to 46.3%, and Artificial Analysis scores it 46 on the Intelligence Index against 44 for Grok 4.6. On the broader Vals Index it scores 54.15% against 59.17% for Grok 4.6, so test it on your own workload before moving everything over.

46.3% on CursorBench 4.0 at Extra High effort, level with Claude Opus 5 Max at 46.6% and ahead of GPT-5.6 Sol Max at 41.7%, at an average cost of $6.01 per task on Cursor's board. Vals AI also measures 76.03% on Terminal-Bench 2.1, 14th of 67 models. # price-ok: benchmark cost per task, not our rate

Four levels, low, medium, high, and xhigh, with high as the default. On CursorBench 4.0 the score climbs from 33.1% at low to 46.3% at xhigh, and the cost per task climbs with it, so pick the effort per request.

It is one of the strongest models measured so far. Vals AI ranks it fifth of 63 on Harvey's Legal Agent Benchmark at 19.58%, and fifth of 37 on Public Benefits Bench at 68.54%.

Not on long tasks. It thinks at length and writes a lot. Artificial Analysis counted 240M output tokens across its Intelligence Index run against a 92M median, and Vals AI measured about 27 minutes per test on its index. Pick it for depth, not for instant chat replies.