impulse

Grok Code Fast 1

Frontier lab
API id grok-code-fast-1
Azure AI Foundry retires it on 31 Jan 2027 (in 74 days). 2 hosts keep serving it.
Input / 1M
$1.00
at xAI
Output / 1M
$2.00
at xAI
Context window
256K
tokens
Max output
256K
tokens per reply
Hosts
3
4 listings
Released
-
date not published

Pricing

List prices at xAI, in US dollars per million tokens.

TierInput / 1MOutput / 1M
Standard$1.00$2.00
Cached input
80% off input
$0.20
Prompts over 200K tokens$2.00$4.00

What it costs a month

At xAI list prices, 30 days.

  • Chat assistant5,000 requests a day, 2K in / 0.5K out, cached$378
  • RAG over documents2,000 requests a day, 8K in / 0.6K out, cached$360
  • Coding agent1,000 requests a day, 40K in / 2K out, cached$648
  • Overnight batch20,000 requests a day, 4K in / 0.4K out$2,880
Use your own numbers

Where to run it

3 hosts serve Grok Code Fast 1. The comparison is on blended price, 3 parts input to 1 part output.

HostIn / out per 1M
xAILab API
grok-code-fast-1
$1.00 / $2.00
grok-code-fast-1
$0.20 / $1.50
−58% vs headline
Retires 31 Jan 2027
xai.grok-code-fast-1
$5.00 / $25.00
+700% vs headline
Show 1 more listings: regions, snapshots and variants
xAI
0825
grok-code-fast-1-0825
$1.00 / $2.00

Capabilities

Core

  • Streaming
  • Function calling
  • JSON mode
  • Structured outputs

Multimodal

  • Vision
  • Image input
  • Audio
  • Image generation
  • Video

Advanced

  • Reasoning
  • Tool calling
  • MCP
  • Prompt caching
  • Batch API
  • Embeddings
Takes in
TextImages
Produces
Text
Features
Prompt caching

Cheaper alternatives

Current models that cost less and keep most of what this one can do: tools, vision, reasoning, structured output, caching and enough context.

Same model, cheaper host

  • Azure AI Foundry
    grok-code-fast-1
    $0.20 / $1.50
    58% less

Smaller xAI models

No cheaper xAI model keeps its key capabilities.

Other frontier labs

  • Gemini 3.5 Flash Lite
    Google · on Google AI Studio
    $0.30 / $2.50
    Has every key capability
    32% less
  • GPT-5.4 Nano
    OpenAI · on OpenAI
    $0.20 / $1.25
    Has every key capability
    63% less
  • Claude Haiku 5.5
    Anthropic · on Anthropic
    $0.10 / $0.50
    Has every key capability
    84% less
  • GPT-6 Luna
    OpenAI · on OpenAI
    $0.10 / $0.50
    Has every key capability
    84% less

Open-weight picks

  • Kimi K2.7 Code
    Moonshot AI · on CLF AI Gateway
    $0.38 / $1.60
    Has every key capability
    45% less
  • Inkling Small
    Independent · on DeepInfra
    $0.45 / $1.20
    Has every key capability
    49% less
  • DeepSeek Flash
    DeepSeek · on DeepSeek
    $0.30 / $1.20
    Has every key capability
    58% less
  • Qwen3.7 Plus
    Alibaba Qwen · on Replicate
    $0.276 / $1.10
    Has every key capability
    61% less

Call it

Using xAI's API.

Python
import os
from openai import OpenAI

client = OpenAI(base_url="https://api.x.ai/v1", api_key=os.environ["XAI_API_KEY"])

completion = client.chat.completions.create(
    model="grok-code-fast-1",
    messages=[{"role": "user", "content": "Hello"}],
)
print(completion.choices[0].message.content)

Quick answers

How much does Grok Code Fast 1 cost?

On xAI, Grok Code Fast 1 costs $1.00 per million input tokens and $2.00 per million output tokens. Cached input costs $0.20 per million tokens. The cheapest host is Azure AI Foundry, at $0.20 per million input tokens and $1.50 per million output tokens.

Which APIs offer Grok Code Fast 1?

Grok Code Fast 1 runs on 3 APIs: xAI, Azure AI Foundry and Oracle OCI.

What is Grok Code Fast 1's context window?

256K tokens, with up to 256K tokens in one reply.

Is Grok Code Fast 1 being retired?

Azure AI Foundry retires it on 31 Jan 2027. 2 hosts keep serving it.

What are cheaper alternatives to Grok Code Fast 1?

Models that cost less and keep most of what it can do: Gemini 3.5 Flash Lite on Google AI Studio (32% less), GPT-5.4 Nano on OpenAI (63% less) and Kimi K2.7 Code on CLF AI Gateway (45% less). Grok Code Fast 1 itself costs 58% less on Azure AI Foundry. Savings are on a mix of 3 input tokens to 1 output token.

What is Grok Code Fast 1's API model id?

Use grok-code-fast-1 with xAI. Other hosts use their own ids: xai.grok-code-fast-1 on Oracle OCI.

Sources

Raw catalog entry for grok-code-fast-1 on xAI
{
  "cache_read_input_token_cost": 2e-7,
  "cache_read_input_token_cost_above_200k_tokens": 4e-7,
  "deprecation_date": "2026-05-15",
  "deprecation_source": "https://docs.x.ai/developers/migration/may-15-retirement",
  "input_cost_per_image_token": 0.000001,
  "input_cost_per_token": 0.000001,
  "input_cost_per_token_above_200k_tokens": 0.000002,
  "litellm_provider": "xai",
  "max_input_tokens": 256000,
  "max_output_tokens": 256000,
  "mode": "chat",
  "output_cost_per_token": 0.000002,
  "output_cost_per_token_above_200k_tokens": 0.000004,
  "source": "https://api.x.ai/v1/language-models",
  "successor_model": "xai/grok-build-0.1",
  "supports_function_calling": true,
  "supports_prompt_caching": true,
  "supports_reasoning": true,
  "supports_response_schema": true,
  "supports_tool_choice": true,
  "supports_vision": true
}