Skip to content
NewTry RouterPlus with free creditsTry playground →

Gemma 4 31B vs Gemma 4 12B

Side by side

SpecGemma 4 31BGemma 4 12B
Lowest input$0.12Doubleword$0.30Sail Research
Lowest output$0.35Doubleword$2.00Sail Research
Lowest cached input$0.12Doubleword$0.15Sail Research
Context262K16.4K
Max output131K16.4K
Providers41
ReleasedApril 2, 2026May 23, 2026
WeightsOpenOpen
LabGoogleGoogle
Model IDgoogle/gemma-4-31b-itgoogle/gemma-4-12b-it

USD per 1M tokens, as of November 5, 2026.

Price by provider

ProviderGemma 4 31BGemma 4 12B
Sail Research$0.40 / $0.60$0.30 / $2.00
DeepInfra$0.20 / $0.40–
Doubleword$0.12 / $0.35–
Novita AI$0.14 / $0.40–

Input / output, USD per 1M tokens.

Cost

Model1,000 chat replies2K in, 500 out each1,000 agent tasks50K in, 5K out eachMonthly batch job500M in, 50M out
Gemma 4 31BDoubleword$0.42$7.75$77.50
Gemma 4 12BSail Research$1.60$25.00$250.00

On each model's cheapest provider by input plus output list price.

FAQ

Which is cheaper, Gemma 4 31B or Gemma 4 12B?

Input: Gemma 4 31B at $0.12 per million input tokens vs $0.30 (Gemma 4 12B), 2.5x lower. Output: Gemma 4 31B at $0.35 per million output tokens vs $2.00 (Gemma 4 12B), 5.7x lower. Lowest listed prices as of November 5, 2026.

Which has the longer context window?

Gemma 4 31B, with 262K tokens vs 16.4K.

Which providers serve both Gemma 4 31B and Gemma 4 12B?

1 provider serves both: Sail Research. Gemma 4 31B has 4 providers in total and Gemma 4 12B has 1.

Do Gemma 4 31B and Gemma 4 12B have cached input pricing?

Gemma 4 31B from $0.12 per million cached input tokens (Doubleword). Gemma 4 12B from $0.15 (Sail Research).

Can I switch between Gemma 4 31B and Gemma 4 12B without changing code?

Yes. Both use the same OpenAI-compatible endpoint, https://api.routerplus.com/v1, and key. Change the model field from "google/gemma-4-31b-it" to "google/gemma-4-12b-it".

All comparisons

Run Gemma 4 31B and Gemma 4 12B on one key