---
title: Gemma 4 31B | Runware Docs
url: https://runware.ai/docs/models/google-gemma-4-31b
description: Open 31B multimodal reasoning model for coding, long context, and agentic workflows
---
# Gemma 4 31B

![Gemma 4 31B](https://assets.runware.ai/covers/google-gemma-4-31b.jpg)

Gemma 4 31B is Google's flagship dense open-weights model in the Gemma 4 family. It combines strong reasoning, coding performance, native function calling, multimodal understanding across text, image, and video, and a 256K context window in a 31B-parameter open model designed for local and cloud deployment.

- **Status**: compatible-only
- **ID**: `google:gemma@4-31b`
- **Context window**: 256K context
- **Max output**: 256K output
- **Creator**: Google
- **Release Date**: April 2, 2026
- **Zero Data Retention**: Yes
- **Capabilities**: Text to Text, Image to Text, Video to Text, Checkpoint

**Gemma 4 31B** is served through Runware's **compatible endpoints**, which take another provider's request format. Point the SDK you already use at Runware by changing the base URL and the API key, and set `model` to `google-gemma-4-31b`.

Requests and responses keep the provider's format, so **its reference documents every parameter**.

| Endpoint | Format |
| --- | --- |
| `/v1/chat/completions` | [OpenAI Chat Completions](https://runware.ai/docs/tools/compatible-apis#openai-chat-completions) |

### [Chat Completions](https://runware.ai/docs/models/google-gemma-4-31b#chat-completions)

**cURL**:

```bash
curl -X POST https://api.runware.ai/v1/chat/completions \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "google-gemma-4-31b",
    "messages": [{"role": "user", "content": "What is the capital of France?"}]
  }'
```

**Python**:

```python
from openai import OpenAI

client = OpenAI(
    api_key="your_runware_api_key",
    base_url="https://api.runware.ai/v1",
)

response = client.chat.completions.create(
    model="google-gemma-4-31b",
    messages=[{"role": "user", "content": "What is the capital of France?"}],
)

print(response.choices[0].message.content)
```

**TypeScript**:

```typescript
import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: 'your_runware_api_key',
  baseURL: 'https://api.runware.ai/v1',
});

const response = await client.chat.completions.create({
  model: 'google-gemma-4-31b',
  messages: [{ role: 'user', content: 'What is the capital of France?' }],
});

console.log(response.choices[0].message.content);
```

**Vercel AI SDK**:

```typescript
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
import { generateText } from 'ai';

const runware = createOpenAICompatible({
  name: 'runware',
  apiKey: 'your_runware_api_key',
  baseURL: 'https://api.runware.ai/v1',
});

const { text } = await generateText({
  model: runware('google-gemma-4-31b'),
  prompt: 'What is the capital of France?',
});

console.log(text);
```

**LangChain**:

```python
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="google-gemma-4-31b",
    api_key="your_runware_api_key",
    base_url="https://api.runware.ai/v1",
)

response = llm.invoke("What is the capital of France?")

print(response.text)
```

[Compatible APIs](https://runware.ai/docs/tools/compatible-apis#openai-chat-completions) covers streaming, tool calling and how the endpoint differs from OpenAI, and the [OpenAI API reference](https://platform.openai.com/docs/api-reference/chat/create) lists every parameter.

## Cost and speed

**Rates** (per 1M tokens)

- Input: `$0.102`
- Output: `$0.297`
- Cached input: `$0.012`

billed per token, so a request costs what the model produced · [How pricing works](https://runware.ai/docs/models-api/pricing)