---
title: MiniMax M4 | Runware Docs
url: https://runware.ai/docs/models/minimax-m4
description: Flagship open-weight multimodal reasoning model with 1M context for agentic coding and long-horizon work
---
# MiniMax M4

![MiniMax M4](https://assets.runware.ai/covers/minimax-m4.jpg)

MiniMax M4 is MiniMax's flagship open-weight multimodal reasoning model, with 2.74 trillion total parameters, 66 billion active, a 1 million token context window, and native image and video understanding. It targets demanding agentic workloads such as complex software engineering, long-horizon autonomous tasks, computer use, and professional knowledge work, and can deliver end-to-end artifacts like financial models, presentations, interactive websites, 3D scenes, and games. Its MiniMax Sparse Attention 2 and MFlashKV architecture is designed for low-latency, high-throughput inference at trillion-parameter scale.

- **Status**: compatible-only
- **ID**: `minimax:m4@0`
- **Context window**: 1M context
- **Creator**: MiniMax
- **Release Date**: December 3, 2026
- **Capabilities**: Text to Text, Image to Text, Video to Text

**MiniMax M4** 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 `minimax:m4@0`.

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.md#openai-chat-completions) |
| `/v1/messages` | [Anthropic Messages](https://runware.ai/docs/tools/compatible-apis.md#anthropic-messages) |

### [Chat Completions](https://runware.ai/docs/models/minimax-m4#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": "minimax:m4@0",
    "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="minimax:m4@0",
    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: 'minimax:m4@0',
  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('minimax:m4@0'),
  prompt: 'What is the capital of France?',
});

console.log(text);
```

**LangChain**:

```python
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="minimax:m4@0",
    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.md#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.

### [Messages](https://runware.ai/docs/models/minimax-m4#messages)

**cURL**:

```bash
curl -X POST https://api.runware.ai/v1/messages \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax:m4@0",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "What is the capital of France?"}]
  }'
```

**Python**:

```python
from anthropic import Anthropic

client = Anthropic(
    auth_token="your_runware_api_key",
    base_url="https://api.runware.ai",
)

message = client.messages.create(
    model="minimax:m4@0",
    max_tokens=1024,
    messages=[{"role": "user", "content": "What is the capital of France?"}],
)

for block in message.content:
    if block.type == "text":
        print(block.text)
```

**TypeScript**:

```typescript
import Anthropic from '@anthropic-ai/sdk';

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

const message = await client.messages.create({
  model: 'minimax:m4@0',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'What is the capital of France?' }],
});

for (const block of message.content) {
  if (block.type === 'text') {
    console.log(block.text);
  }
}
```

**Vercel AI SDK**:

```typescript
import { createAnthropic } from '@ai-sdk/anthropic';
import { generateText } from 'ai';

const runware = createAnthropic({
  authToken: 'your_runware_api_key',
  baseURL: 'https://api.runware.ai/v1',
});

const { text } = await generateText({
  model: runware('minimax:m4@0'),
  maxOutputTokens: 1024,
  prompt: 'What is the capital of France?',
});

console.log(text);
```

**LangChain**:

```python
from langchain_anthropic import ChatAnthropic

llm = ChatAnthropic(
    model="minimax:m4@0",
    base_url="https://api.runware.ai",
    default_headers={"Authorization": "Bearer your_runware_api_key"},
    max_tokens=1024,
)

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

print(response.text)
```

[Compatible APIs](https://runware.ai/docs/tools/compatible-apis.md#anthropic-messages) covers how the Anthropic SDKs authenticate against Runware, and the [Claude API reference](https://platform.claude.com/docs/en/api/messages) lists every parameter.

## Cost and speed

**Rates** (per 1M tokens)

- Input: `$0.80`
- Output: `$3.10`
- Cached input: `$0.05`

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