Grok Code Fast 1 API Pricing
- Input / output
- $1.00 / $2.00 per 1M tokens
- Cache read
- $0.20 / 1M
- Context
- 256K tokens
- Max output
- 256K tokens
As of November 24, 2026, Grok Code Fast 1 costs $1.00 per 1M input tokens and $2.00 per 1M output tokens on xAI, with cache reads at $0.20 per 1M tokens. Across 3 providers on LiteLLM, the input price ranges from $0.20 to $5.00. It has a 256,000-token context window and returns up to 256,000 tokens per response.
xai/grok-code-fast-1.Grok Code Fast 1 pricing by provider
4 listings across 3 providers. Token prices are in US dollars per 1M tokens. The highlighted row is the price quoted above.
| Provider | Model name in LiteLLM | Input | Output | Cache read | Context |
|---|---|---|---|---|---|
| xAI | xai/grok-code-fast-1 | $1.00 | $2.00 | $0.20 | 256K |
| xAIsnapshot 0825 | xai/grok-code-fast-1-0825 | $1.00 | $2.00 | $0.20 | 256K |
| Azure AI Foundry | azure_ai/grok-code-fast-1 | $0.20 | $1.50 | – | 256K |
| Oracle Cloud (OCI) | oci/xai.grok-code-fast-1 | $5.00 | $25.00 | – | 128K |
Other Grok Code Fast 1 prices on xAI
| Input above 200K tokens | $2.00 per 1M tokens |
| Output above 200K tokens | $4.00 per 1M tokens |
| Cache read above 200K tokens | $0.40 per 1M tokens |
What Grok Code Fast 1 costs in practice
1,000 requests with 2,000 input and 500 output tokens each
| xAI | $3.00 |
| Azure AI Foundry | $1.15 |
| Oracle Cloud (OCI) | $22.50 |
100 long-document requests with 100,000 input and 2,000 output tokens each
| xAI | $10.40 |
| Azure AI Foundry | $2.30 |
| Oracle Cloud (OCI) | $55.00 |
Grok Code Fast 1 cost calculator
At xAI's price ($1.00 input, $2.00 output per 1M tokens), 10,000 requests a day with 1,000 input and 500 output tokens each cost $20.00 a day, about $600 a month. Change the numbers for your workload, or compare it with other models.
- Per request
- $0.002
- Per day
- $20.00
- Per month (30 days)
- $600
Grok Code Fast 1 features
Input: text, image. Output: text.
- Function calling
- Structured output
- Image input
- Reasoning
- Prompt caching
- Web search
Use Grok Code Fast 1 with LiteLLM
Call Grok Code Fast 1 through the LiteLLM Python SDK, or put it behind the LiteLLM proxy and send OpenAI-format requests to /v1/chat/completions. LiteLLM tracks the cost of every request at these prices.
from litellm import completion
response = completion(
model="xai/grok-code-fast-1",
messages=[{"role": "user", "content": "Hello!"}],
)model_list:
- model_name: grok-code-fast-1
litellm_params:
model: xai/grok-code-fast-1
api_key: os.environ/XAI_API_KEYcurl http://0.0.0.0:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "grok-code-fast-1",
"messages": [{"role": "user", "content": "Hello!"}]
}'Grok Code Fast 1 FAQ
How much does Grok Code Fast 1 cost?
Grok Code Fast 1 costs $1.00 per 1M input tokens and $2.00 per 1M output tokens on xAI, with cache reads at $0.20 per 1M tokens. Above 200K input tokens, input costs $2.00 and output costs $4.00 per 1M tokens. Across 3 providers on LiteLLM, the input price ranges from $0.20 to $5.00.
What is the context window of Grok Code Fast 1?
Grok Code Fast 1 has a 256,000-token context window and returns up to 256,000 tokens per response.
Which providers offer Grok Code Fast 1?
Grok Code Fast 1 is available from 3 providers through LiteLLM: xAI, Azure AI Foundry and Oracle Cloud (OCI). The lowest price is on Azure AI Foundry.
How do I call Grok Code Fast 1 with an OpenAI-compatible API?
Use the LiteLLM Python SDK with model="xai/grok-code-fast-1", or add the model to the LiteLLM proxy's config.yaml and send requests to /v1/chat/completions from any OpenAI client. LiteLLM tracks the cost of every request at the prices on this page.
What features does Grok Code Fast 1 support?
Grok Code Fast 1 supports function calling, structured output, image input, reasoning, prompt caching and web search.
When did LiteLLM add Grok Code Fast 1?
Grok Code Fast 1 was added to LiteLLM's model price file in September 2025.
Is Grok Code Fast 1 being deprecated?
xAI deprecated xai/grok-code-fast-1 on May 15, 2026.
Sources
Prices come from LiteLLM's open-source model_prices_and_context_window.json, which LiteLLM uses to calculate the cost of every request. Maintainers update it from each provider's published pricing, and this page is usually rebuilt within 20 minutes of every change. Provider pricing pages:
- api.x.ai/v1/language-models
- learn.microsoft.com/en-us/azure/foundry/foundry-models/concepts/models-sold-directly-by-azure
- www.oracle.com/artificial-intelligence/generative-ai/generative-ai-service/pricing
LiteLLM docs: xAI, Azure AI Foundry, Oracle Cloud (OCI).
Provider pages: xAI, Azure AI Foundry, Oracle Cloud (OCI).