Skip to content

Grok Code Fast 1

Grok Code Fast 1 is xAI's specialized coding model optimized for fast code generation, completion, and debugging. It delivers low-latency code output within a context window of 256K tokens, tuned specifically for software development workflows.

ReasoningTool UseImplicit Caching
index.ts
import { streamText } from 'ai'
const result = streamText({
model: 'xai/grok-code-fast-1',
prompt: 'Why is the sky blue?'
})

Playground

Try out Grok Code Fast 1 by xAI. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.

About Grok Code Fast 1

Grok Code Fast 1 is xAI's first dedicated coding model, released August 28, 2025. Unlike the general-purpose Grok models that handle coding alongside other tasks, Grok Code Fast 1 is specifically optimized for software development: code generation, completion, refactoring, debugging, and code explanation. The specialization targets lower latency and code-tuned outputs for development workflows.

The model operates within a context window of 256K tokens and up to 256K tokens per response, with low-latency inference for development tools. It handles code across major programming languages and frameworks, and focuses on project context, coding conventions, and production-style snippets over toy examples.

Grok Code Fast 1 is available at $0.2 per million input tokens and $1.5 per million output tokens through Vercel AI Gateway. Its speed optimization makes it practical for IDE integrations, automated code review, and CI/CD pipeline tasks where response time impacts developer productivity.

Providers

Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.

Provider
Context
Latency
Throughput
Input
Output
Cache
Web Search
Per Query
Capabilities
ZDR
No Training
Release Date
xAI
Legal:Terms
Privacy
256K
0.3s
127tps
$0.20/M$1.50/M
Read:$0.02/M
Write:
08/28/2025
Throughput

P50 throughput on live AI Gateway traffic, in tokens per second (TPS). Visit the docs for more info.

Latency

P50 time to first token (TTFT) on live AI Gateway traffic, in milliseconds. View the docs for more info.

Uptime

Direct request success rate on AI Gateway and per-provider. Visit the docs for more info.

More models by xAI

Model
Context
Latency
Throughput
Input
Output
Cache
Web Search
Per Query
Capabilities
Providers
ZDR
No Training
Release Date
1M
1.3s
86tps
$1.25/M
$2.50/M
Read:
$0.2/M
Write:
$5/K
+ input costs
xai logo
04/30/2026
2M
3.3s
877tps
$1.25/M
$2.50/M
Read:
$0.2/M
Write:
$5/K
+ input costs
xai logo
03/11/2026
2M
0.5s
142tps
$1.25/M
$2.50/M
Read:
$0.2/M
Write:
$5/K
+ input costs
vertex logo
xai logo
03/09/2026
2M
0.6s
56tps
$0.20/M
$0.50/M
Read:
$0.05/M
Write:
$5/K
+ input costs
xai logo
09/19/2025
2M
0.2s
238tps
$0.20/M
$0.50/M
Read:
$0.05/M
Write:
$5/K
+ input costs
vertex logo
xai logo
07/09/2025
2M
0.6s
182tps
$0.20/M
$0.50/M
Read:
$0.05/M
Write:
$5/K
+ input costs
vertex logo
xai logo
07/09/2025

What To Consider When Choosing a Provider

  • Configuration: Grok Code Fast 1 is optimized for code tasks. For general text generation, summarization, or conversational tasks, a general-purpose Grok model performs better.
  • Configuration: The fast inference profile is designed for real-time development workflows. Test end-to-end latency in your specific IDE or tool integration to confirm it meets responsiveness requirements.
  • Zero Data Retention: AI Gateway does not currently support Zero Data Retention for this model. See the documentation for models that support ZDR.
  • Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.

When to Use Grok Code Fast 1

Best For

  • Code generation and completion: In IDE integrations where developers expect near-instant suggestions
  • Code refactoring and modernization: Tasks that transform legacy code to follow current patterns and best practices
  • Debugging assistance: The model analyzes error messages, stack traces, and code context to identify and fix issues
  • Automated code review: In CI/CD pipelines that flag potential issues before human review
  • Code explanation and documentation: Generates inline comments, docstrings, and technical documentation from code

Consider Alternatives When

  • General-purpose tasks beyond coding: Grok 3 Fast or Grok 4 Fast provide broader capabilities
  • Complex architectural reasoning: About large systems where Grok 4's deeper reasoning may produce better high-level analysis
  • Multi-language translation or content generation: A general-purpose model handles the task better

Conclusion

Grok Code Fast 1 is purpose-built for the development workflow. Its code-specific optimization and fast inference make it the natural choice for IDE integrations, code review automation, and any pipeline where code is the primary input and output. For teams building developer tools or automating software engineering tasks, it offers a targeted alternative to using general-purpose models for code.

Frequently Asked Questions

  • What programming languages does Grok Code Fast 1 support?

    Grok Code Fast 1 handles code across major programming languages including Python, JavaScript, TypeScript, Go, Rust, Java, C++, and others. It is tuned for general code understanding rather than being limited to specific languages.

  • How does Grok Code Fast 1 differ from using Grok 3 or Grok 4 for coding?

    Grok Code Fast 1 is specifically optimized for code tasks with lower latency and code-tuned output quality. General-purpose Grok models handle coding alongside other tasks but are not specialized for the development workflow.

  • What is the context window for Grok Code Fast 1?

    256K tokens, sufficient for processing large files, multiple related files, or extensive code context within a single request.

  • What does Grok Code Fast 1 cost?

    This page lists the current rates. Multiple providers can serve Grok Code Fast 1, so AI Gateway surfaces live pricing rather than a single fixed figure.

  • How do I authenticate with Grok Code Fast 1 through Vercel AI Gateway?

    Use your Vercel AI Gateway API key with xai/grok-code-fast-1 as the model identifier. No separate xAI account is needed for gateway-managed access.

  • Can Grok Code Fast 1 handle code review tasks?

    Yes. It can analyze code for potential bugs, style issues, performance problems, and security concerns. It's well-suited for automated review in CI/CD pipelines.

  • Does Vercel AI Gateway support Zero Data Retention for Grok Code Fast 1?

    Zero Data Retention is not currently available for this model. ZDR on AI Gateway applies to direct gateway requests; BYOK flows aren't covered. See https://vercel.com/docs/ai-gateway/capabilities/zdr for details.