MiniMax API Key, Base URL, Regions, and Authentication

Last verified: July 18, 2026.

A MiniMax API key works only when the credential, service region, base URL, protocol, and route are configured together. International accounts use api.minimax.io; Mainland China accounts use api.minimaxi.com. MiniMax also issues two different credentials: a pay-as-you-go API Key and a Token Plan Subscription Key. They use similar authentication syntax, but they are not interchangeable.

There is no single MiniMax API URL for every account and protocol: the correct MiniMax API base URL depends on the platform region and whether the client uses OpenAI-compatible or Anthropic-compatible routing.

This guide gives you the base URLs verified on July 18, 2026, dashboard links, authentication headers, environment variables, model-listing endpoints, working Node.js, Python, and cURL examples, and a practical checklist for 401, 403, and 404 errors. For a broader integration overview, start with our MiniMax API guide.

Quick answer

SettingGlobal / InternationalMainland China
Developer platformhttps://platform.minimax.iohttps://platform.minimaxi.com
OpenAI-compatible base URLhttps://api.minimax.io/v1https://api.minimaxi.com/v1
Anthropic-compatible base URLhttps://api.minimax.io/anthropichttps://api.minimaxi.com/anthropic
OpenAI Chat Completionshttps://api.minimax.io/v1/chat/completionshttps://api.minimaxi.com/v1/chat/completions
Anthropic Messageshttps://api.minimax.io/anthropic/v1/messageshttps://api.minimaxi.com/anthropic/v1/messages
Recommended text protocolAnthropic-compatible for MiniMax’s advanced model features; OpenAI-compatible for existing OpenAI clients

Do not choose a region only by physical proximity. Use the service domain that matches the platform where the API service or Token Plan was purchased. A Global key sent to the Mainland China host—or the reverse—can fail authentication.

On this page

MiniMax API Key vs Token Plan Subscription Key

MiniMax currently provides two credential types. Both may be passed to an SDK’s api_key field, so code examples can make them look identical. Their billing resources and account behavior are different.

CredentialWhere it comes fromWhat it usesBest fit
Pay-as-you-go API KeyAccount / API KeysYour API Platform account balance, billed by actual usageProduction services, backend applications, and workloads that should continue without Token Plan quota windows
Token Plan Subscription KeyBilling / Token PlanAn assigned Token Plan seat and/or purchased CreditsIndividual, interactive development, coding agents, experiments, and covered multimodal usage

A Subscription Key is dedicated to a user within a specific Team. The key can exist before that user has an assigned Token Plan seat or access to Credits, but it has no usable paid resources until one of those resources becomes available. If the account has both included Token Plan quota and purchased Credits, eligible usage consumes the included quota first, then Credits can cover eligible overflow.

MiniMax’s integration documentation shows Subscription Keys with an sk-cp-… prefix and pay-as-you-go keys with an sk-api-… prefix. Treat the prefix as a useful clue, not as proof that the key has the correct region, Team, balance, or resource access.

For quota rules and suitability, see our MiniMax Token Plan guide. For pricing details, see MiniMax pricing.

Where to get a MiniMax API key

Global / International account

  1. Sign in at platform.minimax.io/login.
  2. For pay-as-you-go, open API Keys and create a new secret key.
  3. For Token Plan or purchased Credits, open Token Plan and copy your Subscription Key.
  4. If using pay-as-you-go, check or add funds in the balance and recharge area.

Mainland China account

  1. Sign in at platform.minimaxi.com/login.
  2. For pay-as-you-go, open API Keys.
  3. For Token Plan or Credits, open Token Plan.
  4. For account balance, use the Mainland China recharge area.

MiniMax’s documentation may still link to older /user-center/… dashboard URLs. Those links currently redirect to the newer /console/… paths above.

MiniMax base URLs and full API routes

A base URL is the value supplied to an SDK or integration. A full endpoint adds the operation path. Do not paste a full endpoint into an SDK field that expects only a base URL.

Protocol / operationBase URL or route pathGlobal full URL
OpenAI-compatible base/v1https://api.minimax.io/v1
Chat CompletionsPOST /v1/chat/completionshttps://api.minimax.io/v1/chat/completions
ResponsesPOST /v1/responseshttps://api.minimax.io/v1/responses
OpenAI model listGET /v1/modelshttps://api.minimax.io/v1/models
Anthropic-compatible base/anthropichttps://api.minimax.io/anthropic
MessagesPOST /anthropic/v1/messageshttps://api.minimax.io/anthropic/v1/messages
Count input tokensPOST /anthropic/v1/messages/count_tokenshttps://api.minimax.io/anthropic/v1/messages/count_tokens
Anthropic model listGET /anthropic/v1/modelshttps://api.minimax.io/anthropic/v1/models

