Curated models for your best work

Join the waitlist

Gemma 4 31B

  • Vision
  • Tool calling
  • Streaming
  • Open weights

Model id

google/gemma-4-31b
Context window
256K
tokens
Input price
$0.2
per 1M tokens
Output price
$0.4
per 1M tokens
Max output
Provider
no narrower limit

Provider list price

Pricing

USD / 1M tokens

Input$0.2 / M tokens
Output$0.4 / M tokens
Context window256K tokens
RoutingFree

Provider list price. BYOK bills your provider; managed credits draw down at these rates. No markup or request fee. Every request is metered per engineer and joined to shipped work.

Registry 2026-09-29.1 · effective 9/17/2026 · Private rate card. Source withheld.

Registry contract

Capabilities

Protocols
3
Chat · Responses · Messages · streaming
Tools
2
Chat · Messages
JSON Schema
None
Not supported
Vision
Yes
Chat · Responses · Messages
Reasoning
None
No public control
Output limit
Provider
No narrower TokenSpend limit

canonical google/gemma-4-31b · revision google/gemma-4-31b · aliases gemma-4-31b, google/gemma-4-31B-it

First request

Run it

Python · TokenSpend SDK
from tokenspend import TokenSpend

client = TokenSpend()
resp = client.chat.completions.create(
    model="google/gemma-4-31b",
    messages=[{"role": "user", "content": "hello"}],
)
TypeScript · TokenSpend SDK
import { TokenSpend } from "@tokenspend/sdk";

const client = new TokenSpend();
const resp = await client.chat.completions.create({
  model: "google/gemma-4-31b",
  messages: [{ role: "user", content: "hello" }]
});
curl
curl https://api.tokenspend.dev/v1/chat/completions \
  -H "content-type: application/json" \
  -H "Authorization: Bearer $TOKENSPEND_API_KEY" \
  -d '{"model":"google/gemma-4-31b","messages":[{"role":"user","content":"hello"}]}'
Claude Code integration
export ANTHROPIC_BASE_URL=https://api.tokenspend.dev
export ANTHROPIC_API_KEY=$TOKENSPEND_API_KEY
export ANTHROPIC_MODEL=google/gemma-4-31b

One request shape reaches every model. Claude Code connects as an integration with two environment variables. TokenSpend never stores prompts or responses.

Questions

How much does Gemma 4 31B cost?

$0.2 per 1M input tokens and $0.4 per 1M output tokens, at provider list price. TokenSpend adds no markup or request fee. Managed credits carry a 5% fee when you buy them.

What is the context window of Gemma 4 31B?

Gemma 4 31B has a 256K token context window.

Does Gemma 4 31B support tool calling?

Yes. Tool calling is supported on Chat, Messages.

Does Gemma 4 31B support images?

Yes. Image input is supported on Chat, Messages.

Does Gemma 4 31B support reasoning?

No. Reasoning control is not supported on Gemma 4 31B through TokenSpend.

Does Gemma 4 31B have prompt caching?

No cache pricing is published for Gemma 4 31B.

When were these prices last checked?

Prices follow rate card 2026-09-29.1, effective 9/17/2026. Source: Private rate card.