Back to models
Try in Agents
Model · Google
Gemma 4 31B
google/gemma-4-31b
Google's open-weight dense 31B model with vision and tool calling — a denser sibling of Gemma 4's 26B MoE
vision
Specs
Context
262K
Max output
131K
Provider
Google
Input
$0.140/ 1M tokens
Output
$0.400/ 1M tokens
Cache read
—
Providers and pricing
| Vercel AI Gateway | List price | Our price |
|---|---|---|
| Input | $0.140 / 1M tokens | $0.140 / 1M tokens |
| Output | $0.400 / 1M tokens | $0.400 / 1M tokens |
List price is what the provider charges us. Our price is what a request is billed.
Live performance
Loading measurements…
How we measure. Every request is timed from the moment we send it. A finish time comes from the provider's own timestamps when it reports them, from the moment it calls us back when it doesn't, and otherwise from polling: we take the midpoint between the last check that found the job running and the first that found it done, so it is off by at most half the poll interval. First token is the wait for the first streamed text or tool token; output speed counts tokens after that first token. Requests you stop are left out. Figures appear once a window has 20 completed requests, and are aggregate only.
Try it
Chat with Gemma 4 31BTerramind API
⌘+Enter to run
Code
import { streamText } from "ai";
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
const terramind = createOpenAICompatible({
name: "terramind",
baseURL: "https://terramind.com/api/v1",
apiKey: process.env.TERRAMIND_API_KEY!,
});
const result = streamText({
model: terramind("gemma-4-31b"),
prompt: "Why is the sky blue?",
});
for await (const chunk of result.textStream) {
process.stdout.write(chunk);
}
Want to run this in your app? Grab an API key · Full chat reference
More by Google
| Model | Context | In | Out | Capabilities |
|---|---|---|---|---|
| 1.0M | $1.25 | $10.00 | reasoningvisionvideo | |
| 1M | $2.00 | $12.00 | reasoningvisionvideo | |
| 1M | $1.50 | $9.00 | reasoningvisionvideo | |
| 1M | $0.750 | $3.75 | reasoningvisionvideo | |
| 1M | $0.750 | $3.75 | reasoningvisionvideo | |
| 1M | $0.750 | $3.75 | reasoningvisionvideo | |
| 1M | $4.00 | $20.00 | reasoningvisionvideo | |
| 1M | $0.250 | $1.50 | visionvideoaudio |