# Google: Gemma 4 31B TEE

Gemma 4 31B TEE is Google DeepMind's dense open-weight multimodal model, released under Apache 2.0. It takes text and image input, produces text, offers configurable thinking and native function calling, and is aimed at reasoning, coding and agentic workflows.

- **Model id:** `opencheap/gemma4-31b`
- **Price per 1M tokens:** $0.12 input / $0.37 output
- **Cached input:** $0.012 per 1M tokens
- **Context:** 262K tokens, 131K max output

## Providers

1 provider. Prices are per 1M tokens. As of 2026-12-04 12:06 UTC.

| Provider | Input price | Cache price | Output price | Context | Max output |
| --- | --- | --- | --- | --- | --- |
| NanoGPT · quantization unknown | $0.12 | $0.012 | $0.37 | 262K | 131K |

A request picks by price (`:floor`) or by speed (`provider.sort`, `:nitro`), or sets a floor on tokens per second. [How routing works](https://docs.opencheap.si/speed)

### Supported parameters

The parameters each provider supports on this model, from its published list and our own tests of whether answers show the parameter taking effect. A test is a snapshot, not a guarantee; `provider.require_parameters` sends a request only to providers that support every parameter it sets. [Required parameters](https://docs.opencheap.si/speed#require-parameters)

- **NanoGPT:** `temperature`, `top_p`, `seed`, `logit_bias`, `presence_penalty`, `stop`, `response_format`, `structured_outputs`, `tools`, `tool_choice`

## Price history

Each provider's price over the last 24 hours, 7 days and 30 days is charted on [the page](https://opencheap.si/models/gemma4-31b#price-history).

## API

Point the OpenAI SDK at OpenCheap and pass the model id `opencheap/gemma4-31b`; the rest of your code stays the same.

```bash
curl https://api.opencheap.si/v1/chat/completions \
  -H "Authorization: Bearer $OPENCHEAP_API_KEY" -H "Content-Type: application/json" \
  -d '{ "model": "opencheap/gemma4-31b", "messages": [{ "role": "user", "content": "Hi" }] }'
```

```python
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.opencheap.si/v1", api_key=os.environ["OPENCHEAP_API_KEY"])
r = client.chat.completions.create(model="opencheap/gemma4-31b",
    messages=[{"role": "user", "content": "Hi"}])
print(r.choices[0].message.content)
```

```javascript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.opencheap.si/v1", apiKey: process.env.OPENCHEAP_API_KEY });
const r = await client.chat.completions.create({ model: "opencheap/gemma4-31b",
  messages: [{ role: "user", content: "Hi" }] });
console.log(r.choices[0].message.content);
```

## About Gemma 4 31B TEE

Gemma 4 31B TEE costs from $0.12 per 1M input tokens and $0.37 per 1M output tokens on OpenCheap, with cached input at $0.012 per 1M tokens. It has no public list price to compare with. At that price, a request with 10,000 input tokens and 1,000 output tokens costs about $0.0016, and 1,000 such requests about $1.57. Prices as of 2026-12-04 12:01 UTC.

One provider serves Gemma 4 31B TEE on OpenCheap today. Each request goes to the cheapest healthy provider of the model, and every answer reports what it cost in `usage.cost`. Its context window is 262K tokens (262,144), room for roughly 200,000 words of English in one request.

Gemma 4 31B TEE is one of [102 Google models](https://opencheap.si/models/lab/google) on OpenCheap. Every model on OpenCheap is called with one key at the same OpenAI-compatible endpoint, `https://api.opencheap.si/v1`.

## Pricing questions

### How much does the Gemma 4 31B TEE API cost per 1M tokens?

Gemma 4 31B TEE costs from $0.12 per 1M input tokens and $0.37 per 1M output tokens on OpenCheap, with cached input at $0.012 per 1M tokens. Prices as of 2026-12-04 12:01 UTC.

### What does one Gemma 4 31B TEE request cost?

A request with 10,000 input tokens and 1,000 output tokens costs about $0.0016, and 1,000 such requests about $1.57. Every answer reports its own cost in usage.cost.

### Which providers serve Gemma 4 31B TEE?

One provider serves Gemma 4 31B TEE on OpenCheap today. Each request goes to the cheapest healthy provider of the model; the table on this page lists every provider with its price, speed and uptime.

### What is the context window of Gemma 4 31B TEE?

Its context window is 262K tokens (262,144), room for roughly 200,000 words of English in one request.

### How do I call the Gemma 4 31B TEE API?

Point the OpenAI SDK at https://api.opencheap.si/v1 and pass the model id opencheap/gemma4-31b. One OpenCheap key works for every model; the rest of your code stays the same.

## More from Google

- [Gemma 4 31B Thinking TEE](https://opencheap.si/models/gemma4-31b:thinking) (`gemma4-31b:thinking`): $0.12 / $0.37 per 1M · 262K context
- [Gemma 4 26B A4B It](https://opencheap.si/models/gemma-4-26b-a4b) (`gemma-4-26b-a4b`): $0.01 / $0.03 per 1M · 262K context
- [Gemma 4 31B It](https://opencheap.si/models/gemma-4-31b) (`gemma-4-31b`): $0.012 / $0.036 per 1M · 262K context
- [google/gemma-3-27b-it](https://opencheap.si/models/gemma-3-27b) (`gemma-3-27b`): $0.02 / $0.05 per 1M · 131K context
- [Gemini 3.5 Flash](https://opencheap.si/models/gemini-3.5-flash) (`gemini-3.5-flash`): $1.50 / $9.00 per 1M · 1M context
- [DiffusionGemma](https://opencheap.si/models/diffusiongemma) (`diffusiongemma`): $0.05 / $0.15 per 1M · 262K context
- [Nano Banana (Gemini 2.5 Flash Image)](https://opencheap.si/models/gemini-2.5-flash-image) (`gemini-2.5-flash-image`): $0.32 / $2.63 per 1M · 32K context
- [Gemini 2.5 Flash Lite](https://opencheap.si/models/gemini-2.5-flash-lite) (`gemini-2.5-flash-lite`): $0.10 / $0.40 per 1M · 1M context

[All 102 Google models](https://opencheap.si/models/lab/google)

## Similar models

- [DeepSeek V3.2](https://opencheap.si/models/deepseek-v3.2): DeepSeek · 163K context · $0.22 / $0.34 per 1M · [Compare with Gemma 4 31B TEE](https://opencheap.si/compare/gemma4-31b-vs-deepseek-v3.2)
- [GLM 5.1](https://opencheap.si/models/glm-5.1): Zhipu · 204K context · $0.14 / $0.45 per 1M · [Compare with Gemma 4 31B TEE](https://opencheap.si/compare/gemma4-31b-vs-glm-5.1)
- [GLM 5.2](https://opencheap.si/models/glm-5.2): Zhipu · 1M context · $0.32 / $0.32 per 1M · [Compare with Gemma 4 31B TEE](https://opencheap.si/compare/gemma4-31b-vs-glm-5.2)
- [Mistral Large 3](https://opencheap.si/models/mistral-large-3): Mistral · 256K context · $0.13 / $0.38 per 1M · [Compare with Gemma 4 31B TEE](https://opencheap.si/compare/gemma4-31b-vs-mistral-large-3)
- [Ternary Bonsai 2 27B](https://opencheap.si/models/ternary-bonsai-2-27b): PrismML · 262K context · $0.075 / $0.50 per 1M · [Compare with Gemma 4 31B TEE](https://opencheap.si/compare/gemma4-31b-vs-ternary-bonsai-2-27b)
- [Hy3](https://opencheap.si/models/hy3): Tencent · 262K context · $0.066 / $0.26 per 1M, 31 % cheaper · [Compare with Gemma 4 31B TEE](https://opencheap.si/compare/gemma4-31b-vs-hy3)

[Compare Gemma 4 31B TEE with any model](https://opencheap.si/compare)

---

Source: https://opencheap.si/models/gemma4-31b · All models: https://opencheap.si/models · Prices as JSON: https://api.opencheap.si/v1/prices · Index for agents: https://opencheap.si/llms.txt
