Google: Gemma 4 31B Instruct

google/gemma-4-31b-it

Google Gemma 4 31B Instruct API pricing

Gemma 4 31B Instruct costs $0.108 per million input tokens and $0.304 per million output tokens on Oxyy. These are the pay-as-you-go prices after the current 60% discount (Launch Promo; standard price $0.270 input and $0.760 output), and cached input tokens are billed at $0 per million. It accepts text, images and video and returns text, with a 262K-token context window. A cheaper Google option is Gemma 4 E4B at $0.080 / $0.080 per 1M tokens; for every model and rate, see Gemini API pricing.

The largest Gemma 4 model: a 30.7B-parameter dense multimodal model for reasoning, agentic workflows, coding and multimodal understanding, deployable on consumer GPUs and workstations.

ModalitiesTextImageVideoText
Price$0.108 / $0.304 per 1M tokens in / outAll Gemini API pricing
Context262K
ReleasedApr 2, 2026

Providers

Where this model runs, and what each route costs. Requests are sent to a healthy provider automatically; if one errors, the gateway retries against another serving the same model.

ProviderInput /MOutput /MCache read /MLatencyThroughput
Google$0.108$0.304$017.79s52 tps

Capabilities (13)

StreamingTool callingStructured outputThinkingReasoningSystem promptVisionVideo InputPDF inputMultilingualInterleaved Image TextPrompt cachingFine Tunable

Supported parameters (8)

thinking_leveltemperaturetop_ptop_ksystem_instructiontoolsresponse_formatreasoning_effort

A parameter not listed here may be removed before the request reaches the model. When it is, the request still succeeds and the response names it, with the reason, in provider_specific_fields.dropped_params. Thinking controls work as described below whether or not they are listed.

Thinking

Thinking can be turned off: send reasoning_effort: "none", or thinking: {type: "disabled"}.

Pricing

What this model costs on Oxyy, pay as you go. "Charged" is the rate a request is billed at; the standard price is shown beside it for reference.

Input price
$0.108
per 1M input tokens · standard price $0.270
Output price
$0.304
per 1M output tokens · standard price $0.760
RateStandard priceChargedUnit
Input$0.270$0.108per 1M input tokens
Output$0.760$0.304per 1M output tokens
Cached input$0$0per 1M cached input tokens
Cache write (5 min)$0$0per 1M cache-write tokens, 5-minute
Cache write (1 hour)$0$0per 1M cache-write tokens, 1-hour
Cached audio input$0$0per 1M cached audio tokens
Reasoning$0$0per 1M reasoning tokens
Cache storage$0$0per 1M tokens per hour stored

Discount. Charged rates include the current "Launch Promo" discount of 60% on every rate.

UTC

Specifications

Model ID
gemma-4-31b-it
Developer
Google
Type
Text
Input
Text, images and video
Output
Text
Context window
262,144 tokens
Knowledge cutoff
January 2025
Released
Apr 2, 2026
Tokenizer
Gemini
Series
Gemma 4
Image input
Up to 20 MB each
Video input
Up to 100 MB each
Endpoint
/v1/chat/completions

Best for

ReasoningCodingAgentsDocument parsingEvaluation

Quickstart

Call gemma-4-31b-it with a POST to /v1/chat/completions on https://api.oxyy.ai, using your Oxyy API key from the OXYY_API_KEY environment variable. The same key works for every model in the catalog.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.oxyy.ai/v1",
    api_key=os.environ["OXYY_API_KEY"],
)

response = client.chat.completions.create(
    model="gemma-4-31b-it",
    messages=[
        {"role": "user", "content": "Explain unified AI APIs in one sentence."},
    ],
)
print(response.choices[0].message.content)

Performance

Throughput is how fast the model writes (tokens per second — higher is better). Latency is total round-trip time (lower is better). TTFT is time-to-first-token — how long before you see anything appear (lower is better). Throughput and TTFT are measured on streaming requests, which are the only ones with a first-token moment to time.

Throughput
52tok/s
P50, streaming requests
Latency
17.79s
P50, end to end
UTC

Throughput

P99229 tok/s
P95119 tok/s
P5052 tok/s

Latency

P5020.3s
P7549.2s
P9583.6s
P99158.0s

Time to first token

P50967ms
P953395ms

Cache hit rate

4.73%
Share of input tokens served from the prompt cache over the window.

Activity

Token volume and request traffic to this model over time. Daily totals, UTC.

Prompt409.8M
Reasoning13.8M
Completion (excl. reasoning)274.1M

Prompt tokens measure input size. Reasoning tokens show internal thinking before a response. They are part of the output, so the completion bars show the rest of it and each day’s bar is its total.

Frequently asked questions

What is Gemma 4 31B Instruct?
The largest Gemma 4 model: a 30.7B-parameter dense multimodal model for reasoning, agentic workflows, coding and multimodal understanding, deployable on consumer GPUs and workstations.
How much does Gemma 4 31B Instruct cost?
Gemma 4 31B Instruct costs $0.108 per million input tokens and $0.304 per million output tokens on Oxyy. These are the pay-as-you-go prices after the current 60% discount (Launch Promo; standard price $0.270 input and $0.760 output), and cached input tokens are billed at $0 per million. You pay per request, with no subscription.
What is the context length of Gemma 4 31B Instruct?
Gemma 4 31B Instruct has a context window of 262,144 tokens.
Does Gemma 4 31B Instruct support tool calling and structured outputs?
Yes — Gemma 4 31B Instruct supports both tool calling and structured outputs.
What inputs and outputs does Gemma 4 31B Instruct support?
Gemma 4 31B Instruct accepts text, images and video as input and returns text.
Which API endpoint does Gemma 4 31B Instruct use?
Send a POST request to https://api.oxyy.ai/v1/chat/completions with "model": "gemma-4-31b-it", authenticated with your Oxyy API key. It is also served on /v1beta/models/gemma-4-31b-it:generateContent (Google Gemini SDK) and /v1/responses (Responses API).
What is the knowledge cutoff of Gemma 4 31B Instruct?
Gemma 4 31B Instruct's training data runs up to January 2025.
When was Gemma 4 31B Instruct released?
Gemma 4 31B Instruct was released on Apr 2, 2026.
What other models does Google have?
Google also offers Gemini 2.5 Flash, Gemini 2.5 Flash-Lite, Gemini 2.5 Pro and Gemini 3.1 Flash-Lite through Oxyy.

Alternatives to Gemma 4 31B Instruct

Models of the same kind from other vendors, closest in price first. Prices are pay-as-you-go on Oxyy, through the same API key.

Explore more models

More models from Google