Skip to content
OpenKey

Gemma 4 31B

GoogleReleased Apr 2, 2026

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...

Try in playground
Context window
262K tokens
Max output
262K tokens
Input
image, text, video
Output
text
Tokenizer
Gemma
Released
Apr 2, 2026
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 tokensProvider+ 3% feeYou pay
Input$0.120$0.0036$0.124
Output$0.350$0.010$0.360
Cache read$0.090$0.0027$0.093

Benchmarks

Artificial Analysis

Intelligence index
29.4
Coding index
43.4
Agentic index
14.4

Supported parameters

  • frequency_penalty
  • include_reasoning
  • logit_bias
  • logprobs
  • max_tokens
  • min_p
  • presence_penalty
  • reasoning
  • repetition_penalty
  • response_format
  • seed
  • stop
  • structured_outputs
  • temperature
  • tool_choice
  • tools
  • top_k
  • top_logprobs
  • top_p

Call it

OpenAI-compatible: point your SDK at api.openkey.ai/v1 and use model google/gemma-4-31b-it.

Code sample language
curl https://api.openkey.ai/v1/chat/completions \
  -H "Authorization: Bearer $OPENKEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google/gemma-4-31b-it",
    "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",
    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",
  messages: [{ role: "user", content: "Hello" }],
});
console.log(completion.choices[0].message.content);

Questions

How much does Gemma 4 31B cost via API?
Through OpenKey, Gemma 4 31B costs $0.124 per 1M input tokens and $0.360 per 1M output tokens. That is the provider price ($0.120 / $0.350) plus a flat 3% fee — nothing else.
What is Gemma 4 31B's context window?
Gemma 4 31B accepts up to 262K tokens of context and returns up to 262K tokens per request.
Is Gemma 4 31B OpenAI-compatible?
Yes. Send requests to OpenKey's /v1/chat/completions endpoint with model "google/gemma-4-31b-it" using any OpenAI SDK — only the base URL and API key change.
What inputs does Gemma 4 31B support?
Gemma 4 31B accepts image, text, video input and produces text output.

More from Google

All Google models →