---
title: "Gemma 4 31B API pricing"
canonical: https://uplinkswitch.ai/models/gemma-4-31b-it
generated: 2026-10-25T14:41:45.823Z
source: https://api.uplinkswitch.com/v1/catalog
base_url: https://api.uplinkswitch.com/v1
---

# Gemma 4 31B API pricing

Gemma 4 31B API at $3.00/M input and $4.00/M output tokens. Works with the OpenAI SDK.

## Price per million tokens (USD)

| Tokens | Google list price | UplinkSwitch | Under list |
| --- | --- | --- | --- |
| Input | — | $3.00 | — |
| Cached input | — | $1.00 | — |
| Output | — | $4.00 | — |

## Model

- Model id: `gemma-4-31b-it`
- Formats: OpenAI SDK
- Base URL: https://api.uplinkswitch.com/v1
- Daily real-model check: Steady since Oct 20 (https://uplinkswitch.ai/proof#gemma-4-31b-it)

## Gemma 4 31B API key

1. Create a key in the console at uplinkswitch.ai/console. Credit is prepaid from $10 with no subscription, and the key works at once.
2. Point your SDK or tool at https://api.uplinkswitch.com/v1, for example with OPENAI_BASE_URL, and send the key as the bearer token.
3. Send gemma-4-31b-it as the model. The same key calls every other model in the catalog.

## Request

### Python · OpenAI SDK

```python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.uplinkswitch.com/v1",
    api_key="sk-uplink-live-...",
)

completion = client.chat.completions.create(
    model="gemma-4-31b-it",
    messages=[{"role": "user", "content": "Summarize this in one line."}],
)
print(completion.choices[0].message.content)
```

### TypeScript · OpenAI SDK

```typescript
import OpenAI from 'openai';

const client = new OpenAI({
  baseURL: 'https://api.uplinkswitch.com/v1',
  apiKey: 'sk-uplink-live-...',
});

const completion = await client.chat.completions.create({
  model: 'gemma-4-31b-it',
  messages: [{ role: 'user', content: 'Summarize this in one line.' }],
});
console.log(completion.choices[0].message.content);
```

### curl

```bash
curl https://api.uplinkswitch.com/v1/chat/completions \
  -H "authorization: Bearer sk-uplink-live-..." \
  -H "content-type: application/json" \
  -d '{"model":"gemma-4-31b-it","messages":[{"role":"user","content":"Hello"}]}'
```

## Questions

### What is Gemma 4 31B?

Gemma 4 31B is a model from Google. Through UplinkSwitch it answers the OpenAI SDK on one key as gemma-4-31b-it.

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

$3.00 per million input tokens and $4.00 per million output tokens, with cached input at $1.00.

### Is Gemma 4 31B free?

It is pay as you go: prepaid credit from $10, with no subscription or monthly fee, billed per token. A 1,000-token prompt with a 500-token reply costs about $0.005.

### What is the Gemma 4 31B model id?

gemma-4-31b-it. Send it as the model through the OpenAI SDK with base URL https://api.uplinkswitch.com/v1.

### How do I get a Gemma 4 31B API key?

Create one in the console at uplinkswitch.ai/console: prepaid credit from $10, no subscription, and the key is live at once. The same key calls Gemma 4 31B and every other model in the catalog; send it as the bearer token with base URL https://api.uplinkswitch.com/v1.

### Is it the real Gemma 4 31B?

Every day each model gets the same test prompt, and the results are public on /proof. Gemma 4 31B's latest result: Steady since Oct 20.

### Is there a Gemma 4 31B API?

Yes: gemma-4-31b-it on the OpenAI format at https://api.uplinkswitch.com/v1, $3.00 input and $4.00 output per million tokens. No weights to download and no GPU of your own; the key also runs every other model in the catalog.

### How many parameters does Gemma 4 31B have?

31B, dense, per google/gemma-4-31B-it.

### What is Gemma 4 31B's context window?

Up to 256K tokens, per google/gemma-4-31B-it.

### Is Gemma 4 31B open source?

Its weights are open on Hugging Face (google/gemma-4-31B-it); the license is Apache-2.0.

### What does Gemma 4 31B cost per 100 messages?

$0.80 for 100 chat turns of 2,000 input and 500 output tokens each, at $3.00 input and $4.00 output per million tokens, from prepaid credit with no subscription.

### Gemma 4 31B or Gemma 4 26B-A4B?

Gemma 4 31B is the dense model; Gemma 4 26B-A4B activates about 4B parameters a token. Gemma 4 31B is $3.00 / $4.00 per million tokens in / out, $8.00 for 1,000 chat turns; Gemma 4 26B-A4B is $0.56 / $1.60 per million tokens in / out, $1.92 for 1,000 chat turns. Both run on the same key, so send the same prompt to each.

### Gemma 4 31B or Gemma 31B Heretic Uncensored?

This is Google’s stock model; the Heretic build has the refusal direction removed. Gemma 4 31B is $3.00 / $4.00 per million tokens in / out, $8.00 for 1,000 chat turns; Gemma 31B Heretic Uncensored is $1.50 / $8.25 per million tokens in / out, $7.13 for 1,000 chat turns. Both run on the same key, so send the same prompt to each.

## Related

- Cursor setup: https://uplinkswitch.ai/guides/cursor
- Cline setup: https://uplinkswitch.ai/guides/cline
- Roo Code setup: https://uplinkswitch.ai/guides/roo-code
- Kilo Code setup: https://uplinkswitch.ai/guides/kilo-code
- SDKs setup: https://uplinkswitch.ai/guides/sdks
- Every model and price: https://uplinkswitch.ai/llms-full.txt
- Machine catalog: https://uplinkswitch.ai/ai-catalog.json
