Google: Gemma 4 31B

Gemma 4 31B is Google's dense multimodal model released 2026-04, with 30.7B parameters and a 262K token context window. It supports text and image input with text output, configurable reasoning, native function calling, and multilingual support across 140+ languages. Strong on coding, reasoning, and document understanding tasks, and licensed under Apache 2.0.

Modalities
inImageinTextinVideooutText
Price / 1M−27%
$0.11 / $0.33$0.20 / $0.40
Context
262K
Released
Apr 2, 2026

Channels

Every channel serves the same model, but they differ in price and stability. On each API key in the Platform, you pick a primary and a backup channel per vendor, and each billing line shows which channel served the request.

Provider
Discount
Input /M
Output /M
Cache read /M
Cache write 5m /M
Cache write 1h /M
Officialstable
−27%
$0.11
$0.33
$0.02
—
—

Capabilities

ReasoningVisionTool useLong contextStructured output

Parameters

Request parameters this model accepts through the API.

frequency_penaltyinclude_reasoninglogit_biaslogprobsmax_tokensmin_ppresence_penaltyreasoningrepetition_penaltyresponse_formatseedstopstructured_outputstemperaturetool_choicetoolstop_ktop_logprobstop_p

Cost calculator

Pick a channel and a usage scenario, then drag the sliders to match your workload. Each scenario assumes a different prompt-cache hit rate.

Channel
Scenario
Unit $0.11 / $0.33 /1MDaily chat: 40% cache hit rate assumed · cache read $0.02 /1M
List price $32.26On MirAPI$23.02/ moYou save $9.24Create an API key

Benchmarks

bar = score (0–100) · ▏ median

Scores come from vendor reports and public leaderboards, not private evals.

Intelligence Index
General ability
14.7
#102
Coding Index
Code
43.4
#54
Agentic Index
Agentic
4.2
#47
GPQA Diamond
Science QA
81.3
#73
τ-bench (airline)
Agentic tool use
76.6
#19

Showcase

Every chat model gets the same three fixed prompts. Outputs are archived verbatim, so you can copy a prompt and reproduce the result.

Task prompt · identical for all models
Build a single-file HTML page using three.js from a CDN: a low-poly planet with a tilted ring of ~200 orbiting particles, a soft key light plus rim light, slow auto-rotation, and drag-to-orbit controls. No build tools — one file only.
Archived output
Archive not published yet

Every model will run this exact prompt, and its output will appear here verbatim with token counts and the cost per run.

Quick start

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.mirapi.ai/v1",   # changed
    api_key=os.environ["MIRAPI_API_KEY"],   # changed
)

resp = client.chat.completions.create(
    model="gemma-4-31b-it",
    messages=[{"role": "user", "content": "Hello"}],
)
Wire Gemma 4 31B into your product

1M free tokens to start, no card required. It’s OpenAI-compatible, so you only change the base URL.

Start free