IronStratum Get an API key

gemma-4-31b-it: the instruction-tuned Gemma 4 31B as a metered multimodal API

gemma-4-31b-it is this platform's serving alias for Gemma 4 31B IT, the instruction-tuned release of the 31-billion-parameter dense model that Google DeepMind published on April 2, 2026 under an Apache 2.0 license. The name carries a suffix because the family ships each size in two forms, base and -it, plus QAT and MTP artifact lines on top, and buyers keep landing on the wrong one. The first job of this page is to fix that map with dated official sources. The second is a spec set in which every number names its owner, because host listings contradict the publisher's own configuration on at least one limit. The third is the request shape this route accepts today. The console's invite flow is the way in while the platform is in beta, and this page is how you arrive with everything already in place.

Last verified: 2026-09-11

What it is

Gemma 4 31B IT is a dense transformer: 30.7 billion parameters, every one of them active on every token. It reads text and images, freely mixed in one prompt, at whatever aspect ratio and resolution you send, and it writes text. Per the official model card, it is the instruction-tuned variant of the family's top dense size, tuned for reasoning, agentic workflows, coding, and multimodal understanding, with native function calling, a native system role, and a built-in thinking mode. The launch announcement put the 31B at number three among open models on the Arena AI text leaderboard on release day, built, in Google's words, from the same research and technology as Gemini 3.

The size line, because "Gemma 4" alone will not tell you which machine you are calling:

SizeWhat it isContextReads
E2B2.3B effective, dense with per-layer embeddings, built for phones128Ktext, image, audio
E4B4.5B effective, same edge design, laptop class128Ktext, image, audio
12B Unified11.95B dense, no separate encoders, added June 2026256Ktext, image, audio
26B A4B25.2B sparse mixture-of-experts, 3.8B active per token256Ktext, image
31B30.7B dense, the family's top quality tier256Ktext, image

Four sizes launched on April 2, 2026; the 12B joined later, which is why some pages still say four. Audio input exists only on the three smaller models, a scoping fact that surprises buyers of this one.

The artifact line runs on top of the sizes. Each model ships pre-trained (the base, for further training) and instruction-tuned (the -it, for serving). In May 2026 Google added MTP drafters: small companion models that draft several tokens at a time for the main weights to check in one pass, cutting decode time by up to about three times with no quality change claimed. In June 2026 came QAT checkpoints, weights trained with quantization built in so that 4-bit copies keep far more quality than after-the-fact compression. A host that says only "Gemma 4 31B" is pinning some point on this line, and the checkpoint name is what tells you which.

The specs that matter for planning, each with its owner:

FactValueOwner of the number
Total parameters30.7B, denseofficial model card
Context window262,144 tokensthe publisher's model configuration file
Output limitnone set by the publisherthe publisher's generation config (no cap present)
Layers / sliding window60 layers, 1024-token local windows, 5 local to 1 global interleavedmodel configuration file
Vocabulary262,144 tokensmodel configuration file
Vision~550M-parameter encoder, 280 tokens per image by default, budgets of 70 to 1120official model card doc
Videoframe sequences, up to 60 seconds at one frame per secondofficial model card doc
Audionot on this model (E2B, E4B, 12B only, 30-second cap)official model card
Knowledge cutoffJanuary 2025official model card
Sampling defaultstemperature 1.0, top_p 0.95, top_k 64the publisher's generation config
LicenseApache 2.0official model card
ReleaseApril 2, 2026launch announcement

Two rows in that table earn plain words. Context: 262,144 is the publisher's own number and the one to trust. Output: because the publisher sets no cap, host pages invent one, and for this exact model two variants of the same marketplace page have shown 32,768 and 16,384. Ask any host what its endpoint actually enforces; on this platform the caller sets the ceiling with max_tokens.

Thinking on this model is a real feature, and an unusual one. The family is described by the publisher as reasoners with configurable thinking modes, and the 31B's benchmark rows were earned with it. But the control is strictly on or off, not a ladder of depths. The publisher documents it three ways: enable_thinking true or false in transformers, a control token at the start of the system prompt in raw template terms, and, on Google's hosted API, a documented mapping where the thinking level "high" means enabled and "minimal" means disabled (Gemini API docs). One structural quirk from the official model card doc: in multi-turn chat, past thinking must be stripped from the history, except in tool-call turns where it is preserved. Serving stacks handle this; raw-API callers do it themselves.

The hosted-access story has a fact in it that most pages skip. Google's own API carries this model on a free tier: input and output free of charge, with the paid tier listed as not available, per the official pricing page. The same page's terms note that free-tier content is used to improve Google's products, and the page publishes no request-count limit. Community threads filled that gap in April 2026 with a roughly 1500-requests-per-day discovery, and later threads describe tighter token-per-minute caps arriving by mid-2026. A metered lane is a different product on every one of those axes: per-call cost in the response, the platform's own content terms, a wallet balance as the spending limit, and per-key revocation.

