api.foo
api.foo / Docs / MiniMax API pricing and API key

MiniMax API (October 2026): MiniMax-M3 Pricing, How to Get an API Key, M Plan, M2.7 Retirement and Code Examples

Updated · Tested on: macOS · curl · Python openai 3.32.0, anthropic 1.15.0 (request formats and error messages)
On this page

Short answer: the MiniMax API runs at https://api.minimax.io. MiniMax recommends its Anthropic-compatible endpoint, https://api.minimax.io/anthropic, and also serves an OpenAI-compatible one at https://api.minimax.io/v1. MiniMax-M3, the current model, costs $0.30 input / $0.06 cached / $1.20 output per million tokens up to 512K input tokens, with a 1M-token context and image and video input. M2.5 and M2.7 are being retired: closed to new users on October 19, 2026 and shut off on November 18, 2026. You get a key at platform.minimax.io and pay from a prepaid balance.

Prices and rules are from MiniMax's international API documentation at platform.minimax.io and its M Plan page, checked on October 17, 2026. We tested the request formats and error messages ourselves with test keys.

MiniMax API pricing

MiniMax-M3

Prices per million tokens, in USD. MiniMax shows these as a permanent 50% off its list price.

MiniMax-M3 Input Cached input Output
Up to 512K input tokens $0.30 $0.06 $1.20
Over 512K input tokens $0.60 $0.12 $2.40
Priority, up to 512K $0.45 $0.09 $1.80
Priority, over 512K $0.90 $0.18 $3.60
  • The 512K line. A request with more than 512K input tokens is billed at the higher row. MiniMax's own Claude Code guide sets auto-compaction at 512K, which helps keep long sessions under that line.
  • Priority gets your requests admitted first, for faster responses and fewer failures, at 1.5 times the standard price. Set service_tier to priority.
  • Thinking tokens count. M3 thinks by default, and those tokens count toward output (and toward max_tokens).

M2.7 and M2.5 (retiring)

Model Input Cached input (read) Cache write Output
MiniMax-M2.7 $0.30 $0.06 $0.375 $1.20
MiniMax-M2.7-highspeed $0.60 $0.06 $0.375 $2.40
MiniMax-M2.5 $0.30 $0.03 $0.375 $1.20
MiniMax-M2.5-highspeed $0.60 $0.03 $0.375 $2.40

M2.7 has the same base price as M3 but a 204,800-token context instead of 1M. The highspeed versions output about 100 tokens per second against about 60. M2.1 and M2 are already retired.

Images, video and speech

A few examples from MiniMax's pricing page: image-01 costs $0.0035 per image. Hailuo 2.3 video costs $0.28 for a 6-second 768P clip and $0.49 at 1080P. The newer MiniMax H3 video model is billed $0.08 per second at 768P and $0.13 at 2K. Text-to-speech with speech-2.8-hd costs $100 per million characters, and speech-2.8-turbo $60.

MiniMax vs other models

List prices per million tokens, input / output:

Model Input Output
MiniMax-M3 $0.30 $1.20
GLM-5.3-Flash $0.15 $0.50
GLM-5.3 $1.40 $4.40
DeepSeek V4 Pro (off-peak half price) $1.32 $3.96
Kimi K3 $3 $15
Claude Sonnet 5.5 $2 $10
GPT-6.1 Sol $2 $10

For a 1M-context model that takes images and video, M3 is one of the cheapest at list price. See also GLM API, Kimi API and DeepSeek API pricing.

M2.5 and M2.7 retirement: what to do

MiniMax's schedule:

Date What happens
October 19, 2026 M2.5 and M2.7 (and their highspeed versions) are no longer available to new users. M Plan and Token Plan requests to these names are routed to M3.1 Flash Preview, with the same usage allowances.
November 18, 2026 Retired. Pay-as-you-go API requests to these models stop working.

If you call M2.x with a pay-as-you-go key, switch the model name to MiniMax-M3 before November 18 and check these differences:

  • Rate limits are lower on M3: 200 requests and 10M tokens per minute, against 500 and 20M for M2.7.
  • Thinking can be turned off on M3. Sending thinking: {"type": "disabled"} makes M3 answer directly. On M2.x the same setting was accepted but ignored.
  • The context is 1M instead of 204,800, and M3 accepts image and video input.

How to get a MiniMax API key

  1. Go to platform.minimax.io and sign up or log in.
  2. Open Account → Billing → Balance and top up. MiniMax offers online payment and bank transfer. You can also set a balance alert and Autobilling, which tops you up automatically when the balance drops below a threshold.
  3. Open Account → API Keys and choose Create new secret key.
  4. Store it in an environment variable, for example export MINIMAX_API_KEY="your-key".

