Grok Code Fast 1

xAI chatreasoningtool_usecode Long

API ID: x-ai/grok-code-fast-1

Input Price
$0.20
/1M tokens
Output Price
$1.50
/1M tokens

About Grok Code Fast 1

Grok Code is xAI's coding-specialized model, optimized for software development tasks. The model excels at code generation and completion with Grok's distinctive style. Grok Code demonstrates xAI's expansion into specialized AI. For developers seeking coding AI with personality, Grok Code offers development assistance.

๐Ÿ’ฐ
Price Ranking
#450 lowest price among 599 Chat models

Model Specifications

Context Length
256k
Max Output
10k
Release Date
2025-08-26
Capabilities
chat reasoning tool_use code
Input Modalities
text
Output Modalities
text

Best For

  • Complex reasoning, math problems, multi-step logic
  • Code generation, debugging, code review, refactoring
  • Conversations, content writing, general assistance

Consider Alternatives For

  • Image understanding (needs vision capability)
  • Simple Q&A (cheaper models available)

๐Ÿ’ฐ Real-World Cost Examples

Estimated monthly costs for common use cases

Personal AI Assistant
$0.54
/month
50 conversations/day, ~500 tokens each
Code Copilot
$4.56
/month
200 completions/day, ~1k tokens each
Customer Service Bot
$16.50
/month
1000 tickets/day, ~800 tokens each
Data Analysis Pipeline
$22.50
/month
500 analyses/day, ~2k tokens each

xAI Model Lineup

Compare all models from xAI to find the best fit

Model Input Output Context Capabilities
Grok Code Fast 1 Current $0.20 $1.50 256k chat reasoning tool_use code
Grok 2 Vision 1212 Free Free 33k chat vision
Grok Vision Beta Free Free 8k chat vision
Grok 2 Free Free 33k chat
Grok 2 mini Free Free 33k chat
Grok 2 1212 Free Free 131k chat

Similar Models from Other Providers

Cross-brand alternatives with similar capabilities

Baidu ERNIE 4.5 VL 424B A47B
Input: $0.42
Output: $1.25
Context: 123k
Other Weaver (alpha)
Input: $0.75
Output: $1.00
Context: 8k
Other Cogito V2 Preview Llama 70B
Input: $0.88
Output: $0.88
Context: 33k
Alibaba Qwen Qwen-Plus
Input: $0.40
Output: $1.20
Context: 131k

๐Ÿš€ Quick Start

Get started with Grok Code Fast 1 API

OpenAI-compatible SDK
from openai import OpenAI

client = OpenAI(
    base_url="https://api.provider.com/v1",
    api_key="YOUR_API_KEY"
)

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