MiniMax API key integration cover: an amber key unlocking glass and chrome model panels for text, image, and video generation

Getting a MiniMax API key: the three-step path

A MiniMax API key is created in the MiniMax platform console, and the flow is the same whether you plan to call the M3 language model, the image-01 image model, or the Hailuo video models. The official Quick Start guide condenses it to three steps:

  1. Register or log in at platform.minimax.io. International accounts use this domain; mainland-China accounts use platform.minimaxi.com instead. The two platforms are separate — a key created on one will not authenticate against the other.
  2. Create a key. For pay-as-you-go, go to API Keys > Create new secret key. For a Token Plan subscription, the same page shows a separate Subscription Key (prefixed sk-cp) that is tied to your Token Plan seat.
  3. Store the key, then top up. Paste the key into an environment variable or .env file — MiniMax recommends export OPENAI_API_KEY=your-key because the API is OpenAI-compatible. Pay-as-you-go billing draws from your account balance, so top up at Billing > Balance before your first call.

That is the entire setup. The decision that actually affects your costs comes after the key exists: which key type, which model, and which route you call it through. The rest of this guide covers each of those, with prices read from the official pages on August 14, 2026.

What one MiniMax API key can call: models and endpoints

MiniMax is a multimodal provider, and a single key works across all of it. The model documentation currently groups them into four families:

Family Current models Billed by
LLM MiniMax-M3, M2.7 (plus legacy M2.5/M2.1/M2) tokens
Video MiniMax-H3, Hailuo 2.3, Hailuo 02 seconds or task
Image image-01 per image
Speech & Music speech-2.8-hd / turbo, music-3.0 characters or task

All of them authenticate with the same secret key against the same base URL, https://api.minimax.io/v1, which is OpenAI-compatible — most OpenAI SDK code works after swapping the base URL and key. MiniMax also offers an Anthropic-compatible endpoint at https://api.minimax.io/anthropic for tools built around the Messages format.

The practical consequence: the “minimax api key” question is not really about the key itself. It is about which of these models you will call and how much that specific model costs. The next section gives the current price list.

One MiniMax API key reaching text, image, video, and speech model panels through a single API gateway

One API key, one base URL, four model families. Text, image, video, and speech endpoints all authenticate with the same secret key.

MiniMax API key pricing, read from the official pages (August 14, 2026)

The official Pay-as-you-go pricing page is the authoritative source for unit rates. The figures below were read from that page on August 14, 2026; they supersede older numbers you will find in most “minimax api key” tutorials, which still cite the pre-2026 rates.

MiniMax official pay-as-you-go pricing page with model, resolution, and unit rates for LLM, video, image, and audio

MiniMax’s official Pay-as-you-go page, captured August 14, 2026. Unit rates change; check the live page before budgeting.

LLM (per million tokens)

Model Input Output
MiniMax-M3 (≤512k input tokens) $0.30 $1.20
MiniMax-M3 (>512k input tokens) $0.60 $2.40
MiniMax-M2.7 $0.30 $1.20
MiniMax-M2.7-highspeed $0.60 $2.40
Legacy M2.5 / M2.1 / M2 $0.30 $1.20

The M3 ≤512k row carries a “permanent 50% off” label on the official page; treat the struck-through list prices as marketing framing, not a deadline.

Video (H3 billed per second; Hailuo billed per task)

Model Specification Price
MiniMax-H3 2K, per second $0.13 / sec
MiniMax-H3 768P, per second $0.08 / sec
Hailuo 2.3 Fast 768P, 6s video $0.19 / task
Hailuo 2.3 768P, 6s video $0.28 / task
Hailuo 02 768P, 6s video $0.28 / task

H3 also charges for input materials beyond the first five images ($0.04 per additional image) and bills input video by duration. Hailuo tasks are quoted per finished video at a fixed duration, not per second — keep the billing unit straight when comparing prices across routes.

Image, speech, music

Model Price
image-01 $0.0035 / image
speech-2.8-turbo $60 / M characters
speech-2.8-hd $100 / M characters
music-3.0-free Free (RPM 3)
music-3.0 $0.15 / up-to-5-min track

Two things most ranking tutorials get wrong, corrected from the live page: creating a MiniMax API key is free — the cost starts when you make calls; and there is no blanket free tier for the API. The only free entries are the music free-tier models. New accounts sometimes receive trial credits, but the official pages do not promise a fixed amount, so do not budget around one.

The same key also works with the Token Plan, MiniMax’s subscription path. Plans are billed annually (Plus $200/year, Max $500/year, Ultra $1,200/year) and exchange the per-token meter for a shared monthly quota covering text, image, speech, and music, plus a daily video clip allowance on Max and Ultra. That is a different billing contract from pay-as-you-go — pick based on volume, not on which one sounds cheaper.

First API calls with your MiniMax API key

All endpoints live under https://api.minimax.io/v1. A chat completion with the OpenAI SDK:

1
2
3
4
5
6
7
8
9
10
11
12
from openai import OpenAI

client = OpenAI(
api_key="YOUR_MINIMAX_API_KEY",
base_url="https://api.minimax.io/v1",
)

resp = client.chat.completions.create(
model="MiniMax-M3",
messages=[{"role": "user", "content": "Explain rate limits in one sentence."}],
)
print(resp.choices[0].message.content)

The equivalent call with curl:

