DEV Community

Cover image for Getting a MiniMax API Key Has One Gotcha Nobody Mentions: There Are Two Kinds of Keys
Luckyzhou
Luckyzhou

Posted on

Getting a MiniMax API Key Has One Gotcha Nobody Mentions: There Are Two Kinds of Keys

My first MiniMax API call failed with an authentication error, and I spent longer than I'd like to admit assuming I'd copy-pasted the key wrong. I hadn't. The actual issue was that MiniMax issues two structurally different kinds of API keys depending on how you're planning to pay, and I'd generated the wrong one for what I was trying to do. That distinction isn't obvious from the signup flow, and it's the actual thing worth knowing before you generate your first key — everything else about getting started is fairly standard.

Signing up: mostly standard, one regional fork

Head to MiniMax's developer platform and click Console in the top right to reach signup — email account creation, land on a dashboard, nothing unusual. The one fork worth knowing about upfront: MiniMax splits its platform by region. International accounts use platform.minimax.io and the api.minimax.io base URL; accounts registered in China use a separate minimaxi.com domain and a correspondingly different base URL. If you're following a guide or a teammate's setup and your calls are failing for no visible reason, checking that you're both on the same regional platform is worth doing early.

The two key types, and why it matters which one you generate

This is the part that actually caused my auth error. MiniMax's console offers two distinct ways to get a key:

  • Pay-as-you-go: under API Keys, "Create new secret key." This is a standard metered key — it draws down a balance you top up, billed per token across whatever models and modalities you call (text, image, video, speech).
  • Token Plan Subscription Key: found under Billing → Token Plan, tied to a subscription seat or a purchased credit bundle rather than pay-per-call billing. Notably, this key can exist before you've actually activated paid resources on it — it becomes usable once you have a Token Plan seat or credits assigned, not the moment you generate it.

If you generate a Token Plan subscription key expecting it to behave like a pay-as-you-go key — or the reverse — you'll get exactly the confusing "this should work but doesn't" experience I had. The practical rule: if you're building an agent, an automation, or anything calling the API programmatically outside MiniMax's own tools, you almost certainly want the pay-as-you-go secret key, not the Token Plan key. The Token Plan / Coding Plan side of the platform is structured more around fixed prompt quotas within a rolling time window, aimed at consistent day-to-day tool usage rather than metered programmatic calls.

Whichever key you generate, copy it immediately — MiniMax won't show the full value again — into a password manager, .env file, or your platform's secrets manager, never a committed file.

Two structurally different API key types tied to two different billing models

Two API-compatible interfaces, and MiniMax recommends the less obvious one

Once you have a pay-as-you-go key, there's a second choice worth knowing about before you copy the first code snippet you find: MiniMax exposes both an OpenAI-compatible endpoint and an Anthropic-compatible one, and the platform's own quickstart documentation lists the Anthropic-compatible interface as the recommended option, with OpenAI-compatible as the secondary listed alternative. That's a bit counter to the pattern you'll see with most other providers in this space, where OpenAI-compatible is usually the default path documented first.

Both work. Pick based on what you're already integrating with rather than assuming OpenAI-compatible is automatically the "main" one here:

# Anthropic-compatible — MiniMax's own documentation lists this as recommended
export ANTHROPIC_BASE_URL=https://api.minimax.io/anthropic
export ANTHROPIC_API_KEY=your_key_here
Enter fullscreen mode Exit fullscreen mode
# OpenAI-compatible — also fully supported, listed as the alternative
export OPENAI_BASE_URL=https://api.minimax.io/v1
export OPENAI_API_KEY=your_key_here
Enter fullscreen mode Exit fullscreen mode

A minimal first call using the OpenAI-compatible path, since it's the one most existing tooling defaults to:

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.minimax.io/v1",
  apiKey: process.env.MINIMAX_API_KEY,
});

const completion = await client.chat.completions.create({
  model: "minimax-m3",
  messages: [{ role: "user", content: "Hello, world!" }],
});

console.log(completion.choices[0].message.content);
Enter fullscreen mode Exit fullscreen mode

If that returns an auth error and you've confirmed the key is correct and freshly copied, the two things to check next are: pay-as-you-go vs. Token Plan key mismatch from the section above, and whether your account balance actually has funds — a valid key on an empty balance fails the same way a wrong key does, which is worth ruling out before assuming the key itself is broken.

Rate limits: two dimensions, not one

MiniMax's rate limiting runs on two separate axes: RPM (requests per minute) and TPM (tokens per minute, input and output combined). On a free or starter-tier account, the RPM ceiling sits around 20 requests per minute, which is easy to hit if you're running a test loop with rapid-fire calls rather than pacing them. If you're about to run an automated test suite or a batch job, it's worth deliberately spacing requests or checking your current tier's limits first, rather than finding out mid-run.

This is a structurally different mechanism than what you'll find on some other providers — it's worth not assuming rate-limit behavior transfers directly from a different platform's docs you might already be familiar with.

Model names move fast here too

Worth flagging the same way it's worth flagging for any actively developed model lineup: integration guides and third-party docs for MiniMax reference a range of model names — M2, M2.1, M2.5, M2.7, and the current M3 — depending on when they were written, and third-party tool integrations sometimes lag behind MiniMax's own current lineup by a model generation or two. Before hardcoding a model string into production code, it's worth checking MiniMax's own current model list rather than copying a string from a guide (including this one) without confirming it's still current.

If you'd rather not manage the region split and key types yourself

Everything above is manageable, but it is genuinely more moving parts than some other providers' signup flows — a regional platform split, two key types tied to different billing models, and two API-compatible interfaces with a slightly unusual recommended default. If you're already routing calls to other model providers through a single gateway and would rather not stand up a separate MiniMax account with its own region choice and key management, gateways like RouteAI list MiniMax's models alongside DeepSeek, Qwen, Kimi, and GLM behind one key and one standard OpenAI-compatible interface — worth knowing about if the actual friction point for you is account and key sprawl rather than needing MiniMax's account-specific features directly.

The checklist version

Sign up at the correct regional platform for your account. Generate a pay-as-you-go secret key if you're building an automation or agent, not a Token Plan subscription key. Pick OpenAI- or Anthropic-compatible based on what you're already integrating with, keeping in mind MiniMax's own docs lead with the Anthropic-compatible option. Confirm your account balance is actually funded before assuming an auth error means a bad key. And check the current model list before hardcoding a model string, since this lineup iterates fast enough that guides go stale within months.

TL;DR: Getting a MiniMax API key involves one gotcha most quickstart guides skip past: MiniMax issues two structurally different key types — pay-as-you-go secret keys and Token Plan subscription keys — and generating the wrong one for your use case produces a confusing auth failure that has nothing to do with a typo. Building an agent or automation almost always means you want the pay-as-you-go key.

Website: https://www.fastrouteai.com

Top comments (0)