Google · Model
Gemma 4 31B API pricing, cost and context window
Gemma 4 31B costs $0.20 per million input tokens and $0.40 per million output tokens. It reads up to 262,144 tokens and writes up to 16,384 per reply. Prices checked 2026-11-28. By blended price it is number 2 of Google’s 9 current models here, counting from the cheapest.
- Input / 1M
- $0.20
- Output / 1M
- $0.40
- Cached / 1M
- –
- Context
- 262,144
- Max output
- 16,384
- Released
- 2026-04-02
Estimate your cost with Gemma 4 31BCompare all Google modelsCount tokens for Gemma 4 31B
Pricing
How much does Gemma 4 31B cost per million tokens?
| Price per 1M tokens | Input | Output |
|---|---|---|
| Standard | $0.20 | $0.40 |
Output costs 2.0× the input price; no cached-input price is published.
Work out your monthly Gemma 4 31B bill in the cost calculator
History
Has Gemma 4 31B’s price changed?
Price increase, +64% blended
- Input
- from $0.09 to $0.20
- +122%
- Output
- from $0.34 to $0.40
- +18%
Gemma 4 31B has open weights, so this is the price of OpenRouter’s top-ranked host, which can move when hosts change rather than because Google changed its price. Every change across all models is in the AI pricing changes log.
Examples
How much does a typical Gemma 4 31B request cost?
| Workload | Tokens in / out | Requests/day | Per request | Per month |
|---|---|---|---|---|
| Support chatbot | 1,500 / 400 | 1,000 | $0.00046 | $13.99 |
| RAG app | 6,000 / 500 | 500 | $0.0014 | $21.29 |
| Coding agent | 40,000 / 2,000 | 200 | $0.0088 | $53.53 |
| Document summariser | 8,000 / 600 | 300 | $0.00184 | $16.79 |
Change any number in the cost calculator.
Context
What is Gemma 4 31B’s context window and max output?
Gemma 4 31B accepts up to 262,144 tokens per request, roughly 196,608 English words or 393 pages, prompt and reply together; one reply is capped at 16,384 tokens.
Filling the whole window with one prompt costs about $0.0524 at list price.
Features
What can Gemma 4 31B do?
- Image input
- Yes
- Tool / function calling
- Yes
- Reasoning mode
- Yes
- Prompt caching
- No
- Structured output
- Yes
- Open weights
- Yes
- Accepts
- image, text, video
- Knowledge cutoff
- Not published
As declared by the provider’s API. It shows a feature exists, not how well it works.
API
What is the Gemma 4 31B API model ID?
- OpenRouter
google/gemma-4-31b-it- Open weights
- google/gemma-4-31B-it
Use the OpenRouter ID when calling it through OpenRouter; Google’s own API may name it differently. See the model ID reference for the providers we document. See how much VRAM Gemma 4 31B needs to run locally.
Where does Gemma 4 31B sit in Google’s line-up?
Ranked by blended price (three parts input to one part output, $0.25 per 1M for Gemma 4 31B), it is number 2 of Google’s 9 current models here, counting from the cheapest. One step down, Gemma 4 26B A4B costs $0.1069 blended (57% less). One step up, Gemini 3.5 Flash Lite costs $0.85 (3.4× as much). Unlike Gemma 4 31B, it accepts files and audio, reads up to 1,048,576 tokens (262,144 here) and caps a reply at 65,536 tokens (16,384 here). See every Google model and price
Save
What are cheaper alternatives to Gemma 4 31B?
- Qwen3.5-9BQwen62% cheaper
- Seed-2.0-MiniByteDance Seed30% cheaper
- GPT-6 LunaOpenAI20% cheaper
Keeping image input, tool calling, reasoning; by blended price.
Compare
Which models cost about the same?
- Mistral Small 4Mistral$0.15 / $0.60
- MiniMax M3.1 FlashMiniMax$0.15 / $0.60
- GLM 5.3 FlashZ.ai$0.15 / $0.50
FAQ
Gemma 4 31B questions
How much does Gemma 4 31B cost?
Gemma 4 31B costs $0.20 per million input tokens and $0.40 per million output tokens. A typical chatbot reply (1,500 tokens in, 400 out) costs about $0.00046. Use the LLM cost calculator for your own workload.
What is Gemma 4 31B’s context window?
262,144 tokens, about 196,608 English words or 393 printed pages, shared between your prompt and the reply. A single reply can be up to 16,384 tokens.
Does Gemma 4 31B support prompt caching and batch requests?
No cached-input price is published for it. No batch price is published for it.
What are cheaper alternatives to Gemma 4 31B?
With the same essentials (image input and tool calling), the cheapest options are Qwen3.5-9B (62% cheaper), Seed-2.0-Mini (30% cheaper), GPT-6 Luna (20% cheaper). Cheaper doesn’t mean equivalent, so test them on your own prompts.
What is the API model ID for Gemma 4 31B?
On OpenRouter it is google/gemma-4-31b-it. Google’s own API may use a different name, so check its model list before you deploy. Pass the ID as the model value in each request.
When was Gemma 4 31B released?
Gemma 4 31B was first listed on 2026-04-02. It is the first model in its line in our data. Release dates here are when our price source first listed each model.
Is Gemma 4 31B open source?
Yes, Gemma 4 31B has open weights, so you can run it yourself or choose between several hosting providers. The prices here are a typical hosted price.
Can I run Gemma 4 31B locally?
Yes, its weights are public. Gemma 4 31B needs about 21 GB of memory at Q4_K_M with an 8K context, which fits one 24 GB GPU such as the Radeon RX 7900 XTX. See the Gemma 4 31B VRAM requirements for every GPU, Mac and context length.
Keep exploring