Grok 4.7 API pricing and cost calculator
A Grok 4.7 call with 100,000 input and 5,000 output tokens costs $0.23 uncached and $0.155 with half the input cached. Past 200,000 input tokens the whole request bills at $4 input and $12 output per million, so check prompt length before you scale.
Grok 4.7 is SpaceXAI's model for coding, agentic tasks and knowledge work, and it succeeds Grok 4.6. It reads text, image and file input inside a 500,000 token context window. The standard rates are $2 per million input tokens and $6 per million output tokens. Cache reads cost $0.50 per million, 75% off the uncached input rate, and that matters because a coding agent resends the same long prefix on every turn. Prompts past 200,000 tokens move to a different tier, so prompt length is a pricing variable here as well as a limit. This page prices whole requests and sessions so you can see where the money goes.
By TechCompare · Updated
SpaceXAI: Grok 4.7
xAI's own price
- Input
- $2
- Output
- $6
- Cached
- $0.50
per 1M tokens
Price checked 2026-11-07
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.
How this is calculated
A request with 100,000 input and 5,000 output tokens costs $0.20 for input and $0.03 for output when nothing is cached, which makes $0.23 per call. Reading half the input from cache brings the call to $0.155, and 100 calls a month come to $15.50. Past 200,000 input tokens the whole request moves to $4 input, $1 cache reads and $12 output per million, not just the tokens beyond the line. A 300,000 input and 5,000 output request crosses it, so it costs $1.26 with no cache hits and $0.81 with half the input cached. Agent work is where the cache rate earns its place. A coding session of 60 turns that each send 50,000 input tokens, mostly cached, and write 1,200 output tokens costs $2.382 in total. The same session with no cache hits costs $6.432. Batch jobs have their own discount. Both input and output come in 20% below standard. A nightly review job of 5,000 requests with 30,000 input and 3,000 output tokens each costs $312 in batch and $390 at standard rates.
Verdict
Price Grok 4.7 on finished tasks. A coding or agent task usually takes many calls, and each call adds its own input, cache reads and output. Record those totals on a sample of your real work, then multiply by your volume. Keep the cached prefix stable, since a prefix that changes every turn can't be read from cache. Watch where your longest prompts land against the 200,000 token line, because crossing it reprices the whole call. Ask xAI's documentation whether cached tokens count toward that line before you design around it. Image and file inputs turn into tokens too, so measure them on real samples. If you're deciding whether to move up from Grok 4.6, run the same prompts through both and compare cost per accepted result, not cost per call.
More API Standalones scenarios
Related guides
Frequently asked questions
How much does Grok 4.7 cost per million tokens?
What happens when a Grok 4.7 prompt gets long?
How much does a Grok 4.7 coding agent session cost?
What does Grok 4.7 batch processing save?
Is Grok 4.7 priced differently from Grok 4.6?
What input does Grok 4.7 accept and how large is the context window?
Related tools
LLM VRAM Calculator
Calculate the VRAM needed to run or fine-tune any LLM at any quantization.
Use tool ➜Power Cost Estimator
Estimate annual electricity costs for your PC, Server, or TV.
Use tool ➜Data Transfer Calculator
Estimate transfer times for files over USB, WiFi, Ethernet, and more.
Use tool ➜JSON Formatter
Validate, format, and minify JSON. Browse it as a tree, run JSONPath queries, compare two documents, or validate against a JSON Schema.
Use tool ➜