AIREITER

Grok 4.7 API Pricing and Coding Review

Last Updated: 2026-09-21 19:57:34

If you are evaluating Grok 4.7 for an API workflow, the headline is accurate but incomplete: xAI’s documentation lists $2 per million input tokens and $6 per million output tokens for the standard API. Grok 4.7 is officially exposed through the grok-4.7 model ID, but gateway prices, U.S.-regional routing, caching, and long-context use can change the number you actually pay.

The short answer: access is real, but $2/$6 is only the direct baseline

Grok 4.7 is not merely a rumor or a chat-only label. The official xAI page, updated September 21, 2026, documents API access through both the Responses API and Chat Completions. It lists a 500,000-token context window, text and image input, text output, function calling, web search, X search, and code execution.

The $2/$6 claim is confirmed specifically as the standard direct rate:

Route or usage modeInputOutputWhat it means
Direct xAI API, standard$2.00/M$6.00/MOfficial baseline for grok-4.7
xAI U.S. regional endpoint$2.20/M*$6.60/M*10% premium over standard pricing
OpenRouter standard listing$1.60/M$4.80/MGateway/provider price, not the direct xAI rate
Vercel AI Gateway promotion$1.20/M$3.60/MPromotional price shown through September 27, 2026

*The U.S. figures are calculated from xAI’s documented 10% premium, not separately printed headline prices. Budget direct xAI usage at $2/$6; treat gateway rates as route-specific and verify their terms and availability.

What xAI officially exposes

The official model identifier is grok-4.7. xAI shows three compatible access patterns: its SDK, an OpenAI-compatible client pointed at https://api.x.ai/v1, and a direct POST to https://api.x.ai/v1/responses.

The documented specification is relevant to agent work:

SpecificationxAI-documented value
Context window500,000 tokens
Knowledge cutoffMay 2026
Reasoning levelsLow, medium, high, xhigh
Default reasoningHigh
InputText and images
OutputText
APIsResponses API and Chat Completions
ToolsFunction calling, web search, X search, code execution
Standard input price$2/M tokens
Standard output price$6/M tokens

The documentation’s example asks the model to find and explain a bug in a JavaScript median function. That demonstrates API wiring, not coding quality. The page does not include an independent benchmark table, latency result, uptime commitment, or task-completion rate.

Grok 4.7 API pricing: the caveats that change the bill

Direct API versus gateway pricing

OpenRouter’s model page lists $1.60/M input, $4.80/M output, and $0.40/M cached reads. Vercel’s AI Gateway page shows a 40% promotional reduction to $1.20/M and $3.60/M, with the promotion ending September 27, 2026.

Gateway prices may reflect promotions or different routing; compare complete request costs rather than headline token rates.

U.S. regional routing

xAI documents https://us.api.x.ai/v1 as a U.S.-regional endpoint with a 10% token-usage premium. At the standard rate, the arithmetic is $2.20/M input and $6.60/M output.

Caching matters for repeated repository prompts

xAI recommends a cache-routing identifier: prompt_cache_key for the Responses API or the x-grok-conv-id header for Chat Completions. Routing repeated turns to the same server makes cache hits more reliable, while cache-cold requests can make you pay the full input price.

Cursor’s Grok 4.7 pricing table gives a hosted reference: $0.50/M for cache reads at the standard tier, versus $2/M uncached input. That is Cursor’s billing surface, not a promise that the direct xAI API uses identical cache pricing.

Long context is not free context

Cursor lists 256k as the standard context and 500k as the maximum. Its documentation says requests above 256k use higher long-context rates: standard usage is 2×, while Fast usage is 3×.

xAI confirms the 500k context capability but does not publish a separate long-context multiplier in the model summary. Check the billing rules for your route before assuming that 500k context uses the base price.

What the published coding evidence supports—and does not

The documented case for Grok 4.7 is extended agent work. xAI, Cursor, and OpenRouter position it around coding, long-running software engineering, self-verification, and long context. Cursor’s model documentation lists file search, file editing, shell commands, browser control, web access, image generation, and clarifying questions in its agent environment.

Those features justify a coding pilot, but they do not prove better bug-fixing, test-passing, or per-task economics. Run a reproducible repository test and log task success, retries, tool calls, wall-clock time, and total tokens.

The effort setting runs from low through xhigh, with high as the default. Higher effort can take longer and change usage; verify how your provider reports and bills reasoning before forecasting production costs.

Current knowledge work needs retrieval

Grok 4.7 accepts images, supports web and X search, and has a May 2026 knowledge cutoff. For current research, use retrieval or search and score citation accuracy, source coverage, revision count, and human correction time rather than judging prose alone.

What two example agent loops would cost

Use this simple model for direct standard pricing:

cost = (input_tokens / 1,000,000 × $2) + (output_tokens / 1,000,000 × $6)

Example requestInput costOutput costToken cost
100k input + 20k output$0.20$0.12$0.32
500k input + 50k output$1.00$0.30$1.30

The second example is a base-rate illustration. It can rise with a regional premium, long-context multipliers on a hosted route, uncached repeated prompts, provider-specific reasoning rules, and additional requests. A coding agent that makes ten requests can cost far more than one 500k-token request.

How to verify access before committing

  1. Use the official model ID. Send grok-4.7, not a guessed alias or a gateway-specific name.
  2. Start with a small Responses API request. xAI documents POST https://api.x.ai/v1/responses with Bearer authentication and a text input.
  3. Record usage from the response and invoice. Capture input tokens, output tokens, reasoning usage if exposed, tool calls, and the billed amount.
  4. Test caching separately. Repeat the same long system prompt with prompt_cache_key and compare the second request’s input billing.
  5. Test your context tier. Keep one run below 256k tokens and another above it if your application needs long repository context.
  6. Choose the endpoint deliberately. Use the standard endpoint for baseline economics; use the U.S. regional endpoint only when its data-location benefit justifies the 10% premium.
  7. Treat gateway prices as separate products. Verify promotion expiry, provider routing, fallback behavior, data-retention terms, and route-specific charges before using $1.20/$3.60 or $1.60/$4.80 in a forecast.
  8. Measure completed tasks. For coding, track tests passed, retries, tool calls, wall-clock time, and total cost per accepted change.

Grok 4.7 API FAQ

Is Grok 4.7 available through the official API?

Yes. xAI’s documentation lists the grok-4.7 model for the Responses API and Chat Completions, with SDK, OpenAI-compatible, and cURL examples.

Is $2 input and $6 output the confirmed price?

Yes, for the standard direct xAI API rate documented on September 21, 2026. A U.S.-regional endpoint adds 10%, while gateways may display different prices or promotions.

Is Grok 4.7 good for coding?

It is a sensible pilot candidate for long-running coding agents because the documented design includes tool use, adjustable reasoning, context compaction guidance, and up to 500k context. The available sources do not independently prove a coding win, so run it against your own repository tasks.

Does Grok 4.7 have a 500k context window?

Yes. xAI lists 500,000 tokens. Cursor separately describes 256k as its standard context and 500k as its maximum tier, with higher pricing above 256k.

Is Grok 4.7 Fast available through the public API?

No. xAI’s Grok 4.7 documentation describes Grok 4.7 Fast as the same model on faster infrastructure at twice the standard rates, but says it is not available through the public xAI API. It is listed for Cursor and Grok Build.

The decision: pilot it, but budget the route you will actually use

Grok 4.7’s API access and $2/$6 baseline are confirmed; its coding advantage is not. If your workload sends more than 256k tokens, depends on uncached repository context, uses U.S. routing, or triggers many reasoning calls, completed-task cost can look very different. Start with a measured pilot before migrating production work.