Gemma 4 31B Instruct is Google DeepMind's 30.7B dense multimodal model supporting text and image input with text output. Features a 256K token context window, configurable thinking/reasoning mode, native function...
- Modalities
- image + text + video → text
- In / out per 1M
- Free / Free
- Context
- 262K tokens
- Added
- Apr 2, 2026
- Max output
- 8K tokens
- Tokenizer
- Gemma
- Reasoning
- optional
Pricing
Per 1M tokens. The provider price and our flat 3% fee are separate columns — what you pay is their sum.
| Per 1M tokens | Provider | + 3% fee | You pay |
|---|---|---|---|
| Input | Free | — | Free |
| Output | Free | — | Free |
Providers
One company serves Gemma 4 31B (free). Figures are each provider’s own list price per 1M tokens — your OpenKey price is in the card above.
| Provider | Context | Input /M | Output /M |
|---|---|---|---|
| Google AI Studio | 262K | Free | Free |
Provider list from the OpenRouter catalog, Jul 28, 2026. All providers
Benchmarks
Artificial Analysis
- Agentic index
- 14.4
- Coding index
- 43.4
- Intelligence index
- 29.4
Supported parameters
- include_reasoning
- max_tokens
- min_p
- reasoning
- response_format
- seed
- stop
- temperature
- tool_choice
- tools
- top_a
- top_k
- top_p
Call it
OpenAI-compatible: point your SDK at api.openkey.ai/v1 and use
model google/gemma-4-31b-it:free.
curl https://api.openkey.ai/v1/chat/completions \
-H "Authorization: Bearer ***" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemma-4-31b-it:free",
"messages": [{"role": "user", "content": "Hello"}]
}'import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.openkey.ai/v1",
api_key=os.environ["OPENKEY_API_KEY"],
)
completion = client.chat.completions.create(
model="google/gemma-4-31b-it:free",
messages=[{"role": "user", "content": "Hello"}],
)
print(completion.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.openkey.ai/v1",
apiKey: process.env.OPENKEY_API_KEY,
});
const completion = await client.chat.completions.create({
model: "google/gemma-4-31b-it:free",
messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);About Gemma 4 31B (free)
Gemma 4 31B is Google DeepMind's 30.7B dense model, and it's free via OpenKey. It takes text, image, and video as input and returns text output, with a 262,144-token context window — larger than 56% of models in the catalog. Reasoning mode is supported but off by default (you can enable it per request via the reasoning parameter). On Artificial Analysis benchmarks it scores 29.4 on the intelligence index, 43.4 on coding, and 14.4 on agentic tasks — a mid-tier profile suited to multimodal tasks rather than heavy agentic workloads.
The standout fact here is price: $0 per 1M input and output tokens, versus paid Gemini siblings like Gemini 2.5 Flash ($0.30/$2.50 per 1M) or Gemini 2.5 Pro ($1.25/$10 per 1M). Context is also generous at 262,144 tokens, beating 56% of the catalog. Reasoning is optional rather than mandatory, so you control latency and cost tradeoffs per request. Coding index (43.4) runs well ahead of its agentic index (14.4), suggesting it's stronger at generating code than at multi-step tool-driven tasks.
Questions
- How much does Gemma 4 31B (free) cost via API?
- It's free: $0 per 1M input tokens and $0 per 1M output tokens from Google, and OpenKey's 3% fee on $0 is still $0. This makes it one of 25 free models on OpenKey's 329-model catalog, with no usage cost for either prompt or completion tokens.
- What is Gemma 4 31B's context window?
- Gemma 4 31B supports a 262,144-token context window. That's larger than 56% of models in the OpenKey catalog, giving you room for long documents, multi-file codebases, or extended multi-turn conversations without truncation. Max completion length per request is capped at 8,192 tokens.
- Is Gemma 4 31B (free) free to use?
- Yes — provider pricing is $0 per 1M tokens for both input and output, and OpenKey passes that through with no markup since 3% of zero is zero. It's one of 25 free models available on the platform.
- Does Gemma 4 31B support tool calling or vision?
- Yes to both. It accepts image, text, and video as input (text-only output) and its supported parameters include tools and tool_choice, so it can call functions. It also supports response_format for structured outputs and a reasoning parameter for optional step-by-step thinking.
- How does Gemma 4 31B compare to Gemini 2.5 Flash?
- Gemma 4 31B is free ($0/$0 per 1M tokens), while Gemini 2.5 Flash costs $0.30 per 1M input and $2.50 per 1M output tokens from Google ($0.309/$2.575 on OpenKey after the 3% fee). Gemma 4 31B trades that cost advantage for a smaller 30.7B dense architecture versus Gemini's production-tier Flash line, making it a reasonable choice for lower-stakes multimodal tasks where budget matters more than peak benchmark scores.
More from Google
All Google models →Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image)
Nano Banana 2 Lite (Gemini 3.1 Flash Lite Image) is Google's fastest, most cost-efficient Gemini image model, built for high-velocity developer pipelines and rapid-fire visual exploration. It delivers text-to-image generation...
ctx 66K in $0.258 out $1.54
Nano Banana Pro (Gemini 3 Pro Image)
Nano Banana Pro is Google’s most advanced image-generation and editing model, built on Gemini 3 Pro. It extends the original Nano Banana with significantly improved multimodal reasoning, real-world grounding, and...
ctx 66K in $2.06 out $12.36
Nano Banana 2 (Gemini 3.1 Flash Image)
Gemini 3.1 Flash Image, a.k.a. "Nano Banana 2," is Google’s latest state of the art image generation and editing model, delivering Pro-level visual quality at Flash speed. It combines advanced...
ctx 131K in $0.515 out $3.09
Gemini 3.5 Flash
Gemini 3.5 Flash is Google's high-efficiency multimodal model, bringing near-Pro level coding and reasoning at Flash-tier cost and speed. It is highly optimized for coding proficiency and parallel agentic execution...
ctx 1.0M in $1.54 out $9.27