Live pricing — last refreshed Apr 21, 2026

Google: Gemma 3n 4B vs xAI: Grok 4

Head-to-head API pricing and cost comparison between Google’s Google: Gemma 3n 4B and xAI’s xAI: Grok 4. Prices auto-refresh daily from OpenRouter.

Verdict

Google: Gemma 3n 4B is 98% cheaper for input tokens; Google: Gemma 3n 4B also wins on output tokens.

Side-by-side comparison

SpecGoogle: Gemma 3n 4BxAI: Grok 4
Input price (per 1M)$0.06$3.00
Cached input (per 1M)$0.75
Output price (per 1M)$0.12$15.00
Batch input (per 1M)
Batch output (per 1M)
Reasoning price (per 1M)
Context window33K256K
Vision supportNoYes
Caching supportNoYes
Batch APINoNo
Reasoning capabilityNoNo

Monthly cost at volume

Estimated monthly API spend at common production traffic levels (input/output tokens per request shown).

VolumeGoogle: Gemma 3n 4BxAI: Grok 4Savings
1K req/day
500in / 200out tokens
$1.62$135.00$133.38
Google: Gemma 3n 4B wins
10K req/day
1500in / 500out tokens
$45.00$3,600$3,555
Google: Gemma 3n 4B wins
100K req/day
3000in / 800out tokens
$828.00$63,000$62,172
Google: Gemma 3n 4B wins
1M req/day
8000in / 2000out tokens
$21,600$1,620,000$1,598,400
Google: Gemma 3n 4B wins
Open in interactive calculator →

Adjust input/output token counts, request volume, batch & cached pricing.

Related comparisons

Frequently asked questions

Which is cheaper, Google: Gemma 3n 4B or xAI: Grok 4?

For input tokens, Google: Gemma 3n 4B is roughly 98% cheaper at $0.06/1M vs $3.00/1M. For output tokens, Google: Gemma 3n 4B wins at $0.12/1M. Real-world cost depends on your input/output ratio — use the calculator to model your actual workload.

What’s the context window difference?

Google: Gemma 3n 4B has a context window of 33K tokens. xAI: Grok 4 offers 256K tokens. Larger context windows are valuable for long documents, RAG pipelines, and multi-turn conversations — but they come with higher input-token bills if you fill them every request.

Should I use Google: Gemma 3n 4B or xAI: Grok 4?

Choose Google: Gemma 3n 4B if you’re already on the Google stack, want broad ecosystem support, or prefer its lower input price. Choose xAI: Grok 4 for xAI’s ecosystem, native vision input, or its differentiated capabilities. Run a small benchmark on your own prompts before committing — price is only one axis.

How are these prices kept current?

Prices are pulled directly from OpenRouter’s public models API once every 24 hours via a Convex cron job, then normalized to per-1M-token figures. Last refresh: Apr 21, 2026.