Grok API pricing for every model, newest first

By TechCompare · Updated · How we check

Grok 4.7 is the newest Grok, at $0.155 for a 100,000 token prompt with a 5,000 token answer and half the input cached. Grok Build 0.1 runs the same call for $0.07, the lowest of any Grok xAI sells.

Every Grok model and its API price

Newest first. Prices are per 1M tokens. One request is 100K tokens in and 5K out, with 50% of the input cached.

ModelInputOutputCachedContextOne requestListed
Grok 4.7xAI$2$6$0.50500K$0.155Sep 21, 2026
Grok 4.6xAI$2$6$0.50500K$0.155Aug 12, 2026
Grok 4.5xAI$2$6$0.30500K$0.145Jul 8, 2026
Grok Build 0.1xAI$1$2$0.20256K$0.07May 20, 2026
Grok 4.3xAI$1.25$2.50$0.201M$0.085Apr 30, 2026
Grok 4.20xAI$1.25$2.50$0.202M$0.085Mar 31, 2026
Grok 4.20 Multi-AgentxAI$1.25$2.50$0.202M$0.085Mar 31, 2026

Listed is the day OpenRouter added the model. Prices checked Nov 14, 2026.

Grok comes from xAI, which took the SpaceXAI name after its merger with SpaceX. OpenRouter lists the maker under the new name, but Grok kept its own, and the API docs still live at docs.x.ai. This page lists all 7 Grok models OpenRouter carries, newest first, at the price xAI charges on its own API.

Grok 4.7 is the newest, at $2 per million input tokens and $6 per million output tokens. Next to it sit Grok Build 0.1, a coding model trained for agent work, and Grok 4.20 Multi-Agent, which runs several agents in parallel on one request.

Newest
Grok 4.7
$2 in, $6 out per 1M
Lowest cost per request
Grok Build 0.1
$0.07 for the request in the table
Largest context
Grok 4.20
2M tokens

Calculator

Cost Comparison

Based on 100,000 input tokens (50% cached), 5,000 output tokens, and 100 requests.Prices come live from OpenRouter at each maker's own price where it's listed. Temporary deals are left out.

Loading model prices

How to read the Grok prices

Each row shows xAI's own price. Input and output are per million tokens, and cached is what a token read back from the prompt cache costs, which is most of the prompt in a long chat or an agent loop.

The newest model isn't the lowest cost one xAI sells. For the example request Grok 4.7 costs $0.155 and Grok Build 0.1 costs $0.07. Over 10,000 calls that's $1,550 against $700.

Grok Build 0.1 is built for coding agents in an editor or a terminal, at $1 input and $2 output per million with a 256K window. Grok 4.20 Multi-Agent prices its tokens like any other row. But one request fans out to several agents that each read and write, so a single call can use many times the tokens of a normal one. Budget it per task, not per call.

Long prompts have their own rate. On Grok 4.7, a prompt past 200,000 tokens bills $4 input and $12 output per million, so check where your longest prompts land. The largest window belongs to Grok 4.20, at 2M tokens, against 500K on Grok 4.7.

Caching is where most of the savings are. On Grok 4.7 a cached token costs $0.50 per million, 75% off the normal input rate, and an agent that resends the same prefix every turn pays that rate for most of its input.

Verdict

Start with Grok 4.7, the newest Grok, and test Grok Build 0.1 next to it. Run the same prompts through both and compare the cost per accepted answer, since a retry pays for the whole call again. For coding agents, give Grok Build 0.1 a run too, since that's the job it was trained for.

Keep the cached part of your prompt stable, because a prefix that changes every turn can't be read from cache. Reach for Grok 4.20 when your prompts don't fit in 500K tokens. Prices change, so check the table again before you commit to a large budget.

More LLM pricing scenarios

Frequently asked questions

How much does the Grok API cost?
It depends on the model. Grok 4.7, the newest, costs $2 per million input tokens and $6 per million output tokens. Grok Build 0.1 is the lowest cost Grok xAI sells for a 100,000 token prompt with a 5,000 token answer, at $1 input and $2 output per million. The table at the top lists every model.
Is Grok made by xAI or SpaceXAI?
Both names mean the same maker. xAI took the SpaceXAI name in July 2026 after merging with SpaceX, and OpenRouter now lists Grok under SpaceXAI. The product kept the Grok name, and the API docs, model ids and keys still use x.ai.
Which Grok model is best for coding?
xAI trained Grok Build 0.1 for agentic coding, and it lists $1 input and $2 output per million. The newest general model, Grok 4.7, is worth a test too. Try both on a real task from your own repo, since the right pick depends on how much the agent has to read.
Which Grok model has the largest context window?
Grok 4.20 has the largest window at 2M tokens. Grok 4.7, the newest, reads up to 500K. Grok 4.20 bills a prompt past 200,000 tokens at $2.50 input and $5 output per million.
Does the Grok API have prompt caching?
Yes. Cached input on Grok 4.7 costs $0.50 per million tokens, 75% off the normal input rate. A chat or agent that resends the same prefix every turn pays the cached rate for that part. Each model's cached rate is in the table.
How much do 10,000 Grok API calls cost?
For a 100,000 token prompt with a 5,000 token answer and half the input cached, 10,000 calls cost $1,550 on Grok 4.7 and $700 on Grok Build 0.1. Retries and tool output add tokens this example leaves out, so measure a week of real traffic first.
Where do these prices come from?
From OpenRouter's model list, which we check on a regular schedule. A row shows xAI's own price when xAI sells the model, and the host that charges least when it doesn't. Check xAI's model documentation before you commit to a large budget.