This platform serves the model as gemma-4-31b-it on the chat route beside the rest of the chat catalog; the models index shows the catalog exactly as it stands. The row is live, listing and metering together.

Use cases

The card's own numbers, and the record since release, point at the same jobs:

  • Reasoning-heavy work. This is the 31B's headline: 89.2 percent on AIME 2026 without tools and 84.3 percent on GPQA Diamond in the publisher's table, with the thinking mode doing the heavy lifting. Math proofs, formal logic, multi-step planning.
  • Coding. 80.0 percent on LiveCodeBench v6 and a 2150 Codeforces Elo, both publisher-reported. The launch materials pitch the family as local-first code assistants, and the 31B is the quality end of that pitch.
  • Document and image work. The card lists document and PDF parsing, multilingual OCR, chart comprehension, screen and UI understanding, handwriting, and object detection among its image capabilities, and posts 76.9 percent on MMMU Pro. Images enter the prompt alongside text in any order, at a token budget you control.
  • Agentic and multilingual product work. Native function calling, a native system role, and training across more than 140 languages, with the card noting 35 or more supported out of the box. The publisher's agentic framing is the family's stated design goal.
  • Long-context reading. A 262,144-token window with 66.4 percent on MRCR v2 at 128K in the publisher's long-context row. Whole repositories, transcripts, and document sets fit in one request.
  • What it is not. It has no audio input, it is not the fast sparse sibling (that is the 26B A4B), and it is not a base model for further pretraining (that is google/gemma-4-31B).

Local weights or a hosted lane: the honest split

Apache 2.0 makes self-hosting a genuine option here, and the memory math is knowable in advance. At full 16-bit precision the weights alone are about 61 GB, and the key-value cache at maximum context adds roughly another 21 GB in technical analyses that derive it from the official configuration, which puts the full-context unquantized experience in a 96 GB-class machine. The realistic local path is quantized: community and vendor guides put a 4-bit 31B at 17 to 20 GB of memory, and Unsloth's hardware table puts an 8-bit 31B at 34 to 38 GB. The official QAT checkpoints exist precisely to make 4-bit lose as little as possible. Add the MTP drafter for speed and an Ollama one-liner (ollama run gemma4:31b) for the easy path.

Run it locally when traffic is steady, the data must stay inside a boundary you control, or you want to fine-tune. Call a hosted lane when traffic is bursty or occasional, you want the full window without memory planning, or you want metering wrapped around the model: each reply carrying its cost, a prepaid wallet as the backstop, and per-key revocation. The lane here is open, and the steps below get you calling it.

API usage

The call is POST /v1/chat/completions, authorized by a Bearer key from the console, OpenAI-compatible in shape. The model id is gemma-4-31b-it. The route is live; the section below is the request shape it accepts today.

FieldNotes
modelgemma-4-31b-it
messagesstandard OpenAI message shapes; content parts may mix text and image_url entries, which the route forwards as sent
reasoning_effortaccepted here today: minimal, low, medium, high
streamboth streaming and non-streaming shapes work on the route
max_tokens / max_completion_tokensboth accepted, identical behavior
tools, tool_choicestandard OpenAI tool shapes, forwarded as sent
response_formataccepted, for structured output work

Three laws of this lane that save debugging time:

  1. The thinking knob is reasoning_effort, top-level, and the model's control is a toggle. The publisher documents thinking as strictly on or off, with the hosted mapping high for on and minimal for off. The platform contract accepts minimal, low, medium, and high at this parameter: minimal and high carry the two documented states, and low and medium are accepted per the contract without a documented state on a strictly two-state model. The accepted set can also grow; the list above is the current surface, not a permanent freeze. Do not send the model's raw template fields yourself: nested template keys are outside the accepted surface and are answered with a named parameter error.
  2. Thinking output arrives separated, and history needs care. When thinking is on, the model's reasoning comes back as thought text distinct from the answer. It is metered like any other output. If you replay conversation history, strip past thinking from it, except in tool-call turns where the publisher's format preserves it.
  3. Every response reports its cost. The usage object that rides back with the reply contains the retail charge for that call, computed from the token counts, and the prepaid wallet is debited in the same transaction that records the request. The remaining balance is what stops spend. Per-key caps are roadmap items; pulling one key is immediate. Rates come from the catalog and render on the pricing page.

curl

curl -X POST "https://api.ironstratum.com/v1/chat/completions" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma-4-31b-it",
    "messages": [
      {"role": "user", "content": "A tank fills at 12 liters per minute for 8 minutes, then drains at 5 liters per minute for 4. How much water is left? Show the steps."}
    ],
    "reasoning_effort": "high",
    "max_tokens": 2048
  }'

