Google AI language model
Gemma 4 31B
Gemma 4 31B is the largest dense model in Google's Apache 2.0 open-weights Gemma 4 family, released April 2026. it ships alongside the 26B A4B mixture-of-experts model, takes text and images, and has an optional thinking mode.
01
price
input tokens
output tokens
per 1M tokens. octomind bills the listed provider price, with no markup, on every plan, including the free one (pay as you go from credits).
- output bills at the same $0.20 per 1M tokens as input, so long generations cost no more per token than prompts.
- no cached-input discount: repeated prompt tokens bill at the full input rate.
02
what real work costs
| workload | cost |
|---|---|
| one chat reply 3,000 tokens in, 500 out | $0.0007 |
| summarise a 100-page report 50,000 tokens in, 1,500 out, one request | $0.01 |
| 1,000 classification calls 500 tokens in, 20 out, per call | $0.10 |
| coding-agent session 2M tokens in across ~60 turns, 60,000 out, no cache | $0.41 |
at the listed rate. token counts are typical sizes, not measurements.
03
specs
- provider
- Google AI
- context window
- 128k tokens — ≈ 190 pages of prose or 13,000 lines of code
- input
- text, images
- output
- text
- structured output
- yes — JSON schema
- reasoning mode
- yes
- weights
- open — Apache 2.0
- released
- April 2, 2026
- knowledge cutoff
- January 2025
- status
- live
- model id
gemma-4-31b
integration notes
- thinking is switched on by a <|think|> token at the start of the system prompt; remove it to switch thinking off.
- with thinking off, the 31B model still emits an empty thought block before its answer.
- in multi-turn history, keep only final answers from earlier turns; keep thinking only on tool-call turns.
04
benchmarks
as published by the maker; not measured by octomind.
05
when to pick it
pick it if
- want Apache 2.0 open weights you can also self-host
- need image input and a thinking mode at a low flat rate
- write long outputs, since output costs the same as input
skip it if
- you need audio input; Google limits it to smaller Gemma 4 sizes
- you rely on cached-prompt discounts to cut repeat-context cost
06
where it sits on price
blended price $0.2/M at 3 input tokens per output token: 6 live language models cost less, 37 cost more.
- Beam $0.194/M
- Claude Haiku 5.5 $0.2/M
- Gemma 4 31B $0.2/M
- GPT-6 Luna $0.2/M
- Qwen3.8 Omni Flash $0.23/M
07
use Gemma 4 31B in octomind
one octohub login reaches every model in the catalog. pick this one per run, per session, or as your default.
octomind login
octomind run -m octohub:gemma-4-31b/model octohub:gemma-4-31b[model]
name = "octohub:gemma-4-31b"08
compare Gemma 4 31B
09
similar models
nearest live models by listed input price.
- GLM-5.3 Flash $0.15/M input
- MiniMax M3.1 Flash $0.15/M input
- Qwen3.8 Omni Flash $0.15/M input
- MiMo V2.6 Flash $0.14/M input
10
Gemma 4 31B faq
how much does Gemma 4 31B cost?
Gemma 4 31B lists at $0.2/M input, $0.2/M output per 1M tokens. a typical coding-agent session (2M tokens in, 60,000 out) comes to $0.41. octomind bills the listed provider price, with no markup, on every plan, including the free one (pay as you go from credits).
what is the context window of Gemma 4 31B?
128k tokens, ≈ 190 pages of prose or 13,000 lines of code.
does Gemma 4 31B accept images?
yes. it takes text and images as input and returns text.
is Gemma 4 31B open source?
its weights are open under Apache 2.0, so it can also be self-hosted.
when was Gemma 4 31B released?
April 2, 2026, by Google AI.
is Gemma 4 31B free?
no. Gemma 4 31B bills per token at $0.2/M input, $0.2/M output per 1M. octomind's free plan reaches it pay as you go from credits, so you pay only for the tokens you use, at the provider price. credits carry a 3% top-up fee.
how do i use Gemma 4 31B in octomind?
run octomind login once, then octomind run -m octohub:gemma-4-31b. inside a running session, /model octohub:gemma-4-31b switches to it without losing context.
use Gemma 4 31B in octomind
choose a model when you start, then switch mid-session when the work changes.