Grok Code Fast 1 API

A speedy and economical reasoning model that excels at agentic coding with function calling and structured outputs.

Modalities
TextText
In / Out price
$1/$2per 1M
Context window
250K tokens
Released
Sep 30, 2025

Grok Code Fast 1 overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 3, 2026.

SVG of a pelican riding a bicycle, written by Grok Code Fast 1 through AI/ML API

Grok Code Fast 1 by xAI

Its massive 256,000-token context window allows for handling large codebases and multi-file projects without truncation.

Grok Code Fast 1 specs

Model ID
x-ai/grok-code-fast-1
Developer
xAI
Context window
256,000 tokens
Max output
255,000 tokens
Input
Text
Output
Text
API
OpenAI-compatible, base URL https://api.aimlapi.com/v1

Grok Code Fast 1 Description

Grok Code Fast 1 is xAI's specialized, fast, and economical coding assistant optimized for agentic coding workflows. It excels at handling high-volume, practical software development tasks including code generation, debugging, editing, and multi-step agentic operations. Built with speed, efficiency, and cost-effectiveness in mind, Grok Code Fast 1 is particularly proficient in TypeScript, Python, Java, Rust, C++, and Go, offering deep integration into developer pipelines with structured, traceable reasoning outputs.

Performance Benchmarks

  • Context Window: 256,000 tokens (max prompt + response)
  • Max Output: Up to 16,000 tokens (playground capped)
  • Architecture: 314B-parameter Mixture-of-Experts (MoE) for speed and capability
  • Throughput: ~92 tokens per second

Performance Metrics

  • Accurate across coding tasks with 93.0% coding accuracy and 75.0% instruction following accuracy
  • Strong classification and knowledge performances: perfect in morality, email classification, general knowledge
  • Reasoning Accuracy: 80.0%, with visible step-by-step reasoning traces for developer inspection and steering
  • Competitive speed and throughput supporting real-time coding workflows

Key Capabilities

  • Massive long-context handling for entire codebases or multi-file projects
  • Agentic coding with native function/tool calls and multi-step operation chaining
  • Traceable reasoning outputs revealing intermediate steps to boost transparency and steerability
  • Multi-language support for practical software stacks including major modern programming languages
  • Economical pricing designed for high-volume developer use and iterative workflows

Optimal Use Cases

  • Agentic coding assistants for autonomous code writing, debugging, and system integration
  • Large-scale codebase analysis and multi-file editing without coherence loss
  • Coding research and evaluation demanding precise reasoning and logic transparency
  • Integration into CI/CD pipelines with high throughput and cost efficiency

Comparison with Other Models

vs. Grok 4: Grok Code Fast 1 trades some general reasoning and tool-use sophistication for much higher speed and cost efficiency specifically in coding workflows. Grok 4 better supports complex AGI-style reasoning and tool integration beyond coding.

vs. Claude 4 Opus: Claude excels in language safety and nuanced instruction following, while Grok Code Fast 1 delivers faster, structured agentic coding with visible reasoning traces.

vs. GPT-4o: GPT-4o leads in multimodal and browsing features; Grok Code Fast 1 focuses on coding speed, throughput, and agentic tool-enabled workflows.

Use cases

  • Agentic coding assistants for autonomous code writing, debugging, and system integration
  • Large-scale codebase analysis and multi-file editing without coherence loss
  • Coding research and evaluation demanding precise reasoning and logic transparency
  • Integration into CI/CD pipelines with high throughput and cost efficiency

Capabilities

  • Function calling
  • Streaming
  • Structured outputs
  • Reasoning

Grok Code Fast 1 benchmarks by Artificial Analysis

See how Grok Code Fast 1 scores on independent evaluations. Data retrieved Nov 3, 2026.

Benchmark results

Compare 10 models available on AI/ML API across 5 independent benchmarks.

Humanity's Last Exam

Expert-written questions across academic subjects.

Grok Code Fast 1 API pricing

Grok Code Fast 1 pricing in US dollars
UsagePriceUnit
Input$11M tokens
Output$21M tokens
Cached input$0.21M tokens

Prices from the AI/ML API price list, checked on Nov 4, 2026.

Grok Code Fast 1 vs other models: token prices

AI/ML API input and output rates for 5 models, per million tokens.

AI/ML API model prices in USD per million tokens
ModelInputOutput
Grok Code Fast 1$1$2
Grok Build 0.1$1$2
Grok 4.7$2$6
Grok 4.6$2$6
Grok 4.5$2$6

How to use the Grok Code Fast 1 API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "x-ai/grok-code-fast-1",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'

Related articles

All posts

Grok Code Fast 1 FAQ

What is the context window of Grok Code Fast 1?

Grok Code Fast 1 has a 256,000 tokens context window and can return up to 255,000 tokens.

What inputs and outputs does Grok Code Fast 1 support?

Grok Code Fast 1 takes text as input and returns text.

What is the model ID for Grok Code Fast 1?

Use x-ai/grok-code-fast-1 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.

How much does Grok Code Fast 1 cost?

Grok Code Fast 1 costs $1 input and $2 output per 1M tokens on AI/ML API, billed as you go with no subscription.

Does Grok Code Fast 1 support streaming?

Yes, Grok Code Fast 1 can stream responses as they are generated.

Who created Grok Code Fast 1?

Grok Code Fast 1 was built by xAI .

Is Grok Code Fast 1 a multimodal model?

No. It only handles text input and produces text output.

Can Grok Code Fast 1 call multiple tools at once?

Yes, it supports parallel tool calls along with function calling and structured outputs.

Start building with Grok Code Fast 1

Grok Code Fast 1 API

x-ai/grok-code-fast-1

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"

2Make your first request

curl 'https://api.aimlapi.com/v1/chat/completions' \
  -H "Authorization: Bearer $AIMLAPI_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "x-ai/grok-code-fast-1",
  "messages": [
    {
      "role": "user",
      "content": "Write a haiku about the ocean."
    }
  ]
}'