python

import os
import requests

resp = requests.post(
    "https://api.ironstratum.com/v1/chat/completions",
    headers={"Authorization": "Bearer " + os.environ["KEY"]},
    json={
        "model": "gemma-4-31b-it",
        "messages": [
            # minimal = thinking off: the fast path for simple chat
            {"role": "user", "content": "Summarize this release note in three bullets: context 256K, image input, thinking toggle."},
        ],
        "reasoning_effort": "minimal",
        "max_tokens": 512,
    },
    timeout=300,
)
resp.raise_for_status()

message = resp.json()["choices"][0]["message"]
print(message["content"])

openai-sdk

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.ironstratum.com/v1",
    api_key=os.environ["KEY"],
)

response = client.chat.completions.create(
    model="gemma-4-31b-it",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Read the table in this image and return it as JSON."},
                {"type": "image_url", "image_url": {"url": "https://example.com/quarterly-table.png"}},
            ],
        }
    ],
    tools=[
        {
            "type": "function",
            "function": {
                "name": "save_extracted_table",
                "description": "Persist an extracted table as JSON",
                "parameters": {
                    "type": "object",
                    "properties": {"table": {"type": "string"}},
                    "required": ["table"],
                },
            },
        }
    ],
    tool_choice="auto",
    reasoning_effort="high",
    max_tokens=4096,
)

message = response.choices[0].message
if message.tool_calls:
    call = message.tool_calls[0]
    print(call.function.name, call.function.arguments)
else:
    print(message.content)

An existing OpenAI-SDK integration switches over via two lines: the base URL and the model id. Integrations written against Google's own API use a different SDK shape (google-genai with a contents field), so those need the message mapping, not just a base-URL swap.

Benchmarks

Three layers of evidence, each carrying a label and a date. The platform hosts no lane for this model yet, so our own measurements appear nowhere in this section.

The publisher's card. Self-reported, from the official model card, released April 2, 2026, for instruction-tuned models. Its methodology notes: Tau2 is an average over three runs; HLE is reported with and without search; OmniDocBench 1.5 is an average edit distance where lower is better; MRCR is an average. The card also scores the 12B and E2B siblings; the columns here are the ones a buyer compares.

BenchmarkGemma 4 31BGemma 4 26B A4BGemma 4 E4BGemma 3 27B (no think)
MMLU Pro85.2%82.6%69.4%67.6%
AIME 2026 no tools89.2%88.3%42.5%20.8%
LiveCodeBench v680.0%77.1%52.0%29.1%
Codeforces Elo21501718940110
GPQA Diamond84.3%82.3%58.6%42.4%
HLE no tools19.5%8.7%--
BigBench Extra Hard74.4%64.8%33.1%19.3%
MMMU Pro (vision)76.9%73.8%52.6%49.7%
OmniDocBench 1.5 (edit distance)0.1310.1490.1810.365
MRCR v2 8-needle 128K66.4%44.1%25.4%13.5%

The label belongs on any reading of it: publisher-reported, reference configuration, comparators chosen by the publisher. The shape that holds up across sources: the family's biggest jump over Gemma 3 is in reasoning and coding, the 31B leads every sibling row, and the 26B A4B sits close behind on most rows at a fraction of the active compute.

The arena and the Elo record. The launch announcement has the 31B at number three among open models on the Arena AI text leaderboard as of April 1, 2026, with the 26B at six, against models twenty times their size. The DeepMind model page plots the thinking variant at Elo 1451 against named comparators: glm-5 at 1456, kimi-k2.5-thinking at 1455, a 397B sparse Qwen at 1450, and gpt-oss-120b at 1354. That is the honest company this model keeps: near the top of the open-weights class on preference-style arenas, below frontier flagships.

Independent and community calibration. One independent index scores the 31B's reasoning variant slightly below the 26B A4B's on its aggregate intelligence scale, while noting the 26B's estimate carries its own uncertainty (dated this run; treat as one lens). A widely read hands-on review found the 26B within about 2 percent of the 31B across its own task mix. The pattern to internalize: the 31B is the quality pick inside the family, the gap to its MoE sibling is small on many tasks, and no open model at this size separates itself on every axis. If a workload matters, run it on your own tasks, on this platform or any other.

Getting started

  1. Create your console account. Access during beta runs through the invite flow: an open account can call every served model the day it appears.
  2. Generate an API key. A key per project is the intended pattern; keys are independent shutdown switches, so one revoked key never takes the others down.
  3. Check the rate. The pricing page carries each token leg's rate and the usage field on every response shows the charge; that page is the published commitment, rendered from the catalog and never typed by hand.
  4. Make the first call. Copy the curl tab, set KEY, and open with something small and thinking off (minimal) for a fast first reply. After that, larger work is a longer messages array and nothing more.

