Grok (xAI) Token Counter & Pricing (2026)
xAI ships three Grok models on the public API in 2026: Grok 4.6 as the flagship, plus two cheap variants — Grok 4.6 Fast and Grok Code Fast — that route through the OpenRouter reseller. That's a narrower lineup than OpenAI or Anthropic, but the per-token rates are worth checking against the rest of the market before you commit.
Verified 2026-08-28 against docs.x.ai/docs/models and the OpenRouter reseller page.
Where Grok Stands in 2026
Grok 4.6 is the only Grok model with first-party pricing published on docs.x.ai. Grok 4.6 Fast and Grok Code Fast are listed on xAI's models page, but the rates we have for them are reseller quotes from OpenRouter — useful as a baseline, but worth re-confirming at request time if your budget depends on it.
How does it line up against the major flagships on input price? Grok 4.6 at $2.00/M input is the same as Claude Sonnet 5 ($2.00) and noticeably cheaper than GPT-6 Astra ($10.00) or Claude Opus 5 ($5.00). On output, Grok 4.6 at $6.00/M beats Anthropic's Opus tier ($25.00) and the GPT-6 flagship ($50.00), and lands in the same neighborhood as Gemini 2.5 Pro ($10.00) once you account for Grok's cheaper output ratio.
The two cheap variants are the interesting story. Grok 4.6 Fast at $0.20 input / $0.50 output is competitive with Mistral Small 4 ($0.15 / $0.60) and noticeably cheaper than Claude Haiku 4.5 ($1.00 / $5.00). Grok Code Fast at $0.20 / $1.50 is priced as a coding-specific variant — cheap input, middling output — and competes more on the input side than the output side against GPT-5.6 Luna ($0.20 / $1.20) or DeepSeek V4 Flash ($0.22 / $0.66).
Context window matters too. Grok 4.6 has a 500K context window, in line with the Claude 5 family but behind Gemini 3.x at 1M. We don't have published context windows for Grok 4.6 Fast or Grok Code Fast in the current data set — that field is blank on both rows. If you're planning long-context workloads, that's a verification gap worth closing before you build the pipeline.
Grok Models & Pricing (2026)
All rates are USD per 1 million tokens. Verified 2026-08-28.
| Model | Input | Output | Context | Source |
|---|---|---|---|---|
| Grok 4.6 | $2.00 | $6.00 | 500K | docs.x.ai/docs/models |
| Grok 4.6 Fast | $0.20 | $0.50 | — | docs.x.ai/docs/models (OpenRouter reseller) |
| Grok Code Fast | $0.20 | $1.50 | — | docs.x.ai/docs/models (OpenRouter reseller) |
A few things to notice in the table:
- Output is the expensive side. On Grok 4.6, output is 3× the input rate. On the two Fast variants the gap is narrower (2.5× and 7.5×), but input is always cheaper.
- No cached input discount in our data. Both Fast rows and the flagship row list cached: null. xAI may support prompt caching in production, but it's not in the price card we verified, so don't model cache savings into a Grok budget yet.
- No batch tier in our data. The notes on Grok 4.6 mention batch support, but no discount rate is published in the row we have. Verify before assuming any off-list price.
For comparison against the rest of the field at flagship-tier pricing, Grok 4.6 at $2.00 / $6.00 sits between Claude Sonnet 5 ($2.00 / $10.00) and Gemini 2.5 Pro ($1.25 / $10.00) on input, and below both on output. It's a credible mid-pack option for reasoning workloads.
How to Count Grok Tokens
xAI does not publish a browser-runnable tokenizer for Grok the way OpenAI ships tiktoken. The API returns token counts in every response under the usage field — prompt_tokens for input, completion_tokens for output — so the reliable way to count is to send a test request and read the response.
If you need to estimate offline before sending:
- English prose: roughly 1 token per 4 characters.
- Code with descriptive variable names: 1 token per 3–4 characters.
- Non-Latin scripts and emojis: 2–3 tokens per character.
The AI Token Calculator uses a character-based estimator for Grok models and labels the result Estimated (±15–20%). The label matters — these are not exact counts, and you should treat the estimate as a planning number, not a bill. For OpenAI models the same tool uses tiktoken (exact); for Llama and DeepSeek it uses HF transformers in the browser (±3%).
If your budget depends on the count, send one real request first and read usage.prompt_tokens to calibrate the estimator against your specific prompt shape.
Real Bill Examples
Four workloads, all using verified rates from the table above.
Example 1: Customer-support chatbot, 10,000 conversations/month. Average 500 input tokens and 200 output tokens per conversation. On Grok 4.6: 5,000,000 × $2.00/M + 2,000,000 × $6.00/M = $10.00 + $12.00 = $22.00/month. On Grok 4.6 Fast: 5,000,000 × $0.20/M + 2,000,000 × $0.50/M = $1.00 + $1.00 = $2.00/month.
Example 2: Long-document summarization, 1,000 documents/month at 50K input each, 1.5K summary output. On Grok 4.6: 50,000,000 × $2.00/M + 1,500,000 × $6.00/M = $100.00 + $9.00 = $109.00/month. On Grok Code Fast: 50,000,000 × $0.20/M + 1,500,000 × $1.50/M = $10.00 + $2.25 = $12.25/month — about 9× cheaper, with the trade-off being output quality on long-context reasoning.
Example 3: Code review agent, 500 reviews/month, 8K input / 2.5K output per review. On Grok Code Fast: 4,000,000 × $0.20/M + 1,250,000 × $1.50/M = $0.80 + $1.88 = $2.68/month. On Grok 4.6 the same workload is 4,000,000 × $2.00/M + 1,250,000 × $6.00/M = $8.00 + $7.50 = $15.50/month. For a code-review workload that doesn't need flagship reasoning, Code Fast is the obvious pick.
Example 4: Single heavy reasoning call — 100K input, 10K output. On Grok 4.6: $0.20 + $0.06 = $0.26 per call. Run 1,000 of those in a month and you're at $260. On Grok 4.6 Fast: $0.02 + $0.005 = $0.025 per call — $25/month for the same 1,000 calls, if Fast quality is acceptable.
The pattern across all four: output tokens drive the bill, and on Grok 4.6 the output rate (3× input) punishes long replies. If your workload produces verbose responses and you don't need flagship reasoning, the Fast variants are the better buy.
Frequently Asked Questions
What's the difference between Grok 4.6 and Grok 4.6 Fast? Grok 4.6 is xAI's flagship reasoning model at $2.00 input / $6.00 output per million tokens with a 500K context window, verified directly against docs.x.ai. Grok 4.6 Fast is a cheaper variant at $0.20 / $0.50 routed through OpenRouter as a reseller — the rate is a reseller quote, so confirm at request time if your budget is tight. The "Fast" naming suggests lower latency, but xAI doesn't publish latency benchmarks in our data.
Is Grok Code Fast only for coding? The model name implies coding-specific tuning. At $0.20 input / $1.50 output it's priced as a coding workload — cheap input (where code prompts live), more expensive output (where generated code lives). Nothing in the verified data restricts it to code only, but the price shape makes it most competitive on coding-style workloads.
How do I count tokens for Grok before sending? xAI doesn't publish a browser tokenizer, so the offline options are: (1) estimate using 1 token per 4 characters of English as a rough rule, (2) use a tool like the AI Token Calculator that applies a character-based estimator, or (3) send one real API call and read usage.prompt_tokens in the response, then use that number as a calibration baseline. The exact route depends on how much the count matters to your budget.
Where do I verify current Grok pricing? The authoritative source is docs.x.ai/docs/models for the rate card. For the two Fast variants routed via OpenRouter, also check the OpenRouter model page at request time, since reseller pricing can shift independently of xAI's first-party rate.
Sources
- docs.x.ai/docs/models — xAI official models page, retrieved 2026-08-28. Source for Grok 4.6, Grok 4.6 Fast, and Grok Code Fast rates and confidence levels.
- openrouter.ai — OpenRouter reseller pricing for Grok 4.6 Fast and Grok Code Fast. Reseller rates can drift from first-party rates; verify before committing budget.
- platform.openai.com/docs/pricing — OpenAI flagship pricing used for cross-provider comparison (GPT-6 Astra, GPT-5.6 family).
- docs.claude.com/en/docs/about-claude/pricing — Anthropic flagship pricing used for cross-provider comparison (Claude Opus 5, Claude Sonnet 5, Claude Haiku 4.5).
- ai.google.dev/gemini-api/docs/pricing — Google Gemini pricing used for cross-provider comparison (Gemini 2.5 Pro, Gemini 3.x family).