Grok Code
xAIxAI's coding-specialized model. Optimized for code generation, debugging, and software engineering tasks.
Grok Code Pricing
| Token Type | Price per Million |
|---|---|
| Input tokens | $1.50 |
| Output tokens | $7.50 |
Estimated Cost by Project Size
Realistic cost estimates for common coding scenarios. Assumes 30% cache hit rate where caching is available.
| Scenario | Token Usage | Estimated Cost |
|---|---|---|
| Small Script (1K lines) | 50K input / 30K output | $0.28 |
| Medium Feature (10K lines) | 500K input / 200K output | $2.02 |
| Large Project (50K lines) | 2,500K input / 1,000K output | $10.13 |
| Code Review (5K lines) | 250K input / 25K output | $0.45 |
Get Access to Grok Code
Ready to start using Grok Code? Get API access directly from xAI.
Get API Access →How Does Grok Code Compare?
| Model | Input ($/M) | Medium Feature Cost | |
|---|---|---|---|
| Grok Code | $1.50 | $2.02 | selected |
| Qwen Max | $1.60 | $1.84 | Compare |
| Gemini 2.5 Pro | $1.25 | $2.44 | Compare |
| Gemini 1.5 Pro | $1.25 | $1.44 | Compare |
| OpenAI o1-mini | $1.10 | $1.27 | Compare |
| OpenAI o3-mini | $1.10 | $1.27 | Compare |
Related Models
Claude Sonnet 4
AnthropicAnthropic's balanced model for coding and general tasks. Best price-performance ratio in the Claude family.
Claude Opus 4
AnthropicAnthropic's most powerful model. Best for complex reasoning and challenging coding tasks.
Claude 3.5 Sonnet
AnthropicPrevious generation Sonnet. Still excellent for coding tasks at the same price point.
GPT-4o
OpenAIOpenAI's flagship multimodal model. Strong coding and reasoning at competitive pricing.