For Mainland China, keep the route unchanged and replace api.minimax.io with api.minimaxi.com. Notice the extra final i in minimaxi.com.

Which protocol should you use?

  • Use Anthropic-compatible when building around Anthropic’s Messages format, interleaved thinking, or Anthropic-style agent tools. MiniMax labels this path as recommended.
  • Use OpenAI-compatible when your application already uses the OpenAI SDK, Chat Completions, Responses, or an OpenAI-format integration.
  • Do not start a new integration with the old native text endpoint POST /v1/text/chatcompletion_v2. MiniMax still documents it, but marks it deprecated.

See our dedicated MiniMax OpenAI-compatible API guide and MiniMax Anthropic-compatible API guide for protocol-specific request fields and responses.

Authentication headers

OpenAI-compatible routes, the Responses API, and MiniMax’s legacy native routes use HTTP Bearer authentication:

Authorization: Bearer YOUR_MINIMAX_KEY
Content-Type: application/json

Anthropic-compatible authentication is endpoint-specific:

EndpointDocumented authenticationImportant detail
POST /anthropic/v1/messagesAuthorization: Bearer KEY or x-api-key: KEYIf both are present, MiniMax says Authorization takes precedence.
GET /anthropic/v1/modelsX-Api-Key: KEYThe official model-list reference explicitly documents the API-key header.
Anthropic SDKapiKey / ANTHROPIC_API_KEYThe SDK handles the request header.
Claude CodeANTHROPIC_AUTH_TOKENThis is a tool-specific MiniMax configuration, not the general Anthropic SDK variable.

Using a Subscription Key does not change the header format. It changes which account resource is charged.

Environment variables

Export the key in your server environment instead of hard-coding it. These are the variable names shown in MiniMax’s official SDK guides.

Global / International

# OpenAI-compatible
export OPENAI_BASE_URL="https://api.minimax.io/v1"
export OPENAI_API_KEY="YOUR_MINIMAX_KEY"

# Anthropic-compatible
export ANTHROPIC_BASE_URL="https://api.minimax.io/anthropic"
export ANTHROPIC_API_KEY="YOUR_MINIMAX_KEY"

# MiniMax-specific integrations / AI SDK
export MINIMAX_API_KEY="YOUR_MINIMAX_KEY"

Mainland China

# OpenAI-compatible
export OPENAI_BASE_URL="https://api.minimaxi.com/v1"
export OPENAI_API_KEY="YOUR_MINIMAX_KEY"

# Anthropic-compatible
export ANTHROPIC_BASE_URL="https://api.minimaxi.com/anthropic"
export ANTHROPIC_API_KEY="YOUR_MINIMAX_KEY"

# MiniMax-specific integrations / AI SDK
export MINIMAX_API_KEY="YOUR_MINIMAX_KEY"

For Claude Code, MiniMax’s documented setup uses ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL. Existing shell variables can override values in ~/.claude/settings.json, so remove stale Anthropic variables before troubleshooting that tool.

Node.js examples

Node.js with the OpenAI-compatible API

npm install openai
import OpenAI from "openai";

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

const response = await client.chat.completions.create({
  model: "MiniMax-M3",
  messages: [
    { role: "system", content: "You are a helpful assistant." },
    { role: "user", content: "Explain API authentication in one sentence." },
  ],
});

console.log(response.choices[0].message.content);

Node.js with the Anthropic-compatible API

npm install @anthropic-ai/sdk
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  apiKey: process.env.ANTHROPIC_API_KEY,
  baseURL:
    process.env.ANTHROPIC_BASE_URL || "https://api.minimax.io/anthropic",
});

const message = await client.messages.create({
  model: "MiniMax-M3",
  max_tokens: 1000,
  messages: [
    { role: "user", content: "Explain API authentication in one sentence." },
  ],
});

for (const block of message.content) {
  if (block.type === "text") console.log(block.text);
}

For a Mainland China account, set the environment variable to the corresponding api.minimaxi.com base URL; the JavaScript code does not otherwise change.

Python examples

Python with the OpenAI-compatible API

pip install openai
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["OPENAI_API_KEY"],
    base_url=os.getenv("OPENAI_BASE_URL", "https://api.minimax.io/v1"),
)

response = client.chat.completions.create(
    model="MiniMax-M3",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain API authentication in one sentence."},
    ],
)

print(response.choices[0].message.content)

Python with the Anthropic-compatible API

pip install anthropic
import os
import anthropic

