Gemma 4 31B API — pricing & specs
Gemma 4 31B is a text model from Google DeepMind. On KeepRouter, Gemma 4 31B costs $0.1200 per 1M input tokens and $0.3500 per 1M output tokens, billed pay-as-you-go with no monthly fee. Call it through a compatible KeepRouter endpoint supported by its active route, with the model id gemma-4-31B-it.
| Maker | Google DeepMind |
|---|---|
| Modality | Text |
| Input price | $0.1200 per 1M tokens |
| Output price | $0.3500 per 1M tokens |
| Capabilities | Chat completions, Streaming where supported, Tool calling where supported |
| Endpoint | POST /v1/chat/completions or POST /v1/messages (compatible chat routes) |
| Model id | gemma-4-31B-it |
How pricing works for Gemma 4 31B
Gemma 4 31B is billed per token — $0.1200 per 1M input tokens and $0.3500 per 1M output tokens. The published price is pay-as-you-go, with no monthly fee; actual request cost depends on measured token usage.
Calling Gemma 4 31B on KeepRouter
Point a compatible client at the supported KeepRouter endpoint and set the model to gemma-4-31B-it. KeepRouter preserves the client-facing request shape while handling upstream routing or translation. Use POST /v1/chat/completions or, on compatible chat routes, POST /v1/messages; streaming and tool support depend on the model's active route.
cURL
curl https://keeprouter.com/v1/chat/completions \
-H "Authorization: Bearer $KEEPROUTER_KEY" -H "Content-Type: application/json" \
-d '{"model":"gemma-4-31B-it","messages":[{"role":"user","content":"Hello"}]}'Python
from openai import OpenAI
client = OpenAI(base_url="https://keeprouter.com/v1", api_key="$KEEPROUTER_KEY")
r = client.chat.completions.create(model="gemma-4-31B-it", messages=[{"role":"user","content":"Hello"}])JavaScript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://keeprouter.com/v1", apiKey: process.env.KEEPROUTER_KEY });
const r = await client.chat.completions.create({ model: "gemma-4-31B-it", messages: [{ role: "user", content: "Hello" }] });Source and verification boundary
Official Google DeepMind website. KeepRouter's live catalog is authoritative for the customer price and enabled endpoint shown here; the maker remains authoritative for upstream model capabilities and limits.
Guides
Related models
- Gemini 3.5 Flash by Google DeepMind — $1.50 per 1M input tokens and $9.00 per 1M output tokens
- GLM-4.5 by Zhipu AI — $0.6000 per 1M input tokens and $2.20 per 1M output tokens
- GLM-4.5 Air by Zhipu AI — $0.2000 per 1M input tokens and $1.10 per 1M output tokens
- Free — $0 (free)
- GLM-4.6 by Zhipu AI — $0.6000 per 1M input tokens and $2.20 per 1M output tokens
- Doubao 2.0 Pro by ByteDance — $1.60 per 1M input tokens and $8.00 per 1M output tokens
All models & pricing · Quickstart · KeepRouter vs OpenRouter · Glossary · Get an API key
Catalog facts and prices last changed 2026-08-01.