Home/xAI/Grok Code Fast
xAI pricing

Grok Code Fast API Pricing & Cost Calculator

Grok Code Fast is priced at $1.00 input / $2.00 output per 1M tokens with a 256K context window and 256K max output, making it the lowest per-call cost in xAI's current lineup. The trade-off against Grok 4.3 ($1.25/$2.50) is context: 256K here versus 1M there, for a 20% saving per call. Cached input $0.20/1M.

Input
$1.00
per 1M tokens
Output
$2.00
per 1M tokens
Context window
256K
tokens
Listed here
2026-09
≈ Estimated tokenizer·$1.00 in·$2.00 out (per 1M)
Quick start with a use case
Total cost per call$0.002000
Input$0.001000
Output$0.001000
Cost comparison
Standard
$0.002000
With Caching
$0.001600
Save 20% ↓
With Batch
Not supported
Cutting costs? Open models start at $0.28/1M

DeepSeek, Kimi & 200+ open models on Novita AI — often 5–20x cheaper than proprietary APIs for comparable tasks.

Try Novita AI

Affiliate link — we may earn a commission at no extra cost to you.

Detailed pricing

Grok Code Fast pricing breakdown

All pricing dimensions including caching and batch discounts.

TypePrice (per 1M tokens)
Input$1.0000
Output$2.0000
Cached input$0.2000
Cutting costs? Open models start at $0.28/1M

DeepSeek, Kimi & 200+ open models on Novita AI — often 5–20x cheaper than proprietary APIs for comparable tasks.

Try Novita AI

Affiliate link — we may earn a commission at no extra cost to you.

Last verified 2026-11-07 · xAI official pricing · ⚠️ Spotted a wrong price? Report in 30s →

How it compares

Grok Code Fast vs alternatives

Single-call cost (1000 input + 500 output tokens) ranked from cheapest.

ModelPer call
Grok Code Fast
xAI · this page
$0.002000
GPT-6 Luna
OpenAI
$0.000350
Claude Haiku 5.5
Anthropic
$0.000350
DeepSeek V3.2
DeepSeek
$0.000480
GPT-5.6 Luna
OpenAI
$0.000800
DeepSeek V4-Flash
DeepSeek
$0.000900
Recommended use

When to choose Grok Code Fast

Grok Code Fast shines for code generation and review, high-throughput, low-latency tasks, general-purpose tasks, and image and document understanding. Token counts are estimated within ~10-20% margin.

✓Context window of 256K tokens handles long conversations and large documents.
✓Prompt caching available — significant savings for repeated system prompts.
✓Tool / function calling supported.
FAQ

Frequently asked questions

Grok Code Fast costs $1.00 per 1M input tokens and $2.00 per 1M output tokens. A typical chat call (1000 input + 500 output tokens) costs approximately $0.0020. Use the calculator above to estimate your specific use case.
Grok Code Fast supports a 256K token context window with a max output of 256,000 tokens.
Yes. Cached input is priced at $0.20 per 1M tokens — 80% cheaper than uncached input. This is especially valuable for repeated system prompts, long-context retrieval, and chat threads with shared history.
Yes, Grok Code Fast accepts image input. Vision token pricing is generally calculated based on image dimensions and folded into the input token count. Specific image-specific pricing varies — refer to xAI's official documentation.
Token counts for Grok Code Fast are estimated from character ratios (~10-20% margin). Cost calculations use prices verified on 2026-11-07. For final billing accuracy, always verify with xAI's usage dashboard.
Grok Code Fast does not currently support fine-tuning. Consider another model in the xAI family if fine-tuning is required.