client = anthropic.Anthropic(
    api_key=os.environ["ANTHROPIC_API_KEY"],
    base_url=os.getenv(
        "ANTHROPIC_BASE_URL",
        "https://api.minimax.io/anthropic",
    ),
)

message = client.messages.create(
    model="MiniMax-M3",
    max_tokens=1000,
    messages=[
        {"role": "user", "content": "Explain API authentication in one sentence."}
    ],
)

for block in message.content:
    if block.type == "text":
        print(block.text)

cURL examples

OpenAI-compatible Chat Completions

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

Anthropic-compatible Messages

curl "https://api.minimax.io/anthropic/v1/messages" \
  -H "Authorization: Bearer ${ANTHROPIC_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMax-M3",
    "max_tokens": 1000,
    "messages": [
      {"role": "user", "content": "Hello from cURL"}
    ]
  }'

Send a simple text input with the Responses API

curl "https://api.minimax.io/v1/responses" \
  -H "Authorization: Bearer ${OPENAI_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "MiniMax-M3",
    "input": "Hello!"
  }'

The Responses API is the documented OpenAI-compatible option when you want to submit a simple text string. MiniMax’s older native /v1/text/chatcompletion_v2 endpoint also accepts chat-style text requests, but it is officially marked deprecated.

List available MiniMax models

Query the model-list endpoint in the same region and protocol you intend to use. This verifies the host and credential while returning model IDs in the expected wire format.

OpenAI-compatible model list

curl "https://api.minimax.io/v1/models" \
  -H "Authorization: Bearer ${OPENAI_API_KEY}"

Anthropic-compatible model list

curl "https://api.minimax.io/anthropic/v1/models" \
  -H "X-Api-Key: ${ANTHROPIC_API_KEY}"

The OpenAI endpoint returns an OpenAI-style object: "list" response. The Anthropic endpoint returns a data array plus pagination fields such as first_id, last_id, and has_more, and supports limit, after_id, and before_id.

Examples in the documentation may show only a subset of models. Treat the live response for your key and region as the operational source of truth, then use the exact returned model ID in your request.

Common base URL and authentication mistakes

  • Wrong region: using a Global key on api.minimaxi.com, or a Mainland China key on api.minimax.io.
  • Doubled version path: setting the SDK base URL to https://api.minimax.io/v1 and then manually asking the SDK for /v1/chat/completions, producing an incorrect /v1/v1/… route.
  • Protocol mixing: using the OpenAI base with /anthropic/v1/messages, or the Anthropic base with /v1/chat/completions.
  • Wrong Anthropic header: assuming the Messages and model-list endpoints document an identical header. Check the endpoint-specific table above.
  • Inactive Subscription Key: a Subscription Key can be visible before a Token Plan seat or Credits are available.
  • Stale shell configuration: an old OPENAI_BASE_URL, ANTHROPIC_BASE_URL, or ANTHROPIC_AUTH_TOKEN can override an application’s settings file.
  • Bare host in the wrong tool: some integrations, such as Xcode, expect only https://api.minimax.io and construct their own route. Standard OpenAI and Anthropic SDKs expect the protocol base URLs documented above.

Troubleshoot MiniMax 401, 403, and 404 errors

Check both the HTTP status and the MiniMax response body. MiniMax publishes business error codes such as 1004, 2049, and 2056; those can be more specific than the HTTP status alone.

HTTP statusWhat to checkRelevant MiniMax details
401 UnauthorizedMissing or malformed Bearer header; inactive or invalid key; Global/China mismatch; stale environment variableMiniMax documents 1004 for not authorized/token-group mismatch and 2049 for an invalid API Key. Its CLI guide specifically identifies a wrong global/cn region as a likely 401 cause.
403 ForbiddenWhether the key has access to the requested Team resource, subscription/Credits, model, voice, file, or other owned assetMiniMax does not publish a universal HTTP 403 mapping in its error table. Inspect the JSON body. Business code 2042, for example, means the caller does not have access to a requested voice_id.
404 Not FoundExact host and route; duplicated /v1; OpenAI/Anthropic path mix-up; incorrect model or resource IDMiniMax does not publish a dedicated universal HTTP 404 mapping. Compare the request with the route table and test the correct GET /models endpoint.

Other authentication and quota-related MiniMax codes

CodeMeaning in MiniMax’s official referenceFirst action
1002Rate limitRetry later and reduce request rate or concurrency.
1004Not authorized / token does not match groupCheck key, Team, activity status, and service region.
1008Insufficient balanceCheck pay-as-you-go balance or the resource attached to the credential.
2049Invalid API KeyReplace the key with an active credential from the matching regional console.
2056Usage limit exceededWait for the next five-hour Token Plan window, use eligible Credits, upgrade, or switch to pay-as-you-go.

