Grok Code

xAI

xAI's coding-specialized model. Optimized for code generation, debugging, and software engineering tasks.

Context Window: 128K tokens Released: 2025-05 Best For: Code generation, debugging, software development workflows
  • Code-optimized
  • Multi-language support
  • Real-time docs access
  • Grok Code Pricing

    Token TypePrice 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.

    ScenarioToken UsageEstimated 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?

    ModelInput ($/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

    Categories