xAI
xAI Grok API pricing per million tokens.
| Name | Provider | Input, $ per 1M tokens | Output, $ per 1M tokens | Sample request (10K in, 2K out), $ | Context window, tokens | Status |
|---|---|---|---|---|---|---|
| Grok 4.7 | xAI | $2.00 | $6.00 | $0.032 | 500K | Current |
Prices come from xAI’s models page. xAI currently points developers to Grok 4.7 for text and code work, which costs $2 per million input tokens and $6 per million output tokens, with a 500K-token context window.
Questions
How much does the Grok 4.7 API cost? $2 per million input tokens and $6 per million output tokens; cached input costs $0.50 per million tokens.
Does xAI offer a Batch API for Grok 4.7? No. xAI does not offer the Batch API for this model, and priority processing costs 2x standard rates.
Does Grok 4.7 cost more for long prompts? Yes. Prompts of 200K tokens or more are billed at $4 input, $1 cached input and $12 output per million tokens.
Sources
Prices are read from each provider’s official pricing page: OpenAI, Anthropic, Google Gemini API, xAI, DeepSeek and Mistral AI. Context and output limits that a provider does not publish come from OpenRouter’s model listing. Each model’s Sources field lists the pages used and the date each was checked. How we check prices · Price change log