For a fuller diagnostic table, see our MiniMax API error codes guide.

MiniMax API key security and rotation

A MiniMax API key is a server credential. MiniMax explicitly warns users not to share it or expose it in browser or other client-side code, and says it may automatically disable a key that leaks publicly.

  • Keep the key in server-side environment variables or a secrets manager.
  • Do not commit .env files, configuration files containing secrets, or copied terminal output to Git.
  • Never embed the key in JavaScript delivered to a visitor’s browser, a public mobile bundle, a screenshot, a support ticket, or a shared prompt.
  • Use separate pay-as-you-go keys for separate server environments when the console and your operating model allow it.
  • Monitor balance, Token Plan usage, and unexpected errors after deployments.

MiniMax’s public documentation does not specify a mandatory 30-, 60-, or 90-day rotation schedule, a public key-rotation API, or a documented Subscription Key rotation procedure. Do not invent a MiniMax-specific deadline. For a pay-as-you-go key, a safe operational sequence is to create a replacement in the console, deploy it to the server, verify requests, and then revoke or delete the old key if that control is available. If a Subscription Key needs replacement, use the Token Plan console or contact MiniMax support because its public rotation workflow is not documented.

See our broader MiniMax security guidance for safe account and integration practices.

Frequently asked questions

What is the MiniMax API base URL?

For Global accounts, use https://api.minimax.io/v1 with OpenAI-compatible clients or https://api.minimax.io/anthropic with Anthropic-compatible clients. Mainland China uses the corresponding api.minimaxi.com host.

Where do I get a MiniMax API key?

Create a pay-as-you-go key under Account / API Keys. To use a Token Plan subscription or purchased Credits, copy the separate Subscription Key from Billing / Token Plan. Use the Global or Mainland China console that matches your account.

Is a Token Plan Subscription Key the same as an API Key?

No. SDKs may accept either in an api_key field, but MiniMax says a Subscription Key and a standard pay-as-you-go API Key are not interchangeable. They draw from different account resources.

Can one MiniMax key use both Global and Mainland China endpoints?

Do not assume so. MiniMax says the service region follows the platform where the API service was purchased. Match Global keys to minimax.io and Mainland China keys to minimaxi.com.

What Authorization header does MiniMax use?

OpenAI-compatible routes use Authorization: Bearer YOUR_KEY. Anthropic Messages supports Bearer authentication and x-api-key, with Authorization taking precedence if both are sent. The Anthropic-compatible model-list endpoint explicitly documents X-Api-Key.

Why does my MiniMax key return 401?

First check that the key and API host use the same Global or Mainland China region. Then verify the header, remove stale environment variables, confirm the key is active, and make sure a Subscription Key has an assigned Token Plan seat or Credits. Inspect the response for MiniMax code 1004 or 2049.

Does MiniMax support the OpenAI SDK?

Yes. Set the OpenAI SDK base URL to the MiniMax OpenAI-compatible base, provide your MiniMax credential, and use a supported MiniMax model ID. MiniMax supports both Chat Completions and the Responses API.

Does MiniMax support the Anthropic SDK?

Yes. Set ANTHROPIC_BASE_URL to the MiniMax Anthropic-compatible base and ANTHROPIC_API_KEY to your MiniMax credential. MiniMax currently recommends the Anthropic-compatible path for its advanced model features.

How do I list models available to my MiniMax key?

Call GET /v1/models with Bearer authentication for the OpenAI-compatible format, or GET /anthropic/v1/models with X-Api-Key for the Anthropic-compatible format. Use the same regional host as the key.

Does MiniMax have a raw text API?

The OpenAI-compatible Responses endpoint accepts a simple string in input. MiniMax also documents the native /v1/text/chatcompletion_v2 endpoint, but marks it deprecated, so new integrations should use the documented OpenAI- or Anthropic-compatible routes.

Can I put a MiniMax API key in frontend JavaScript?

No. MiniMax explicitly says not to expose a key in browser or other client-side code. Send requests through a protected server endpoint and keep the credential in a server-side environment variable or secrets manager.

Should I use Token Plan in production?

MiniMax describes Token Plan as intended for individual, interactive developer use and recommends pay-as-you-go for production. Token Plan has rate limits plus five-hour rolling and weekly quota windows.

Official MiniMax sources

MiniMax can change model availability, dashboard paths, quotas, and API behavior. Verify the live model list and official documentation before a production deployment.