Grok API Pricing (October 2026)
The Grok API costs $2/$6 per million input/output tokens for Grok 4.7, xAI's current flagship, with cached input at $0.50 and a 500K context window. Grok 4.6 lists at $2/$6, Grok 4.3 at $1.25/$2.50 with a 1M window, and Grok Build 0.1 at $1/$2, the lowest rate xAI lists. Prompts of 200K tokens or more bill at double the standard rate.
xAI prices the Grok API aggressively for its output tokens: the flagship Grok 4.7 keeps a 3x output-to-input ratio ($2/$6) where most rivals charge 5–6x, and Grok 4.3 pairs a 1M-token context window with a $1.25/$2.50 rate. The table below lists every xAI model in BenchLM's pricing registry, synced from xAI's official docs and pricing pages; rows marked Previous keep the last rate xAI published for a model its pricing page no longer lists.
Price is only half the decision: see the Grok model rankings and the price-vs-performance view for how each tier scores per dollar spent.
Every Grok API price per 1M tokens
| Model | API model ID | Input $/M | Cached input $/M | Output $/M | Context | Effective | Price source |
|---|---|---|---|---|---|---|---|
| Grok 4.5 | — | $2 | $0.3 | $6 | 500K | — | — |
| Grok 4.6 | grok-4.6Current | $2 | $0.5 | $6 | 500K | August 12, 2026 | xAI Grok 4.6 release notes |
| Grok 4.7 | grok-4.7Current | $2 | $0.5 | $6 | 500K | September 21, 2026 | xAI Grok 4.7 model documentation |
| Grok 4.20 | — | $1.25 | $0.2 | $2.5 | 1M | — | — |
| Grok 4.3 | — | $1.25 | $0.2 | $2.5 | 1M | — | — |
| Grok Build 0.1 | — | $1 | $0.2 | $2 | 256K | — | — |
| Grok 3 Mini | —Previous | $0.3 | — | $0.5 | 128K | — | — |
| Grok Code Fast 1 | —Previous | $0.2 | — | $1.5 | 256K | — | — |
| Grok 4.1 Fast | —Previous | $0.2 | — | $0.5 | 2M | — | — |
Cached-input rates are xAI's published prices; a dash means xAI publishes none for that row. Long-context rates, which xAI bills at double the standard rate once a prompt reaches 200K tokens, are not included. xAI's Batch API discounts Grok 4.3 and the Grok 4.20 models by 20% and other models not at all, so batch columns are omitted and the calculator uses standard rates.
Estimate your monthly Grok API bill
| Model | Est. monthly cost |
|---|---|
| Grok 4.5 | $32 |
| Grok 4.6 | $32 |
| Grok 4.7 | $32 |
| Grok 4.20 | $17.5 |
| Grok 4.3 | $17.5 |
| Grok Build 0.1 | $14 |
Estimates use Grok's standard per-token rates from the table above. For token-level presets and cross-provider comparison, use the full LLM API pricing calculator.
Cached input and the 200K higher-context surcharge
Two line items decide what Grok actually costs you. First, cached input: Grok 4.7 lists cached input at $0.50 per million tokens, a 75% discount off the $2 standard rate, and Grok 4.3 reads cache at $0.20/M. For agents and chat apps that resend the same system prompt or repository context, the cached share of input often dominates the bill, so the effective input rate lands well under list price.
Second, the long-context rate. xAI's pricing page bills every token in a request at the long-context rate once the prompt reaches 200K tokens, and that rate is double the standard one on every model it lists. Grok 4.3's long-context tier is $2.50/$5.00 per million instead of $1.25/$2.50, with cache reads rising from $0.20/M to $0.40/M. If your workload actually uses the big windows these models advertise, budget for the doubled tier; the estimator above uses standard rates.
Grok vs OpenAI and DeepSeek pricing
Against OpenAI, Grok wins on output economics. Grok 4.7's $6 output rate costs about 3x less than GPT-5.6 Sol's $20 and half as much as the mid-tier GPT-5.6 Terra's $12. On input, Grok 4.7 ($2) costs the same as Terra ($2) and half as much as Sol ($4). xAI has nothing priced near GPT-5.6 Luna ($0.20/$1.20): its lowest listed rate, Grok Build 0.1 ($1/$2), costs about 5x as much as Luna on input and about 67% more than Luna on output.
Against DeepSeek, match flagship with flagship and budget tier with budget tier: DeepSeek V4 Pro ($1.32/$3.96) costs less than Grok 4.7 on both rates even at peak, and DeepSeek V4.1 Flash ($0.30/$1.20 at peak) costs less than every model xAI lists on both rates. Since list prices alone don't settle it, compare the full tables at OpenAI API pricing and DeepSeek API pricing, or run head-to-heads on the compare hub.
Which Grok model should you use?
Grok 4.7 ($2/$6, 500K context) is xAI's current flagship, and xAI's models page points everything, code included, at it. Grok 4.6 ($2/$6) and Grok 4.5 ($2/$6) stay listed; keep them only when a production workflow still needs the older model ID.
Grok 4.3 ($1.25/$2.50) and Grok 4.20 ($1.25/$2.50) carry the largest window xAI lists, 1M tokens, so pick them when a prompt needs more than Grok 4.7's 500K. Grok 4.1 Fast and Grok Code Fast 1 no longer appear on xAI's pricing page; the table keeps their last published rates, marked Previous. Model your own mix with the LLM API pricing calculator.
Grok API pricing FAQ
How much does the Grok API cost?
Grok 4.7 costs $2 input / $6 output per million tokens with cached input at $0.50. Grok 4.6 costs $2/$6, Grok 4.5 $2/$6, Grok 4.3 $1.25/$2.50, Grok 4.20 $1.25/$2.50, and Grok Build 0.1 $1/$2. Prompts of 200K tokens or more bill at xAI's long-context rate, double the standard one; Grok 4.3's is $2.50/$5.00. The full table above lists every priced xAI model.
Is there a free Grok API?
No — the hosted Grok API is pay-per-token. The lowest rate xAI lists is Grok Build 0.1 at $1/$2 per million tokens, which prices light usage at cents per day. Grok access inside the X app is a separate consumer product and does not include API credits.
What is xAI's Grok API pricing per million tokens?
xAI bills per million tokens with separate input and output rates: Grok 4.7 at $2/$6 (cached input $0.50), Grok 4.6 at $2/$6, Grok 4.5 at $2/$6, Grok 4.3 at $1.25/$2.50, Grok 4.20 at $1.25/$2.50, and Grok Build 0.1 at $1/$2. Standard rates apply below 200K prompt tokens, with documented long-context pricing beyond that.
How does Grok API pricing compare to OpenAI?
Grok 4.7's output tokens cost about 3x less than GPT-5.6 Sol's ($6 vs $20 per million), and its input costs the same as GPT-5.6 Terra's. xAI's 3x output-to-input ratio is the structural difference: GPT-5.6 Sol charges 5x, Terra 6x and Luna 6x. See the OpenAI pricing hub for the full rival table.