MiniMax warns that it may automatically disable keys that leak publicly, so keep yours out of browser code and repositories. Its docs don't describe free API credits for text models, so plan to top up before your first call.

International or China platform?

International Mainland China
Console platform.minimax.io platform.minimax.cn
Anthropic format https://api.minimax.io/anthropic https://api.minimax.cn/anthropic
OpenAI format https://api.minimax.io/v1 https://api.minimax.cn/v1

Keys only work on the platform that issued them. MiniMax's own FAQ lists a region mismatch between key and endpoint as a cause of 401 errors.

M Plan: MiniMax's subscription

M Plan is a personal subscription for MiniMax's own app, MiniMax Code, and for coding tools such as Claude Code, Codex, Cursor and OpenCode. It replaced the Token Plan, and existing Token Plan subscribers can keep theirs.

Tier Monthly Annual Usage
Go $22 $220 Baseline
Explore $55 $550 3× Go
Build $132 $1,320 7.5× Go, priority at peak times

All tiers include MiniMax-M3.1-Flash-Preview, MiniMax's newest text model, which for now is available only through M Plan and MiniMax Code, not pay-as-you-go. Explore and Build add the H3 video model. Text, image and audio share a 5-hour window and a weekly window. Video uses only the weekly window. Unused usage doesn't carry over.

Things to know:

  • M Plan uses a Subscription Key, found in Plan Details. It isn't interchangeable with a pay-as-you-go API key. If your balance is being charged while you have a plan, your tool is probably using the API key.
  • Credit packs cover usage beyond your limits: $5, $25 or $100, at 1,000 credits per $1, deducted at list price and valid for a year. You can buy them without a subscription.
  • It's not for production. MiniMax says M Plan is designed for individual, interactive developer use and recommends pay-as-you-go for production. Rate limits may tighten at peak times.
  • Upgrades are prorated; downgrades aren't supported.

Base URLs and formats

Format Base URL Notes
Anthropic Messages https://api.minimax.io/anthropic MiniMax's recommended format. Claude Code and the Anthropic SDK use it.
OpenAI Chat Completions https://api.minimax.io/v1 Most apps and the OpenAI SDK
OpenAI Responses https://api.minimax.io/v1 For tools that need the Responses API

Parameters that behave differently

Parameter M3 M3.1 Flash Preview M2.x
thinking: {"type": "disabled"} Skips thinking Returns 400 Ignored, still thinks
reasoning_effort (low to max) No effect Works, default max No effect
Default top_p 0.95 0.95 0.9

Two more to watch:

  • max_tokens includes thinking tokens. If it's too small, you get finish_reason: "length" with an empty content. MiniMax recommends max_completion_tokens for new integrations.
  • Where the thinking goes. In the OpenAI format, reasoning_split: true puts thinking in a separate reasoning_content field. With false, it stays inside content wrapped in <think> tags, which you may need to strip before showing text to users.

Code examples

curl (OpenAI format)

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

Python with the Anthropic SDK

import os
import anthropic

client = anthropic.Anthropic(
    api_key=os.environ["MINIMAX_API_KEY"],
    base_url="https://api.minimax.io/anthropic",
)
msg = client.messages.create(
    model="MiniMax-M3",
    max_tokens=4096,
    messages=[{"role": "user", "content": "Explain recursion in one sentence."}],
)
for block in msg.content:
    if block.type == "text":
        print(block.text)

The response contains a thinking block before the text block, so print by type rather than taking the first block.

Python with the OpenAI SDK

import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["MINIMAX_API_KEY"], base_url="https://api.minimax.io/v1")
resp = client.chat.completions.create(
    model="MiniMax-M3",
    messages=[{"role": "user", "content": "Explain recursion in one sentence."}],
    max_completion_tokens=4096,
    extra_body={"reasoning_split": True},
)
print(resp.choices[0].message.content)

Claude Code

Put this in ~/.claude/settings.json, with a pay-as-you-go key:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.minimax.io/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "your_minimax_api_key",
    "ANTHROPIC_MODEL": "MiniMax-M3[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "MiniMax-M3[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "MiniMax-M3[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMax-M3[1m]",
    "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "524288"
  }
}

