minimax/minimax-m4
Release date: 2026-12-03
1,000,000 context · $0.80/M input tokens · $3.10/M output tokens
MiniMax-M4 is MiniMax's natively multimodal flagship model with a 1M-token context window, built for long-horizon coding and agentic work in large codebases.
Pay-per-use
No upfront costs, pay only for what you use
Use the following code examples to integrate with our API:
import OpenAI from 'openai';
if (!process.env.WAVESPEED_API_KEY) throw new Error('Set WAVESPEED_API_KEY');
const client = new OpenAI({
apiKey: process.env.WAVESPEED_API_KEY,
baseURL: 'https://llm.wavespeed.ai/v1',
timeout: 120_000,
maxRetries: 0,
});
try {
const response = await client.chat.completions.create({
model: 'minimax/minimax-m4',
messages: [{ role: 'user', content: 'Hello!' }],
});
const body = response as typeof response & { error?: { message?: string } };
if (body.error) throw new Error(body.error.message || 'LLM generation failed');
console.log(response.choices[0]?.message?.content ?? '');
} catch (error) {
console.error('LLM request failed:', error);
process.exitCode = 1;
}import OpenAI from 'openai';
if (!process.env.WAVESPEED_API_KEY) throw new Error('Set WAVESPEED_API_KEY');
const client = new OpenAI({
apiKey: process.env.WAVESPEED_API_KEY,
baseURL: 'https://llm.wavespeed.ai/v1',
timeout: 120_000,
maxRetries: 0,
});
try {
const response = await client.chat.completions.create({
model: 'minimax/minimax-m4',
messages: [{ role: 'user', content: 'Hello!' }],
});
const body = response as typeof response & { error?: { message?: string } };
if (body.error) throw new Error(body.error.message || 'LLM generation failed');
console.log(response.choices[0]?.message?.content ?? '');
} catch (error) {
console.error('LLM request failed:', error);
process.exitCode = 1;
}| Specification | Value |
|---|---|
| Provider | minimax |
| Model Type | Chat Completions model |
| Architecture | text+image+video->text |
| Context Window | 1000000 tokens |
| Input | Text, Image, Video |
| Output | Text |
| Vision | Supported |
| Function Calling | Supported |
| Release Date | December 3, 2026 |
include_reasoning, max_tokens, reasoning, reasoning_effort, response_format, temperature, tool_choice, tools, top_p
Base URL: https://llm.wavespeed.ai/v1 API Endpoint: chat/completions Model ID: minimax/minimax-m4
Input
$0.8 /M
Output
$3.1 /M
Context
1000K
Max Output
524K
Vision
Supported
Tool Use
Supported
Access MiniMax M4 through our unified API — OpenAI-compatible, no cold starts, transparent pricing.
Pricing on WaveSpeedAI: $0.80 per million input tokens and $3.10 per million output tokens. Prompt caching and batch processing are billed separately and reduce effective cost on long, repetitive workloads.
MiniMax M4 supports up to 1000K tokens of context with up to 524K tokens of output per request.
WaveSpeedAI exposes MiniMax M4 at https://llm.wavespeed.ai/v1 through the OpenAI-compatible Chat Completions interface. Most OpenAI SDK clients work by changing the base URL and API key; optional fields depend on the selected model.
Sign in to WaveSpeedAI, create an API key in Access Keys, then send a request to https://llm.wavespeed.ai/v1/chat/completions with the model id shown above. Check the current model catalog for availability, capabilities, and pricing.