Grok Code Fast 1 API

x-ai/grok-code-fast-1
Grok Code Fast 1 well-suited for automated coding assistants, IDE enhancements, and high-throughput CI/CD pipeline integrations.
Context
256K tokens
Input
$1.3 / 1M tokens
Output
$2.6 / 1M tokens
Released
Sep 30, 2025

Overview

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.

Technical Specification

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
__wf_reserved_inherit
Token usage data on OpenRouter places Grok Code Fast 1 at the forefront of active models, underpinning its competitive speed and efficiency in delivering real-time coding assistance.

API Pricing

  • $0.26 per million input tokens
  • $1.95 per million output tokens

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

Code Sample

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.

__wf_reserved_inherit
Grok Code Fast 1’s clear dominance in token throughput among AI coding agents in VS Code, validating its design focus on speed and cost-effectiveness over broader multimodal features.

Limitations

  • Text-only input/output; no vision, audio, or multimodal modalities
  • No built-in reasoning beyond coding tasks; focused on practical tool-assisted code generation
  • Only available on-demand in selected US regions, no dedicated server mode yet
  • No support for streaming outputs or offline/local inference

Uptime and performance

  • Uptime (24h): 100%
  • Uptime (7d): 100%
  • Availability (24h): 88.0%
  • Error rate (24h): 13.0%

Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.

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

‍

How to use Grok Code Fast 1 API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to x-ai/grok-code-fast-1.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "x-ai/grok-code-fast-1",
      "messages": [
        {
          "role": "user",
          "content": "Hello!"
        }
      ]
    },
)
print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/chat/completions", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "model": "x-ai/grok-code-fast-1",
    "messages": [
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }),
});
console.log(await r.json());
curl -X POST 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":"Hello!"}]}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Grok Code Fast 1 API Pricing

TypePrice
Input
$1.3 / 1M tokens
Output
$2.6 / 1M tokens
Cached input
$0.26 / 1M tokens

Grok Code Fast 1 Benchmarks

BenchmarkScoreWhat it measuresSourceRetrieved
SWE-bench Verified
70.8%
Resolving verified real GitHub issuesSourceJuly 12, 2026
Intelligence
14.1
Composite score across standardised reasoning, knowledge and problem-solving evaluations, measured independently by Artificial AnalysisSourceSeptember 12, 2026
Math
43.3
Composite score across standardised mathematics evaluations, measured independently by Artificial AnalysisSourceSeptember 12, 2026

Grok Code Fast 1 vs other models

ModelInputOutputContextBest for
$1.3 / 1M tokens
$2.6 / 1M tokens
256K tokens
Coding + agents
$6.5 / 1M tokens
$39 / 1M tokens
1M tokens
Reasoning + agents
$2.6 / 1M tokens
$13 / 1M tokens
1M tokens
Balanced coding + agents
$3.9 / 1M tokens
$19.5 / 1M tokens
1M tokens
Long-context, multimodal & agentic workflows
$1.95 / 1M tokens
$11.7 / 1M tokens
1M tokens
Reasoning + agents

Frequently asked questions

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

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

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

Grok Code Fast 1 is priced at input $1.3 / 1M tokens, output $2.6 / 1M tokens, cached input $0.26 / 1M tokens.

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

Grok Code Fast 1 was built by xAI .

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

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

Start building with Grok Code Fast 1

Get API Key
1000+ models, one API.