The Grok API charges per million tokens. Three rules decide most of your bill: the model you pick, whether your input is cached, and whether a prompt reaches 200,000 tokens. According to xAI's pricing page on November 13, 2026, grok-4.7 cost $2.00 per million input tokens and $6.00 per million output tokens below that threshold, and grok-4.3 cost $1.25 and $2.50.

What to know before you build on it:

  • Long prompts cost double on every token. At 200,000 prompt tokens, the whole request moves to the higher rate.
  • Cached input is cheaper. On grok-4.7 it costs a quarter of fresh input.
  • Tools are billed separately. Web search, code execution and file search have a fee per 1,000 calls on top of tokens.
  • Batch jobs get 20% off on the main Grok 4 models.

Grok API prices by model

Here are the text models on xAI's pricing page, in US dollars per million tokens (input / cached input / output), below and above the 200,000-token prompt threshold:

Model Under 200K prompt tokens 200K and above Context
grok-4.7, grok-4.6 $2.00 / $0.50 / $6.00 $4.00 / $1.00 / $12.00 500K
grok-4.5 $2.00 / $0.30 / $6.00 $4.00 / $0.60 / $12.00 500K
grok-4.3, grok-4.20 models $1.25 / $0.20 / $2.50 $2.50 / $0.40 / $5.00 1M
grok-build-0.1 $1.00 / $0.20 / $2.00 $2.00 / $0.40 / $4.00 256K

The grok-4.20 family includes reasoning, non-reasoning and multi-agent versions at the same prices. Access to models varies by team and region, xAI notes. Check your console before you plan around one.

The 200K rule

xAI's wording is short: "requests whose prompt reaches the listed token threshold are billed at the higher rate for all tokens in the request." It is not a higher rate on the extra tokens only. A request with a 199,000-token prompt is billed at the low rate; one with 201,000 tokens pays double on all of them, output included.

Two ways to stay under it:

  • Retrieve, don't paste. Send the passages that answer the question, not the whole document set.
  • Trim the history. Long chats grow every turn; summarize older turns instead of resending them.

Tool fees

Tools are billed "on token usage plus tool invocations," according to the pricing page. The fees per 1,000 calls in November 2026:

  • Web search: $5.
  • X search: $5 per 1,000 posts, $10 per 1,000 profiles.
  • Code execution and attachment search: $5 each.
  • Collections search: $2.50.

Image understanding and remote MCP tools are billed on tokens only, so their cost shows up in your token count rather than as a separate line. A search-heavy assistant can spend more on tool calls than on tokens, so log how often the model calls each tool.

Batch, priority and regional pricing

The pricing page lists three ways the rate changes:

  • Batch API: "20% off standard rates" for grok-4.7, grok-4.6, grok-4.5, grok-4.3 and the grok-4.20 models.
  • Priority processing: "2x" the standard rate, for text through the Chat Completions and Responses APIs.
  • US regional endpoint: "1.1x" the global token rates, for grok-4.7 and grok-4.6 only.

What a real app costs a month

Take an internal assistant that answers 10,000 questions a month. Each request sends 3,000 input tokens (instructions plus retrieved documents) and gets 600 tokens back: 30 million input and 6 million output tokens a month. The traffic is our assumption for the example.

  • grok-4.7, no cache: 30 × $2.00 + 6 × $6.00 = $96 a month.
  • grok-4.7, half the input cached: 15 × $0.50 + 15 × $2.00 + 6 × $6.00 = $73.50 a month.
  • grok-4.3, no cache: 30 × $1.25 + 6 × $2.50 = $52.50 a month.
  • grok-4.7 through the Batch API, no cache: $96 minus 20% = $76.80 a month, for work that can wait.

Grok API: one month of an internal assistant

Figure: monthly cost of 10,000 requests (3,000 input and 600 output tokens each) under four setups, from xAI's pricing page on November 13, 2026. Traffic is an assumption for the example; tool calls not included.

Add tool calls on top: if each question triggers one web search, that is 10,000 calls, or $50 a month. Over 12 months, the no-cache grok-4.7 setup with one search per question comes to about $1,750 in API fees. Add setup time and monitoring, which depend on your team.

Common billing mistakes

Four settings raise a Grok bill without anyone noticing:

  • One long request crosses 200,000 prompt tokens. The whole request then pays double, so log the prompt size of your largest requests, not only the average.
  • Priority processing left on. It costs twice the standard rate, so use it only for traffic where speed is worth paying for.
  • The US regional endpoint by default. It adds 10% to token rates on grok-4.7 and grok-4.6. Use it only if you need US-based processing.
  • Unlimited tool calls. A model that searches the web for every question adds $5 per 1,000 searches. Limit tools to the tasks that need them.

How to estimate your own bill

You can price your own use case in four steps:

  1. Measure a typical request. Log 20 real requests and note the input and output tokens of each, plus the largest prompt you see.
  2. Split the input. Count how much of each prompt repeats from one request to the next. That part can be billed at the cached rate; the rest at the normal rate.
  3. Count tool calls. Note how many searches or code runs a typical request triggers.
  4. Multiply. Monthly cost = (cached input × cached price) + (fresh input × input price) + (output × output price), each in millions of tokens, plus tool calls × fee per 1,000 ÷ 1,000.

Run the same sheet for grok-4.3 and grok-4.7. If grok-4.7 only fixes a small share of answers, send just those cases to it.

Questions to settle before you switch

If you are moving from another provider, settle these first:

  • Which model names will your code call? Use the names on xAI's pricing page today, and check that your team has access to them.
  • What happens at 429 errors? Add retries with a short wait, and decide what users see when the limit is reached.
  • Who watches the spend? Your rate limits rise with spend, so a budget alert matters as much as the limit itself.

Rate limits

xAI sets limits per model on two dimensions, requests per second and tokens per minute, and raises them by spend tier. Its rate-limit page lists tiers by cumulative spend since January 1, 2026: $0, $50, $250, $1,000 and $5,000, then Enterprise on request. Above the limit you get an HTTP 429 error. Tokens per minute count prompt, completion, reasoning and cached tokens.

How to choose a model

Pick by the task, not by the brand. A support assistant that answers from your documents rarely needs the most expensive model; a tool that writes and checks code may. Start with the cheapest model that passes your own tests: run 50 to 100 real requests on grok-4.3 or grok-build-0.1, and move only the failing cases to grok-4.7. Compare the share of good answers, the cost per request with tool calls included, and the response time. The cheapest token price does not always give the cheapest app.

Getting help to build it

If you want someone to set up retrieval, caching and tool calls properly, look for engineers who have shipped an LLM feature to production: RAG engineers for assistants that answer from your documents, or AI agent developers for tools that take actions, or post the project with your volumes and model choice. Our guide on AI development cost covers the build side of the budget, and how to hire an AI engineer lists the interview questions that separate demos from production work.

The short version

Price your app on grok-4.3 or grok-build first. Keep your prompts under 200,000 tokens and reuse the same opening instructions so more input can be billed at the cached rate. Count tool calls separately, and send work that can wait through the Batch API. Check xAI's pricing page before launch, because model names and prices change often.

Sources: xAI documentation: pricing, models and rate limits. All read November 13, 2026.