AI API PricesxAI (Grok) › Grok Code Fast 1

Grok Code Fast 1 pricing

Grok Code Fast 1 API cost from xAI (Grok) — $0.200 per 1M input tokens and $1.50 per 1M output tokens. Code-specialised. Estimate your real monthly bill below, then compare it against every other model.

Input price
$0.200
per 1M input tokens
Output price
$1.50
per 1M output tokens
Context window
256K
tokens per request
Reference call
$0.0017
1K in + 1K out

Balanced 256K context · all prices USD per 1M tokens, list price last verified 2026-06-27.

Grok Code Fast 1 capabilities & limits

Representative specs for this tier — confirm exact limits in the xAI (Grok) docs.

Context window256K
Max output32K
Knowledge cutoffAug 2025
API formatOpenAI-compatible
✓ Tools / functions✓ JSON / structured

API acting up? Check live xAI (Grok) status → · all AI API status

Call Grok Code Fast 1 from your code

The exact model string and endpoint to use. Works with the OpenAI SDK — just point base_url at the URL below.

Model stringgrok-code-fast-1
Base URLhttps://api.x.ai/v1
API key envXAI_API_KEY
curl https://api.x.ai/v1/chat/completions \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-code-fast-1",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Model strings follow each provider's naming convention; confirm the current id in the xAI (Grok) docs before relying on it.

What a Grok Code Fast 1 API call actually costs

Blended input + output cost at Grok Code Fast 1's list rates — useful yardsticks before you commit to volume.

$0.0017
Short call
1K in · 1K out
$0.0014
Chat turn
3K in · 500 out
$0.0055
RAG / long prompt
20K in · 1K out
$1.70
1M in + 1M out
bulk job

Grok Code Fast 1 cost calculator

Enter your monthly volume to estimate the Grok Code Fast 1 bill. Runs entirely in your browser.

Estimated monthly cost

For the full multi-model breakdown, use the cost calculator.

xAI (Grok) models — Grok Code Fast 1 in context

How Grok Code Fast 1 prices against its siblings. Cheapest reference cost first.

Model Input /1M Output /1M Cost / call* Context Type
Grok 3 mini $0.100 $0.300 $0.0004 128K Fast / cheap
Grok 4 Fast
2M context
$0.200 $0.500 $0.0007 2M Fast / cheap
Grok Code Fast 1
Code-specialised
$0.200 $1.50 $0.0017 256K Balanced
Grok 4
Flagship
$3.00 $15.00 $0.018 256K Flagship

*Reference cost of one call with 1,000 input + 1,000 output tokens — a neutral yardstick. Use the calculator for your real usage. Cheapest row highlighted.

Cheaper than Grok Code Fast 1? In the same balanced tier, Command R runs $0.150 in / $0.600 out. The overall cheapest model tracked is Gemini 1.5 Flash-8B — see the cheapest LLM API guide.

How Grok Code Fast 1 pricing works

Grok Code Fast 1 is billed per token: a lower input price of $0.200 per million tokens for everything you send, and a higher output price of $1.50 per million for everything the model generates. To turn that into a real Grok Code Fast 1 bill, multiply by your monthly request volume and average prompt/response length — the calculator above does exactly that.

Grok Code Fast 1 does not list a separate cached-input rate, so every input token bills at $0.200 per million. If repeated context is a big part of your prompts, a model with prompt caching may end up cheaper in practice.

List prices move fast — always confirm the current numbers on the official xAI (Grok) pricing page before relying on them for budgeting.

Grok Code Fast 1 pricing FAQ

How much does the Grok Code Fast 1 API cost?

Grok Code Fast 1 costs $0.200 per 1M input tokens and $1.50 per 1M output tokens. A typical 3K-input / 500-output call works out to about $0.0014.

What is Grok Code Fast 1's context window?

Grok Code Fast 1 has a 256K-token context window. Tokens you put in the prompt are billed at the $0.200 per 1M input rate.

Does Grok Code Fast 1 charge extra for output tokens?

Yes. Output (generated) tokens cost $1.50 per 1M, versus $0.200 per 1M for input — about 7.5× more, which is normal for LLM APIs.

Is there a cheaper alternative to Grok Code Fast 1?

In the same balanced tier, Command R (Cohere) is cheaper at $0.150 in / $0.600 out. The overall cheapest model on the market is Gemini 1.5 Flash-8B.

Compare Grok Code Fast 1 with other models