Start with the official MiniMax API docs
The MiniMax API Overview is the official starting point. For a direct language-model request, use the OpenAI-compatible Chat Completions reference or MiniMax’s OpenAI SDK guide. The docs also offer an Anthropic-compatible route; MiniMax’s model-invocation guide recommends that route, while documenting OpenAI-compatible calls too. Choose the reference that matches the API format and SDK you intend to use. (platform.minimax.io)
Make a direct MiniMax model request
The official OpenAI-compatible reference shows POST https://api.minimax.io/v1/chat/completions, Bearer authentication, and a JSON request containing a model and messages. Its documented model list includes MiniMax-M3.1-Flash and MiniMax-M3. Here is a minimal non-streaming cURL request using the documented endpoint and request format: (platform.minimax.io)
export MINIMAX_API_KEY="your_key_here"
curl --request POST \
--url https://api.minimax.io/v1/chat/completions \
--header "Authorization: Bearer $MINIMAX_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "MiniMax-M3.1-Flash",
"messages": [
{"role": "user", "content": "Hi, how are you?"}
],
"max_completion_tokens": 512
}'
Replace the placeholder with a credential from your MiniMax Open Platform account. The API overview distinguishes pay-as-you-go API keys, created under API Keys, from an M Plan Subscription Key, found under Billing > M Plan. It says these are separate credentials; use the credential applicable to your plan. Keep it on your server or in an environment variable, not in browser-side code or a public repository. (platform.minimax.io)
A successful response follows the Chat Completions format. The official example includes choices; read the assistant text from choices[0].message.content. Also inspect choices[0].finish_reason and the response’s usage fields rather than assuming every answer completed normally. MiniMax’s reference demonstrates a successful example, but it does not by itself establish a complete error-handling or retry policy. (platform.minimax.io)
Use an SDK instead
The official OpenAI SDK guide shows setting OPENAI_BASE_URL=https://api.minimax.io/v1 and OPENAI_API_KEY to your credential, then calling client.chat.completions.create with the model and messages. MiniMax also documents an Anthropic SDK option with base URL https://api.minimax.io/anthropic. Follow the guide for the SDK you choose; do not mix one SDK’s endpoint or request format with another API family’s instructions. (platform.minimax.io)
Production checks: confirm what applies to your API
- Model and context: MiniMax’s API overview lists M3.1-Flash and M3 with a 1,000,000-token context window, and clarifies that the maximum token count refers to input and output combined. Confirm the model you select and its current limits in the model reference. (
platform.minimax.io) - Streaming: The Chat Completions reference says the endpoint supports both streaming and non-streaming. The example above is a regular JSON request; if you enable streaming, implement the streaming response path rather than treating it as a single completed JSON response. (
platform.minimax.io) - Limits and failure handling: The captured model references do not establish a general rate limit, retry guarantee, or complete error-handling policy. Find those details in the current documentation for your selected API, and implement retries only for failure cases that the relevant guidance supports. (
platform.minimax.io)
Don’t confuse API references with tutorials or other operations
The Video Download reference documents a separate file-retrieval operation: GET /v1/files/retrieve, Bearer authentication, and a required file_id query parameter. It is useful for retrieving files, not for making a text-model chat request. The page’s displayed request snippets omit the required file_id, so follow its parameter specification and check the current reference when implementing that operation. (platform.minimax.io)
The OpenClaw tutorial covers connecting MiniMax M3 to Telegram through OpenClaw. Its OAuth setup is specific to that integration, not a general direct-API authentication guide. Likewise, third-party gateway examples may use their own URL and key: do not substitute those for MiniMax’s official endpoint or credentials. (platform.minimax.io)
Sources
API Overview - MiniMax API Docs
Create Chat Completion - MiniMax API Docs
Create Message - MiniMax API Docs