The chat category page holds the rest of the chat catalog, and the models index maps the platform's served lanes.

What the platform serves

Chat and reasoning models — context window, price per million tokens in and out and cached, capabilities
ModelContext$/1M in$/1M out$/1M cached inCapabilities
gemma-4-31b-it262,1440.220.490.066streaming

Rendered from the model registry — the same data GET /v1/models serves. A dash means the value isn't set.

Questions

What is Gemma 4 31B IT, and what does the -it mean?
Gemma 4 31B IT is the instruction-tuned release of the 31-billion-parameter dense model in Google DeepMind's Gemma 4 family, published April 2, 2026 under Apache 2.0. The family ships each size in two forms: a pre-trained base (google/gemma-4-31B) for further training, and an -it instruct variant tuned to follow instructions, hold conversations, call tools, and use its thinking mode. The -it is the one you serve to users. Two more artifact lines exist on top: QAT checkpoints (quantization-aware trained, released June 5, 2026) that cut memory sharply at near-original quality, and MTP drafters (released May 5, 2026) that speed decoding up to about three times when paired with the weights. On this platform the alias gemma-4-31b-it pins the instruction-tuned weights, and only those.
Is Gemma 4 31B free or open source?
Open source under Apache 2.0: the weights are public on Hugging Face, and the license permits download, commercial use, serving, and modification. Hosted access is a separate question. Google's own Gemini API carries the model on a free tier (input and output free of charge, paid tier listed as not available), with the official terms noting that free-tier content is used to improve Google products; community threads report roughly 1500 requests per day when the tier appeared in April 2026, and later community reports describe tighter token-per-minute caps from mid-2026. On this platform the model is served, and calls meter per token against a prepaid wallet.
What is Gemma 4 31B good at?
On the publisher's own card, its strongest rows are reasoning and technical work: 89.2 percent on AIME 2026 without tools, 84.3 percent on GPQA Diamond, 80.0 percent on LiveCodeBench v6, and a 2150 Codeforces Elo, each self-reported for the instruction-tuned models. The card also rates it highly on document and image tasks (76.9 percent on MMMU Pro, strong OCR and PDF parsing) and on long-context retrieval (66.4 percent on MRCR v2 at 128K). It reads text and images in any order and outputs text. It has no audio input; audio belongs to the smaller E2B, E4B, and 12B models.
What are the context window and output limits?
The publisher's model configuration sets the context at 262,144 tokens (256K), and every major listing agrees. For output, the publisher's configuration sets no cap at all; host listings fill that gap with their own numbers, and two variants of the same marketplace page have shown 32,768 and 16,384 for this exact model. Treat any output limit you see as that host's setting, not the model's. On this platform you set your own ceiling per call with max_tokens or max_completion_tokens, and both fields are accepted.
How do I turn thinking on or off?
Gemma 4's thinking is strictly a toggle, not a ladder: the model either reasons before answering or it does not. The publisher documents three controls. In transformers you pass enable_thinking true or false. In raw template terms, a control token at the start of the system prompt enables thinking and removing it disables it. On Google's hosted API the documented mapping is thinking_level high for enabled and minimal for disabled. This platform's chat route accepts the reasoning_effort parameter, and the values it accepts are minimal, low, medium, and high; minimal and high are meaningful on both surfaces (off and on), while low and medium are accepted per the platform contract without a documented state on a strictly two-state model. Do not send raw template fields yourself.
Gemma 4 31B or Gemma 4 26B A4B: which should I use?
They are different machines. The 31B is dense: all 30.7 billion parameters run on every token, which buys the family's highest quality at the cost of speed and memory. The 26B A4B is a sparse mixture-of-experts: 25.2 billion parameters total, only 3.8 billion active per token, so it answers much faster from far less memory (its long-context memory footprint is roughly a quarter of the 31B's in technical analyses). Locally, the practical floor is about 17 to 20 GB for a 4-bit 31B versus 16 to 18 GB for a 4-bit 26B A4B, and the gap widens fast with context. A hands-on community review found the 26B within about 2 percent of the 31B on its task mix. Rule of thumb: pick the 31B when quality is the constraint and memory is comfortable; pick the 26B A4B when speed or hardware is the constraint.
What will Gemma 4 31B IT cost on this platform?
Usage meters per token against a prepaid wallet, with separate input, cached-input, and output rates. What stops spending is the balance itself: once it is exhausted, a request arriving after that point is refused with a named error. Every response carries a usage object showing the retail cost of that call, so spend is visible per request. Current rates are listed on the pricing page; no price is hand-typed anywhere on this site.