Independent, documentation-based guides to AI tools and smart home tech. How we research

Home › AI Coding & APIs › xAI API Pricing Explained: Grok Tokens, Tools and Media

xAI API Pricing Explained: Grok Tokens, Tools and Media

📚 Part of our AI API pricing guide · all coding guides

Checked November 12, 2026 against docs.x.ai (US dollar prices). This is a documentation-based explainer, not a hands-on test.

Quick verdict

Cheapest general model: grok-4.3 and the grok-4.20 family cost $1.25 input and $2.50 output per million tokens, with a 1-million-token context window.

Flagship: grok-4.7 costs $2 input and $6 output per million tokens, with a 500k context window.

Watch out for: once a prompt reaches 200k tokens, the whole request is billed at double the rate. Tool calls cost extra.

Flat pastel illustration of a code window with stacked token coins, a small price tag and a simple bar chart on a soft background

Illustration: AI Tool Audit, created with Google Gemini

On this page
  1. Grok text model prices
  2. The 200k-token price jump
  3. Tool calls cost extra
  4. Ways to pay less or more
  5. Image, video and voice
  6. Storage and other charges
  7. A quick cost example
  8. Which model should you choose?
  9. FAQ

Grok text model prices

xAI bills its API per million tokens, like OpenAI and Anthropic. Prices below are for prompts under 200k tokens. Cached input is what you pay when part of your prompt was already processed recently, such as a long system prompt you reuse.

ModelContextInputCached inputOutput
grok-4.7500k$2.00$0.50$6.00
grok-4.6500k$2.00$0.50$6.00
grok-4.5500k$2.00$0.30$6.00
grok-4.31M$1.25$0.20$2.50
grok-4.20-0309 (reasoning, non-reasoning, multi-agent)1M$1.25$0.20$2.50
grok-build-0.1256k$1.00$0.20$2.00

All prices are per million tokens. A useful detail: the cheaper grok-4.3 and grok-4.20 models have twice the context window of the flagship.

Cached input is where repeat workloads save money. On grok-4.7, cached input costs $0.50 instead of $2, a 75% cut. On grok-4.3 it drops from $1.25 to $0.20. If your app resends the same long instructions or reference text with every request, that discount adds up quickly over thousands of calls.

The 200k-token price jump

Every text model has a second price row for long prompts. If a request's prompt reaches 200k tokens, xAI bills all tokens in that request at the higher rate, not just the part above 200k. For every model listed, the long-context rate is exactly double: grok-4.7 goes to $4 input and $12 output, and grok-4.3 goes to $2.50 and $5.

In practice, keep prompts under 200k tokens wherever you can. Trimming a 210k prompt to 195k halves the cost of the entire call.

Tool calls cost extra

When Grok uses a server-side tool, you pay for the tool call on top of the tokens it reads and writes.

ToolPrice
Web Search$5 per 1,000 calls
X Search$5 per 1,000 posts, $10 per 1,000 profiles
Code Execution$5 per 1,000 calls
Collections Search$2.50 per 1,000 calls
File Attachments search$5 per 1,000 calls
View Image, View X Video, remote MCP toolsTokens only

X Search is billed per item returned, and xAI notes that parent and quoted posts count too. A search that pulls in long threads can cost more than you expect.

Ways to pay less or more

  • Batch API: 20% off. The discount covers input, output, cached and reasoning tokens on the main Grok models. Batch jobs don't count toward rate limits. Image and video generation stay at standard prices.
  • Priority processing: 2x. Priority requests cost double for every token type. You're only charged the priority rate when the response says it was served at priority.
  • US regional endpoint: 1.1x. Sending traffic to us.api.x.ai costs 10% more. When we checked, it was available for grok-4.7 and grok-4.6 only.

Image, video and voice

Model or servicePrice
grok-imagine-image$0.02 per image
grok-imagine-image-2.0$0.04 per image
grok-imagine-video-1.5$0.08 per second
grok-imagine-video-1.5-lite$0.02 per second
grok-imagine-video$0.05 per second
Speech to speech (grok-voice-3.0)$0.08 per minute
Speech to text$0.10 per hour (REST), $0.20 per hour (streaming)
Text to speech$15 per million characters

A 10-second clip on grok-imagine-video-1.5 works out to $0.80; on the lite model, $0.20.

Storage and other charges

Files cost $0.025 per GiB per day to store and Collections cost $0.10 per GiB per day. Downloads are $0.20 per GiB for both. xAI also charges a $0.05 fee per request when a usage-guideline violation is caught before generation in the Responses API. If a violation is caught after generation, you pay for the generation.

The pricing page doesn't list free credits or rate-limit tiers, so we don't quote any. Check your xAI Console for both.

A quick cost example

Say an app sends 1,000 requests a day, each with 5,000 input tokens and 1,000 output tokens. That's 5 million input and 1 million output tokens a day. On grok-4.3 it costs about $6.25 + $2.50 = $8.75 a day. On grok-4.7 it's $10 + $6 = $16 a day. Add 1,000 web searches and you add another $5. Run it through the Batch API and the token part drops by 20%.

Which model should you choose?

  • grok-4.3 or grok-4.20 for most apps: the lowest general rates and a 1M context window.
  • grok-4.7 when you need xAI's newest flagship and can keep prompts under 500k tokens.
  • grok-build-0.1 if its 256k context is enough and you want the lowest token prices on the page.
  • Batch API for anything that doesn't need an instant answer.

Compare with OpenAI API pricing, Anthropic API pricing and Gemini API pricing. If you only want to chat with Grok, see Grok plans explained, and our AI tool price table.

FAQ

How much does the Grok API cost?

It depends on the model. grok-4.3 costs $1.25 per million input tokens and $2.50 per million output tokens. grok-4.7 costs $2 and $6.

What is xAI's long-context pricing?

If a prompt reaches 200k tokens, the whole request is billed at the long-context rate, which is double the standard rate for each listed model.

Does xAI charge for web search?

Yes. Web Search costs $5 per 1,000 calls, on top of token costs. X Search costs $5 per 1,000 posts returned.

Is there a batch discount?

Yes. The Batch API is 20% cheaper on the main Grok text models, and batch requests don't count toward rate limits.

Sources