MiniMax M3
Text Generation • MiniMax
minimax/m3
- Third-party
- Zero data retention
MiniMax's M3 language model with frontier coding and agentic capabilities, a 1M token context window, and multilingual support.
| Model Info | |
|---|---|
| Context Window ↗ | 1,000,000 tokens |
| Terms and License | link ↗ |
| More information | link ↗ |
| Zero data retention | Yes |
| Request formats | Chat Completions, Anthropic Messages |
| Pricing | <ul><li>Input <=512k (per 1M)$0.30</li><li>Cached input <=512k (per 1M)$0.06</li><li>Output <=512k (per 1M)$1.20</li><li>Input >512k (per 1M)$1.20</li><li>Cached input >512k (per 1M)$0.24</li><li>Output >512k (per 1M)$4.80</li></ul> |
Usage
const response = await env.AI.run(
'minimax/m3',
{ max_tokens: 2048, messages: [{ content: 'What is the capital of France?', role: 'user' }] },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "minimax/m3",
"max_tokens": 2048,
"messages": [
{
"content": "What is the capital of France?",
"role": "user"
}
]
}'
The capital of France is **Paris**.
{
"id": "066cf8a95614a7ebfcaa6ffd7f2cd663",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The capital of France is **Paris**.",
"name": "MiniMax AI",
"audio_content": "",
"reasoning_content": "The user is asking a simple factual question: \"What is the capital of France?\" This is straightforward - the capital of France is Paris.",
"reasoning_details": [
{
"type": "reasoning.text",
"id": "reasoning-text-1",
"format": "MiniMax-response-v1",
"index": 0,
"text": "The user is asking a simple factual question: \"What is the capital of France?\" This is straightforward - the capital of France is Paris."
}
]
},
"finish_reason": "stop"
}
],
"created": 1780336041,
"model": "MiniMax-M3",
"object": "chat.completion",
"usage": {
"total_tokens": 221,
"prompt_tokens": 183,
"completion_tokens": 38,
"total_characters": 0,
"prompt_tokens_details": {
"cached_tokens": 114
}
},
"input_sensitive": false,
"output_sensitive": false,
"base_resp": {
"status_code": 0,
"status_msg": ""
},
"input_sensitive_type": 0,
"output_sensitive_type": 0,
"output_sensitive_int": 0,
"gatewayMetadata": {
"keySource": "Unified"
}
}
Examples
<details>
<summary>With System Prompt — Using a system prompt to guide behavior</summary>
const response = await env.AI.run(
'minimax/m3',
{
max_tokens: 2048,
messages: [
{
content:
'You are a helpful cooking assistant. Give concise recipes with metric measurements.',
role: 'system',
},
{ content: 'How do I make a simple pasta aglio e olio?', role: 'user' },
],
temperature: 0.7,
},
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "minimax/m3",
"max_tokens": 2048,
"messages": [
{
"content": "You are a helpful cooking assistant. Give concise recipes with metric measurements.",
"role": "system"
},
{
"content": "How do I make a simple pasta aglio e olio?",
"role": "user"
}
],
"temperature": 0.7
}'
# Pasta Aglio e Olio
A classic Italian dish that comes together in minutes with just a few ingredients.
**Serves:** 2 | **Prep:** 5 min | **Cook:** 15 min
## Ingredients
- 200 g spaghetti or linguine
- 80 ml extra virgin olive oil
- 4 garlic cloves, thinly sliced
- 1–2 small dried red chilies, crushed (or ¼ tsp chili flakes)
- Salt, for pasta water
- 15 g fresh flat-leaf parsley, chopped
- Grated Parmesan or Pecorino (optional, traditionalists skip it)
## Method
1. **Boil pasta:** Bring a large pot of well-salted water to a rolling boil. Cook the pasta until al dente (about 1 minute less than package instructions). Reserve 1 cup of pasta water before draining.
2. **Infuse oil:** While the pasta cooks, gently heat the olive oil in a wide pan over low-medium heat. Add the garlic and chilies, and cook slowly for 2–3 minutes until the garlic turns pale golden. **Don't let it brown** — it will turn bitter.
3. **Combine:** Add the drained pasta to the pan with a splash of reserved pasta water. Toss vigorously over medium heat for about 1 minute so the pasta absorbs the oil.
4. **Finish:** Add more pasta water as needed to create a light, silky sauce that coats the noodles. Stir in the parsley and season with salt.
5. **Serve** immediately, topped with cheese if using.
## Tips
- Cold olive oil + slow heat = better flavor extraction.
- The starch in the pasta water is key to a glossy, emulsified sauce.
Buon appetito! 🍝
{
"id": "066cf8abfaba58c357c660ebfad38073",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "# Pasta Aglio e Olio\n\nA classic Italian dish that comes together in minutes with just a few ingredients.\n\n**Serves:** 2 | **Prep:** 5 min | **Cook:** 15 min\n\n## Ingredients\n- 200 g spaghetti or linguine\n- 80 ml extra virgin olive oil\n- 4 garlic cloves, thinly sliced\n- 1–2 small dried red chilies, crushed (or ¼ tsp chili flakes)\n- Salt, for pasta water\n- 15 g fresh flat-leaf parsley, chopped\n- Grated Parmesan or Pecorino (optional, traditionalists skip it)\n\n## Method\n1. **Boil pasta:** Bring a large pot of well-salted water to a rolling boil. Cook the pasta until al dente (about 1 minute less than package instructions). Reserve 1 cup of pasta water before draining.\n2. **Infuse oil:** While the pasta cooks, gently heat the olive oil in a wide pan over low-medium heat. Add the garlic and chilies, and cook slowly for 2–3 minutes until the garlic turns pale golden. **Don't let it brown** — it will turn bitter.\n3. **Combine:** Add the drained pasta to the pan with a splash of reserved pasta water. Toss vigorously over medium heat for about 1 minute so the pasta absorbs the oil.\n4. **Finish:** Add more pasta water as needed to create a light, silky sauce that coats the noodles. Stir in the parsley and season with salt.\n5. **Serve** immediately, topped with cheese if using.\n\n## Tips\n- Cold olive oil + slow heat = better flavor extraction.\n- The starch in the pasta water is key to a glossy, emulsified sauce.\n\nBuon appetito! 🍝",
"name": "MiniMax AI",
"audio_content": "",
"reasoning_content": "The user is asking for a simple pasta aglio e olio recipe. The system prompt says I should give concise recipes with metric measurements. Let me provide a classic, simple recipe.",
"reasoning_details": [
{
"type": "reasoning.text",
"id": "reasoning-text-1",
"format": "MiniMax-response-v1",
"index": 0,
"text": "The user is asking for a simple pasta aglio e olio recipe. The system prompt says I should give concise recipes with metric measurements. Let me provide a classic, simple recipe."
}
]
},
"finish_reason": "stop"
}
],
"created": 1780336043,
"model": "MiniMax-M3",
"object": "chat.completion",
"usage": {
"total_tokens": 595,
"prompt_tokens": 197,
"completion_tokens": 398,
"total_characters": 0,
"prompt_tokens_details": {
"cached_tokens": 114
}
},
"input_sensitive": false,
"output_sensitive": false,
"base_resp": {
"status_code": 0,
"status_msg": ""
},
"input_sensitive_type": 0,
"output_sensitive_type": 0,
"output_sensitive_int": 0,
"gatewayMetadata": {
"keySource": "Unified"
}
}
</details>
<details>
<summary>Multi-turn Conversation — Continuing a conversation with context</summary>
const response = await env.AI.run(
'minimax/m3',
{
max_tokens: 2048,
messages: [
{ content: 'What are the main differences between TCP and UDP?', role: 'user' },
{
content:
'TCP is connection-oriented and guarantees delivery, while UDP is connectionless and faster but without delivery guarantees.',
role: 'assistant',
},
{ content: 'When would I choose UDP over TCP?', role: 'user' },
],
temperature: 0.5,
},
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/v1/chat/completions \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "minimax/m3",
"max_tokens": 2048,
"messages": [
{
"content": "What are the main differences between TCP and UDP?",
"role": "user"
},
{
"content": "TCP is connection-oriented and guarantees delivery, while UDP is connectionless and faster but without delivery guarantees.",
"role": "assistant"
},
{
"content": "When would I choose UDP over TCP?",
"role": "user"
}
],
"temperature": 0.5
}'
Use UDP for time-sensitive applications like video streaming, online gaming, or VoIP where speed matters more than perfect reliability.
{
"id": "066cf8bb1c666fc68c6810518100c7ba",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Use UDP for time-sensitive applications like video streaming, online gaming, or VoIP where speed matters more than perfect reliability.",
"name": "MiniMax AI",
"audio_content": "",
"reasoning_content": ""
},
"finish_reason": "stop"
}
],
"created": 1780336059,
"model": "MiniMax-M3",
"object": "chat.completion",
"usage": {
"total_tokens": 250,
"prompt_tokens": 225,
"completion_tokens": 25,
"total_characters": 0,
"prompt_tokens_details": {
"cached_tokens": 114
}
},
"input_sensitive": false,
"output_sensitive": false,
"base_resp": {
"status_code": 0,
"status_msg": ""
},
"input_sensitive_type": 0,
"output_sensitive_type": 0,
"output_sensitive_int": 0,
"gatewayMetadata": {
"keySource": "Unified"
}
}