With an M Plan Subscription Key, MiniMax's guide uses MiniMax-M3.1-Flash-Preview[1m] for all four model variables instead. The [1m] suffix tells Claude Code the model has a 1M-token context, and the 512K compaction window is MiniMax's recommendation. Clear any ANTHROPIC_BASE_URL or ANTHROPIC_AUTH_TOKEN exported in your shell profile so they don't conflict. Run /status inside Claude Code to confirm it's using api.minimax.io/anthropic. More on these variables: Claude Code with a custom API.

Errors

MiniMax returns an HTTP status plus its own code. These are the ones you'll most likely see.

Wrong or missing key (OpenAI format). Both returned the same thing in our test:

{"type":"error","error":{"type":"authorized_error","message":"login fail: Please carry the API secret key in the 'Authorization' field of the request header (1004)","http_code":"401"},"request_id":"..."}

The message suggests the header is missing even when you sent a wrong key. Check the key itself, and check that it matches the platform (international or China).

Wrong key (Anthropic format). HTTP 401 with "type":"authentication_error" and login fail: Please carry the API secret key in the 'X-Api-Key' field of the request header. Both the OpenAI and Anthropic Python SDKs raise AuthenticationError for these.

Other codes from MiniMax's error table:

Code Message What to do
1002 rate limit Slow down and retry with backoff.
1008 insufficient balance Top up, or turn on Autobilling.
1039 token limit Retry later, or reduce tokens per minute.
2013 invalid params Check parameters. Sending thinking disabled to M3.1 Flash Preview returns this.
2049 invalid API Key Check the key is correct and active.
2056 usage limit exceeded M Plan 5-hour window used up. Wait for it to reset or use credit packs.
1026 / 1027 input new_sensitive / output new_sensitive Content was blocked. Change the input.

Using MiniMax through a multi-model gateway

If you call MiniMax alongside Claude, GPT or Gemini, a gateway gives you one key and one bill. api.foo, the service that publishes these docs, serves MiniMax-M3 at its OpenAI-compatible endpoint, https://api.foo/v1, and in the Anthropic format at https://api.foo. We confirmed both paths with a test key. Prices are on the api.foo pricing page. Going direct to MiniMax gets you M Plan and M3.1 Flash Preview, which a gateway doesn't.

Sources

MiniMax, checked October 17, 2026: Pricing, Models, Model list, Prerequisites, OpenAI SDK, Anthropic SDK, Prompt caching, Rate limits, Error codes, About APIs, About account, M Plan overview, M Plan FAQ, M Plan with Claude Code, M Plan prices; China platform prerequisites.

FAQ

How much does the MiniMax API cost?

As of October 17, 2026, MiniMax-M3 costs $0.30 per million input tokens, $0.06 per million cached input tokens and $1.20 per million output tokens for requests up to 512K input tokens. That's a permanent 50% discount on its $0.60 and $2.40 list price. Requests over 512K input tokens cost $0.60 and $2.40. Priority processing costs 1.5 times as much.

How do I get a MiniMax API key?

Sign up on the international MiniMax API Platform at platform.minimax.io, top up your balance under Billing, then create a key under Account, API Keys. Use it with https://api.minimax.io/anthropic for the Anthropic format, which MiniMax recommends, or https://api.minimax.io/v1 for the OpenAI format.

Is MiniMax M2.7 being retired?

Yes. MiniMax is retiring the M2.5 and M2.7 families, including the highspeed versions. From October 19, 2026 they're unavailable to new users, and on November 18, 2026 they're retired, after which API requests to them stop working. Pay-as-you-go users should move to MiniMax-M3. M Plan requests to those names are routed to M3.1 Flash Preview from October 19.

What is MiniMax M Plan and how much is it?

M Plan is MiniMax's personal subscription for its own MiniMax Code app and for coding tools like Claude Code, Codex and Cursor. Go is $22 a month, Explore $55 and Build $132, and annual billing gives you two months free. It uses a Subscription Key, which is separate from a pay-as-you-go API key, and MiniMax recommends pay-as-you-go for production.

Can I use MiniMax-M3 with Claude Code?

Yes. MiniMax serves the Anthropic Messages format at https://api.minimax.io/anthropic. Set ANTHROPIC_BASE_URL to that address and ANTHROPIC_AUTH_TOKEN to your key in ~/.claude/settings.json, and set the model variables to MiniMax-M3, or to MiniMax-M3.1-Flash-Preview if you use an M Plan Subscription Key.

Why do I get "Please carry the API secret key in the Authorization field" when I did send a key?

MiniMax returns that message, error code 1004, for a wrong key as well as a missing one. Check that the key is correct and that it matches the platform. Keys from platform.minimax.io work with api.minimax.io, and keys from the China platform work with api.minimax.cn.

Found a mistake? Email [email protected].