Gemma 4 31B

by Google

Gemma 4 31B is the dense flagship of the Gemma 4 family, with 31 billion parameters and nearly all of them active during inference for maximum output quality. Developed by Google DeepMind on the same research lineage as Gemini 3, it targets complex reasoning and agentic workflows and accepts text, image, and video inputs. It carries a 256K token context window, native function calling, structured output, configurable thinking modes, and comprehension across more than 140 languages. A hybrid attention design interleaves local sliding-window attention with full global attention, allowing efficient processing of long documents without losing context. Ranked #3 among open models on the Arena AI text leaderboard, Gemma 4 31B pairs frontier-level results with an open-weight Apache 2.0 release suitable for fine-tuning and deployment.

Key info

Input
Output
Features
Context window
256K
Max output
8K
Input price
/1M
Output price
/1M
  • US residency available
  • Zero data retention on pay-as-you-go
  • No training by default
  • GDPR DPA available

Available routes

Gemma 4 31B runs on 2 different routes through the Opper gateway. Compare residency, ZDR, and training posture at a glance — full data-handling detail per route below.

ProviderRegionZero data retentionTrainingInputOutput
GeminiUSEnterpriseNo
GeoddUSZero data retentionNo$0.13$0.37

Training posture across routes: No training on prompts by default.

Data handling per route

Each route hosting Gemma 4 31B has its own privacy posture, residency, and GDPR terms. Postures are maintained by Opper with a last-verification timestamp.

Gemini United States🇺🇸

Zero data retention is available via Opper Enterprise contract. No training on customer data. US; SCCs; DPA available.

Zero data retention
Available via Opper Enterprise contract.
Training
No training on customer data.
Logging
Abuse monitoring
Third-party access
None disclosed
GDPR DPA
DPA available
Transfer mechanism
SCCs

Geodd United States🇺🇸

Zero data retention is on by default on Pay-as-you-go — no action required. No training on customer data. US; SCCs.

Zero data retention
On by default on Pay-as-you-go.
Training
No training on customer data.
Logging
None
Third-party access
Provider may share with subprocessors / partners
GDPR DPA
No DPA
Transfer mechanism
SCCs

Benchmarks

Independent benchmark scores — composite indices for reasoning, coding, and math, plus individual eval scores where available.

Global rank#107 of 531 LLMs
TierEfficient
Output speed35 tok/s
First token1.00s
Intelligence Index29.4
Coding Index38.7
Reasoning & knowledge
GPQA Diamond
86%
Humanity's Last Exam
23%
Long-context reasoning
62%
Coding
SciCode
43%
Agentic & tool use
Terminal-Bench Hard
36%
τ²-Bench Telecom
60%
Math & instruction following
IFBench
76%

Get started

Call Gemma 4 31B through the Opper gateway with one API key. Let your coding agent set it up, or call it directly — Opper is drop-in compatible with the OpenAI, Anthropic, and Google AI SDKs.

Set it up with your agent

Copy this and paste it into your coding agent — Claude Code, Cursor, Codex, and more — and it'll wire up Opper for you.

Or call it directly

import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.OPPER_API_KEY,
baseURL: "https://api.opper.ai/v3/compat",
});
const completion = await client.chat.completions.create({
model: "gemini/gemma-4-31b",
messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);

Compare Gemma 4 31B with…

Side-by-side on privacy, EU hosting, pricing, and benchmarks.

Other models from Google

Start building with 300+ models

One API key. Every major provider. Up and running in minutes.

Get startedView Documentation
Gemma 4 31B by Google — pricing, benchmarks, ZDR | Opper AI