1
2
3
4
5
6
7
curl https://api.minimax.io/v1/chat/completions \
-H "Authorization: Bearer YOUR_MINIMAX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MiniMax-M3",
"messages": [{"role": "user", "content": "Hello!"}]
}'

Image generation uses a dedicated endpoint, documented separately:

1
2
3
4
5
6
7
8
9
curl https://api.minimax.io/v1/image_generation \
-H "Authorization: Bearer YOUR_MINIMAX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "image-01",
"prompt": "A glass cube on a dark surface, studio lighting",
"aspect_ratio": "16:9",
"response_format": "url"
}'

The response returns a URL (which expires after 24 hours — download the file if you need it longer) or base64 data if you pass "response_format": "base64". Video generation is asynchronous: you submit a task and poll for the result, so plan your pipeline around a task-id + polling pattern rather than a synchronous response.

Why your MiniMax API key isn’t working: error codes and fixes

MiniMax returns errors in the response body as base_resp.status_code. The official error code reference lists the full set; these are the ones that hit new integrations:

Code Message What to do
2049 invalid API Key The key string is malformed or mistyped. Regenerate and paste it clean — no trailing spaces or newlines.
1004 not authorized The key is wrong, revoked, or does not match the group/endpoint you are calling. Check you are using the right platform (international vs China).
1008 insufficient balance Your account balance is empty. Top up at Billing > Balance and retry.
1002 rate limit You are exceeding your tier’s requests per minute. Add exponential backoff or raise the tier.
1039 token limit The request exceeded the model’s token quota. Trim the prompt or lower max_tokens.

A 401-style failure before any request is sent usually means the key never made it into the right environment variable — confirm the Authorization: Bearer header actually contains the key you copied, and that the base URL matches the platform you registered on (api.minimax.io for international, api.minimaxi.com for China).

Which MiniMax key should you use: pay-as-you-go, Token Plan, or an aggregator

The key type and the route are separate decisions. Here is the honest way to make both:

  • Pay-as-you-go General API key — right for low or variable volume: prototypes, experiments, bursty production calls. You pay the per-token or per-task rate above, nothing more. This is the default choice for most integrations.
  • Token Plan subscription key (sk-cp) — right for sustained high-volume coding or agent workloads where a fixed annual bill is easier to budget than a token meter. The shared quota across text/image/speech/music is a real feature if you use several modalities.
  • Aggregator key — right when you need several model providers behind one integration. Modellix, for example, exposes MiniMax media models plus 200+ other image and video models through a single key and one bill, with pay-as-you-go billing and no subscription. One key covering MiniMax, Kling, Vidu, and Google routes is a workflow trade-off, not a price claim.

A directness note: Modellix is an aggregator and benefits commercially if you choose that route, so compare like for like. On the currently displayed rates, MiniMax’s own image-01 is $0.0035 per image while Modellix lists its matching minimax/minimax-image-01-t2i route at $0.0040 — the direct route is cheaper on that specific unit. Video is the reverse on some routes: Modellix lists Hailuo 2.3 T2V at $0.0386/sec (768P), below MiniMax’s own per-task Hailuo pricing — but the billing units differ (per second vs per task), so convert before comparing. The correct conclusion is not “aggregator cheaper” or “direct cheaper”; it is “match the model, resolution, and billing unit, then add the operational value of the integration path.”

For the full price comparison across MiniMax routes, see our MiniMax pricing breakdown. If you only need the free endpoints, the MiniMax free API guide separates what is actually free from what is not. To browse the exact MiniMax routes Modellix exposes today, use the MiniMax provider page.

FAQ

How do I get a MiniMax API key?
Register at platform.minimax.io (or platform.minimaxi.com for mainland China), open API Keys, click Create new secret key, copy it immediately, and store it in an environment variable. Creating the key is free; calls are billed against your balance.

Is there a free MiniMax API key?
Creating a key costs nothing, but the API itself is pay-as-you-go. The only free entries on the official pricing page are the music free-tier models. New-account trial credits are not guaranteed on the official pages — do not build a budget around them.

Is there a MiniMax API key generator?
No. MiniMax does not offer a key generator or bulk key tool; keys are created one at a time in the console. Any third-party site claiming to generate MiniMax API keys is not official and should not receive your credentials.

What is the MiniMax API URL?
The OpenAI-compatible base URL is https://api.minimax.io/v1 for international accounts and https://api.minimaxi.com/v1 for mainland-China accounts. The Anthropic-compatible endpoint is https://api.minimax.io/anthropic.

Can I use one MiniMax API key for image and video models?
Yes. The same secret key authenticates the LLM, image (image-01), video (H3, Hailuo), speech, and music endpoints under the same base URL.

Do MiniMax API keys expire?
The official error code reference treats revoked or invalid keys as the common failure mode (codes 1004 and 2049), but MiniMax does not publish a fixed expiry period for active secret keys. If a key stops working, check balance, platform, and key string in that order.


Prices and endpoints were read from the official MiniMax pages (platform.minimax.io/docs/guides/quickstart-preparation, /docs/guides/pricing-paygo, /docs/api-reference/errorcode, /subscribe/token-plan) and the Modellix MiniMax provider page on August 14, 2026. MiniMax and Modellix can change pricing, models, and terms without notice; this guide is a dated snapshot, not a quote. Modellix is an aggregator and has a commercial interest in the comparison above.

The cover and diagram are illustrative Modellix artwork. The pricing screenshot is captured from MiniMax’s official Pay-as-you-go page (August 14, 2026) and is source evidence; unit rates change, so check the live page before budgeting.