Back to models
MiniMaxText APIOperationalUpdated

MiniMax M4 API

MiniMax’s native multimodal reasoning flagship has 2.74T total parameters, 66B active per token, and a 1M-token context for long-horizon coding.

API access

Endpoint
POST /v1/chat/completions
Base URL
https://api.apiko.app/v1

Speaks OpenAI Chat Completions; one APIKO key reaches every listed model.

Input price

$0.80

/ 1M tokens

Output price

$3.10

/ 1M tokens

Context

1M

Context window

Max output

32K

APIKO cap · official 256K

Start testing MiniMax M4

Ask a question — the answer streams in, followed by token usage, latency and an estimated cost.

MiniMax M4 API quickstart

Call MiniMax M4 in the OpenAI Chat Completions format. Copy-ready cURL, Python and Node.js samples below.

Code sample

Endpoint:/v1/chat/completions

curl https://api.apiko.app/v1/chat/completions \
  -H "Authorization: Bearer $APIKO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "minimax-m4",
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Tip: set APIKO_API_KEY to a key created on the API keys page.

Works with the official SDKs — swap in the base URL, API key and model ID.

Full MiniMax M4 API docsManage API keysOne APIKO key works across every listed model.

MiniMax M4 API pricing

Billed on the input, output and cached tokens reported in usage; every price is per 1M tokens.

Currency
Input tokens
$0.80/ 1M tokens

The prompt and context you send to the model

Output tokens
$3.10/ 1M tokens

What the model generates, reasoning tokens included

Cached input
$0.05/ 1M tokens93.8% off input

MiniMax M4 API specs

Specs follow APIKO's public request contract first; anything it does not publish is taken from the model vendor's official docs, and shows as not disclosed only when neither publishes it.

Streaming
Supported
Tool calling
Supported
Structured JSON
Not disclosed
Reasoning mode
Supported
Input modality
text · image · video
Output modality
text
Reasoning levels
low · medium · high · xhigh · max
Max output
32K per response (16K on the free trial); official 256K

Source: vendor's official model docs (checked 2026-12-05)

About MiniMax M4

Choose M4 when an investigation needs to connect evidence from recordings with several tool calls, or when a code change spans multiple modules. Use M3.1 Flash for routine checks at lower official token rates. Compare the cost of a completed task, including intermediate calls.

APIKO serves this model at /v1/chat/completions. Try prompts and parameters in the playground on this page first, then connect your server with the same APIKO API key.

Provider
MiniMax
Endpoint
/v1/chat/completions
Context window
1M
Model ID
minimax-m4

How to use MiniMax M4

The playground and the API share one model ID — three steps take you from trying a prompt to production calls.

  1. Step 1

    Try it online

    Test the system prompt, output length and sampling settings in the playground.

  2. Step 2

    Manage API keys

    Sign in to see your keys or create one; one key works across every listed model.

  3. Step 3

    Connect your server

    Send requests to /v1/chat/completions and record cost from the usage field.

Compare MiniMax M4 with other MiniMax models

Live APIKO prices per 1M tokens. Every model here works with the same API key — switch by changing the model ID.

Currency
ModelInputOutput
MiniMax M3.1 Flashminimax-m3.1-flash$0.1125$0.45
MiniMax M4This pageminimax-m4$0.80$3.10

MiniMax API docs

Comparing models and price tiers?

See live prices for every model

MiniMax M4 API FAQ

How much does the MiniMax M4 API cost?

APIKO charges MiniMax’s official rates of $0.80 for uncached input, $3.10 for output, and $0.05 for cache reads per million tokens. Billing is based on actual token usage.

What context and output limits should I plan for?

The context window is 1,000,000 tokens. MiniMax documents a maximum output of 262,144 tokens (256K), including thinking. Use the APIKO output limit in the specifications above when sizing a single response through the gateway.

How does MiniMax M4 handle long multimodal inputs?

M4 is a sparse mixture-of-experts model with 2.74T total parameters and 66B active per token. All 68 attention layers use MSA2, and MFlashKV offloads much of the KV cache to SSDs. Its 631M-parameter Vision Transformer uses 3D RoPE and spatiotemporal compression to understand images and video natively.

How do I control thinking depth?

Thinking is always on. Set reasoning_effort to low, medium, high, xhigh, or max. The default is max, and none is rejected. Read thinking from reasoning_content and the final answer from content.

When should I choose M4 over MiniMax M3.1 Flash?

Both have a 1M-token context and adjustable, always-on thinking. Choose M4 for complex reasoning and long coding runs with many tool calls. M3.1 Flash has lower official token rates and is a good starting point for high-volume tasks.

How do I call MiniMax M4 from the OpenAI SDK?

Set the base URL to https://api.apiko.app/v1, use your APIKO key, and pass minimax-m4 as the model for Chat Completions. Use image_url for image input, stream: true for SSE, and tools for function calling. In tool conversations, keep the full assistant message, including reasoning_content and tool_calls, when sending the tool result back.

How do I get an API key?

Sign up, then create an API key in your console. One API key can call every model on the gateway.

Is there a free trial for the MiniMax M4 API?

Yes. Sign in with Google using a Gmail address and $0.20 of trial credit is added to your balance, no card needed, once per person. It works on minimax-m4 and every other model. Output is capped at 16k tokens per request during the trial.

What if a request fails?

You are not billed for failed or errored calls. Retry, and if it keeps failing, contact us via the live chat at the bottom right of the page.