# Gemma 4 31B API on Opennan

> Gemma 4 31B API on Opennan: $0.26 in / $0.52 out per 1M tokens.

- Maker: Google
- Category: Text
- Model id: `gemma-4-31b`
- Endpoint: POST https://api.opennan.com/v1/chat/completions
- MCP: https://api.opennan.com/v1/mcp (chat)
- Page: https://opennan.com/models/gemma-4-31b

## Gemma 4 31B API prices

| Tier | Opennan | Official | Below official |
| --- | --- | --- | --- |
| Input, per 1M tokens | $0.26 | No official price | - |
| Output, per 1M tokens | $0.52 | No official price | - |

The maker doesn't sell this exact model on its own API (open weights, or retired there), so there is no official price to compare.

## Call Gemma 4 31B from code

```bash
curl -N https://api.opennan.com/v1/chat/completions \
  -H "Authorization: Bearer $OPENNAN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gemma-4-31b","messages":[{"role":"user","content":"Write a haiku about a city at night."}],"max_tokens":1024,"temperature":1,"top_p":1,"stream":true,"stream_options":{"include_usage":true}}'
```

## Gemma 4 31B API questions

### How much does the Gemma 4 31B API cost?

Gemma 4 31B API on Opennan: $0.26 in / $0.52 out per 1M tokens. Prices are in US dollars per call, shown before you run, and every tier is in the price table.

### What inputs does Gemma 4 31B take?

Text prompt, Image.

### Which options can a call set?

Context window: 262,144 tokens. Up to 32,768 output tokens per reply.

### How is it billed?

Per token: input, cached input and output tokens are priced per 1M tokens and billed separately.

### What happens if a generation fails?

A request that fails is not charged. You pay only for the tokens used.

### How do I call Gemma 4 31B from an AI agent?

Add the MCP server https://api.opennan.com/v1/mcp with your API key as a bearer token, then call the chat tool with model "gemma-4-31b". Or send a POST to https://api.opennan.com/v1/chat/completions.

## Similar models

- [DeepSeek V3.2](https://opennan.com/models/deepseek-v3.2): from $0.338 per 1M input tokens
- [Nemotron 3.5 Super VL](https://opennan.com/models/nemotron-3.5-super-vl): from $0.195 per 1M input tokens
- [Qwen3.8 27B](https://opennan.com/models/qwen3.8-27b): from $0.195 per 1M input tokens
- [GLM-4.7](https://opennan.com/models/glm-4.7): from $0.52 per 1M input tokens
- [Llama 3.3 70B](https://opennan.com/models/llama-3.3-70b): from $0.13 per 1M input tokens
- [Llama 4 Scout](https://opennan.com/models/llama-4-scout): from $0.13 per 1M input tokens
