Gemini API vs xAI API pricing
Gemini API is cheaper to start: $0.25 per million input tokens, $1.5 per million output against $1 per million input tokens, $2 per million output for xAI API. Gemini API has not changed its listed prices since 2026. xAI API has changed its listed prices 2 times since 2026.
Gemini API vs xAI API at a glance
Current list prices as last read from each pricing page.
Gemini API
- Starts at
- $0.25 per million input tokens, $1.5 per million outputGemini 3.1 Flash-Lite, USD per million tokens, paid tier, prompts up to 200K tokens
- Top listed plan
- $2 per million input tokens, $12 per million output for prompts up to 200K tokensGemini 3.1 Pro Preview
- Priced by
- Usage based
- Free plan
- Yes
- Price history
- since 2026
- Price changes
- none
xAI API
- Starts at
- $1 per million input tokens, $2 per million outputgrok-build-0.1, USD per million tokens, prompts under 200K tokens
- Top listed plan
- $2 per million input tokens, $6 per million outputgrok-4.6
- Priced by
- Usage based
- Free plan
- Not recorded
- Price history
- since 2026
- Price changes
- 2
Gemini API vs xAI API price history
Both histories on one chart. The default line is each product's cheapest paid plan.
Show the data as a table
| Observed | Gemini API Gemini 3.8 Flash, input | xAI API grok-4.3, input |
|---|---|---|
| Sep 21, 2026 | $0.75 | $1.25 |
| Oct 3, 2026 | $0.75 | $1.25 |
Plans side by side
Every plan currently listed, with the price it started at where we have it.
Gemini APIUSD per million tokens, paid tier, prompts up to 200K tokens
| Plan | Price | Listed since |
|---|---|---|
| Gemini 3.1 Pro Preview, input | $2 | Sep 2026 |
| Gemini 3.1 Pro Preview, output | $12 | Sep 2026 |
| Gemini 3.8 Flash, input | $0.75 | Sep 2026 |
| Gemini 3.8 Flash, output | $3.75 | Sep 2026 |
xAI APIUSD per million tokens, prompts under 200K tokens
| Plan | Price | Listed since |
|---|---|---|
| grok-4.6, input | $2 | Sep 2026 |
| grok-4.6, output | $6 | Sep 2026 |
| grok-4.3, input | $1.25 | Sep 2026 |
| grok-4.3, output | $2.50 | Sep 2026 |
| grok-4.7, input | $2 | Oct 2026 |
| grok-4.7, output | $6 | Oct 2026 |
What changed, and when
Every dated price move we have on record for either product, newest first.
- Oct 2026xAI API added the grok-4.7 input and output plans. grok-4.7, input listed at $2. grok-4.7, output listed at $6.
Gemini API vs xAI API pricing questions
- Is Gemini API or xAI API cheaper?
- Gemini API starts lower at $0.25 per million input tokens, $1.5 per million output, xAI API at $1 per million input tokens, $2 per million output. Prices are as shown on each pricing page when it was last read.
- Has Gemini API or xAI API raised prices?
- Gemini API has not changed its listed prices since 2026. xAI API: grok-4.7, input appeared by Oct 2026 at $2. grok-4.7, output appeared by Oct 2026 at $6.
- Do Gemini API and xAI API have a free plan?
- Gemini API lists a free plan. We have not recorded one for xAI API.
- How are Gemini API and xAI API priced?
- Gemini API: usage based, USD per million tokens, paid tier, prompts up to 200K tokens. xAI API: usage based, USD per million tokens, prompts under 200K tokens.
More comparisons
- All ai model apis compared
- Gemini API vs Amazon Bedrock
- Gemini API vs Azure OpenAI
- Gemini API vs OpenAI API
- Gemini API vs Claude API
- Gemini API vs Mistral API
- Gemini API vs Perplexity Sonar API
- Gemini API vs TypeSafe AI
- Gemini API vs Vertex AI
- xAI API vs Amazon Bedrock
- xAI API vs Azure OpenAI
- xAI API vs OpenAI API
- xAI API vs Claude API
- xAI API vs Mistral API
- xAI API vs Perplexity Sonar API
- xAI API vs TypeSafe AI
- xAI API vs Vertex AI
- Build your own comparison