# MiniMax API Key: Integration Guide, Pricing & Code

Updated: 2026-09-24

How to get a MiniMax API key, what it costs, and how to make your first API call. Covers key types, pay-as-you-go pricing, code samples, and error codes.

![Modellix Team](<https://img.modellix.ai/en/article/modellix-blog-author-official-2x.webp>)

**Modellix Team**Official

Published 2026-08-14

Updated 2026-09-24

9 min read

### On this page

On this page

**Summary**

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.

![MiniMax API key integration cover: an amber key unlocking glass and chrome model panels for text, image, and video generation](<https://img.modellix.ai/en/article/cover-minimax-api-key.png>)  

## 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](<https://platform.minimax.io/docs/guides/quickstart-preparation>) condenses it to three steps:

1. **Register or log in** at [platform.minimax.io](<https://platform.minimax.io/>). International accounts use this domain; mainland-China accounts use a separate platform, historically [platform.minimaxi.com](<https://platform.minimaxi.com/>), which MiniMax's docs say is migrating to `platform.minimax.cn`. 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](<https://platform.minimax.io/docs/guides/models-intro>) 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 (closed to new users since August 20, 2026) | 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](<https://platform.minimax.io/docs/api-reference/text-chat-openai>); most OpenAI SDK code works after swapping the base URL and key. MiniMax also offers an [Anthropic-compatible endpoint](<https://platform.minimax.io/docs/api-reference/text-anthropic-api>) at `https://api.minimax.io/anthropic` for tools built around the Messages format, and publishes [SDK quick starts](<https://platform.minimax.io/docs/guides/quickstart-sdk>) for the OpenAI SDK, the Anthropic SDK, and the AI SDK. Text models use these compatible endpoints, while image, video, and speech use MiniMax's own REST endpoints under the same key. One correction to copy: some AI-generated summaries cite `www.minimax.io/v1` as the base URL; the API host is `api.minimax.io`.

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](<https://img.modellix.ai/en/article/minimax-media-models.png>)  

*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](<https://platform.minimax.io/docs/guides/pricing-paygo>) 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](<https://img.modellix.ai/en/article/minimax-paygo-pricing.png>)  

*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 |
| MiniMax-H3 Max (added by September 2026) | 480P / 768P, per second | $0.05 / $0.08 per sec |

By September 2026 MiniMax had moved the Hailuo models into its legacy section, with H3 as the current line; H3 Max is a faster variant for text-to-video and image-to-video. 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, so 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 | Discontinued August 20, 2026 |
| music-3.0 | $0.15 / up-to-5-min track (existing paying customers only since August 20, 2026) |
| Speech recognition | $0.38 / audio hour |
| Voice design / rapid voice cloning | $3 / $1.50 per voice |

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 music free-tier models used to be the only free entries, but MiniMax discontinued them on August 20, 2026, when it also closed paid Music and Lyrics Generation to new users (it now points new users to MiniMax Audio or the open-source MiniMax Music 3 model on Hugging Face). New accounts sometimes receive trial credits, but the official pages do not promise a fixed amount, so do not budget around one.

The [Token Plan](<https://platform.minimax.io/subscribe/token-plan>) is MiniMax's subscription path, and it uses its own Subscription Key (`sk-cp`), not your pay-as-you-go key. It exchanges the per-token meter for a shared monthly quota; in August 2026 the plans were listed as annual (Plus $200/year, Max $500/year, Ultra $1,200/year), and by September 8, 2026 the [Token Plan pricing page](<https://platform.minimax.io/docs/guides/pricing-token-plan>) listed monthly tiers (Plus $22, Max $55, Ultra $132), so check the live page before you buy. Two details matter for budgeting: special models (MiniMax-H3, voice design, and rapid voice cloning) are pay-as-you-go only and not covered by the plan, and MiniMax also sells prepaid Credits (1,000 credits = $1) that are spent through the same Subscription Key. Pick between the plan and pay-as-you-go 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:

python

```
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:

bash

```
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](<https://platform.minimax.io/docs/api-reference/image-generation-t2i>):

bash

```
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](<https://platform.minimax.io/docs/api-reference/errorcode>) 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 plan bill is easier to budget than a token meter. The shared quota across text, image, and speech is a real feature if you use several modalities (H3 video and voice cloning still bill pay-as-you-go).
- **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, so 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](<https://www.modellix.ai/blog/minimax-pricing.md>). If you only need the free endpoints, the [MiniMax free API guide](<https://www.modellix.ai/blog/minimax-pricing.md>) separates what is actually free from what is not. To browse the exact MiniMax routes Modellix exposes today, use the [MiniMax provider page](<https://www.modellix.ai/providers/minimax.md>).

## FAQ

**How do I get a MiniMax API key?** Register at [platform.minimax.io](<http://platform.minimax.io/>) (or [platform.minimaxi.com](<http://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 music free-tier models, formerly the only free entries, were discontinued on August 20, 2026. New-account trial credits are not guaranteed on the official pages, so 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.

![Modellix Team](<https://img.modellix.ai/en/article/modellix-blog-author-official-2x.webp>)

Written by**Modellix Team**Official

## Build with the latest AI models

Explore image, video and audio models through one API.

[Start building](<https://www.modellix.ai/console/login>)

**Share**

[Back to top](<https://www.modellix.ai/blog/minimax-api-key#blog-article-top>)

## Related articles

[![Wan 2.2 API: Alibaba Video Models on a Unified Key](<https://img.modellix.ai/en/article/cover-wan-2-2-api.webp>)](<https://www.modellix.ai/blog/wan-2-2-api.md>)

[API Integration](<https://www.modellix.ai/blog/categories/Guides/API-Integration>)

2026-08-07

### Wan 2.2 API: Alibaba Video Models on a Unified Key

Wan 2.2 API explained with live 2026 pricing: which model ID to call, t2v vs i2v routes, per-second costs, the async task lifecycle, and one key for the family.

Modellix Team13 min read

[![Qwen Image API: Integration Guide, Pricing & Code](<https://img.modellix.ai/en/article/cover-qwen-image-api.webp>)](<https://www.modellix.ai/blog/qwen-image-api.md>)

[API Integration](<https://www.modellix.ai/blog/categories/Guides/API-Integration>)

2026-08-23

### Qwen Image API: Integration Guide, Pricing & Code

Qwen image API pricing, lineup, and code: compare official Model Studio rates with Modellix, run a Qwen-Image 3.0 call, and dodge the common pitfalls.

Modellix Team10 min read

[![Image Upscale API: Integration Guide, Pricing & Code](<https://img.modellix.ai/en/article/cover-image-upscale-api.webp>)](<https://www.modellix.ai/blog/image-upscale-api.md>)

[API Integration](<https://www.modellix.ai/blog/categories/Guides/API-Integration>)

2026-08-23

### Image Upscale API: Integration Guide, Pricing & Code

Compare image upscale APIs by real per-image cost, input limits, and output resolution, with working code for Clipdrop sync and Modellix async routes.

Modellix Team12 min read

[![Kling Motion Control API: Integration Guide, Pricing & Code](<https://img.modellix.ai/en/article/cover-kling-motion-control-api.webp>)](<https://www.modellix.ai/blog/kling-motion-control-api.md>)

[API Integration](<https://www.modellix.ai/blog/categories/Guides/API-Integration>)

2026-08-20

### Kling Motion Control API: Integration Guide, Pricing & Code

How to call the Kling motion control API: version support (2.6 vs 3.0), the real per-second pricing on August 20 2026, and working curl and Python code.

Modellix Team11 min read
