70% off Wan3.0 Standard and 50% off Wan3.0 Prime. Try Wan3.0

MiniMax M4 API

Flagship open-weight multimodal reasoning model with 1M context for agentic coding and long-horizon work

Get an API key
Input per 1M
$0.80
Cached input per 1M
$0.05
Output per 1M
$3.10
Context window
1M

Call MiniMax M4 in one request

Runware's endpoint takes the OpenAI Chat Completions format, so the OpenAI SDK works as it is. Change the base URL, key, and model ID. MiniMax M4 is also available through the Anthropic Messages API.

Model ID:minimax:m4@0
MiniMax M4 API docs
Request
import os

from openai import OpenAI

client = OpenAI(
    api_key=os.environ["RUNWARE_API_KEY"],
    base_url="https://api.runware.ai/v1",
)

stream = client.chat.completions.create(
    model="minimax:m4@0",
    messages=[
        {"role": "user", "content": "What is the capital of France?"},
    ],
    stream=True,
    stream_options={"include_usage": True},
)

for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
    if chunk.usage:
        print("\n", chunk.usage)

Usage and cost come back with the response. The stream ends with the request's token counts and its cost, so there is no second call to make.

About MiniMax M4

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.

Developer
MiniMax
Released
03 Dec, 2026
Input
Text, Image, Video
Context window
1M tokens
API
OpenAI Chat Completions, Anthropic Messages

Already on another provider?

Code that uses the OpenAI SDK moves over with three changes: the base URL, the API key and the model ID. Moving production traffic? We'll help you plan the switch.

Read the docs

Start on demand. Scale on dedicated.

Call your first model in minutes, or tell us about your workload and we will size dedicated capacity for it.

Get an API key