---
title: MiniMax M3
description: MiniMax's M3 language model with frontier coding and agentic capabilities, a 1M token context window, and multilingual support.
image: https://developers.cloudflare.com/dev-products-preview.png
---

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/ai/llms.txt  
> Use this file to discover all available pages before exploring further.

[Skip to content](#%5Ftop) 

![MiniMax logo](https://developers.cloudflare.com/_astro/minimax.DPZX-zZI.svg) 

#  MiniMax M3 

Text Generation • MiniMax • Proxied 

`minimax/m3` 

MiniMax's M3 language model with frontier coding and agentic capabilities, a 1M token context window, and multilingual support.

| Model Info                                                                 |                                                                                                              |
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Context Window[ ↗](https://developers.cloudflare.com/workers-ai/glossary/) | 1,000,000 tokens                                                                                             |
| Terms and License                                                          | [link ↗](https://www.minimaxi.com/terms)                                                                     |
| More information                                                           | [link ↗](https://www.minimax.io/blog/minimax-m3)                                                             |
| Pricing                                                                    | [View pricing in the Cloudflare dashboard ↗](https://dash.cloudflare.com/?to=/:account/ai/models/minimax/m3) |

## Usage

* [ TypeScript ](#tab-panel-804)
* [ cURL ](#tab-panel-805)

TypeScript

```

const response = await env.AI.run(

  'minimax/m3',

  { max_tokens: 2048, messages: [{ content: 'What is the capital of France?', role: 'user' }] },

)

console.log(response)


```

Terminal window

```

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"

    }

  ]

}'


```

* [ Output ](#tab-panel-814)
* [ Raw response ](#tab-panel-815)

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

**With System Prompt**  — Using a system prompt to guide behavior 

* [ TypeScript ](#tab-panel-806)
* [ cURL ](#tab-panel-807)

TypeScript

```

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)


```

Terminal window

```

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

}'


```

* [ Output ](#tab-panel-816)
* [ Raw response ](#tab-panel-817)

# 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"

  }

}


```

**Multi-turn Conversation**  — Continuing a conversation with context 

* [ TypeScript ](#tab-panel-810)
* [ cURL ](#tab-panel-811)

TypeScript

```

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)


```

Terminal window

```

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

}'


```

* [ Output ](#tab-panel-812)
* [ Raw response ](#tab-panel-813)

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"

  }

}


```

**Creative Writing**  — Higher temperature for creative output 

* [ TypeScript ](#tab-panel-808)
* [ cURL ](#tab-panel-809)

TypeScript

```

const response = await env.AI.run(

  'minimax/m3',

  {

    max_tokens: 2048,

    messages: [{ content: 'Write a haiku about programming.', role: 'user' }],

    temperature: 0.9,

  },

)

console.log(response)


```

Terminal window

```

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": "Write a haiku about programming.",

      "role": "user"

    }

  ],

  "temperature": 0.9

}'


```

* [ Output ](#tab-panel-818)
* [ Raw response ](#tab-panel-819)

Fingers on the keys,
Building worlds from empty void—
Code becomes the light.

```

{

  "id": "066cf8be5675980f2ff647974879fb77",

  "choices": [

    {

      "index": 0,

      "message": {

        "role": "assistant",

        "content": "Fingers on the keys,\nBuilding worlds from empty void—\nCode becomes the light.",

        "name": "MiniMax AI",

        "audio_content": "",

        "reasoning_content": "The user wants a haiku about programming. A haiku is a traditional Japanese poem with three lines following a 5-7-5 syllable pattern. I should create one that captures something meaningful about programming.\n\nLet me think of a few options:\n\n1. About debugging:\nLines (5-7-5):\n- \"Bugs hide in the code\" (4) - need 5\n- \"Silent errors whisper\" (6) - need 7\n- \"Find them, fix, deploy\" (5) ✓\n\nLet me recount:\n- \"Bugs hide in the code\" - Bugs(1) hide(2) in(3) the(4) code(5) = 5 ✓\n- \"Silent errors whisper\" - Si-lent(2) er-rors(4) whis-per(6) = 6, need 7\n- Try: \"Silent errors always whisper\" - 7 ✓\n- \"Find them, fix, deploy\" - Find(1) them(2) fix(3) de-ploy(5) = 5 ✓\n\n2. About code in general:\n- \"Logic flows like streams\" (5) - Lo-gic(2) flows(3) like(4) streams(5) = 5 ✓\n- \"Through brackets and curved braces\" (7) - Through(1) brack-ets(3) and(4) curved(5) bra-ces(7) = 7 ✓\n- \"Dreams made into life\" (5) - Dreams(1) made(2) in-to(4) life(5) = 5 ✓\n\n3. Another option:\n- \"Fingers on the keys\" (5) - Fin-gers(2) on(3) the(4) keys(5) = 5 ✓\n- \"Building worlds from nothing\" (7) - Build-ing(2) worlds(3) from(4) no-thing(6) = 6, need 7\n- Try: \"Building worlds from empty void\" - Build-ing(2) worlds(3) from(4) emp-ty(6) void(7) = 7 ✓\n- \"Code becomes the light\" (5) - Code(1) be-comes(3) the(4) light(5) = 5 ✓\n\nLet me go with option 2 or 3, both are nice. I'll provide one clean haiku and maybe offer an alternative.\n\nActually, let me just give one good one. Option 3 feels more poetic and evocative.\n\nLet me verify option 3 once more:\n- \"Fingers on the keys\" - Fin-gers(2) on(3) the(4) keys(5) = 5 ✓\n- \"Building worlds from empty void\" - Build-ing(2) worlds(3) from(4) emp-ty(6) void(7) = 7 ✓\n- \"Code becomes the light\" - Code(1) be-comes(3) the(4) light(5) = 5 ✓\n\nThat works well. I could also provide a simpler one focused on a different aspect of programming.\n\nI'll give a haiku with a clean delivery. Let me also think about a second option to make it more useful, or just stick with one well-crafted one.\n\nI'll provide one haiku and keep it concise.",

        "reasoning_details": [

          {

            "type": "reasoning.text",

            "id": "reasoning-text-1",

            "format": "MiniMax-response-v1",

            "index": 0,

            "text": "The user wants a haiku about programming. A haiku is a traditional Japanese poem with three lines following a 5-7-5 syllable pattern. I should create one that captures something meaningful about programming.\n\nLet me think of a few options:\n\n1. About debugging:\nLines (5-7-5):\n- \"Bugs hide in the code\" (4) - need 5\n- \"Silent errors whisper\" (6) - need 7\n- \"Find them, fix, deploy\" (5) ✓\n\nLet me recount:\n- \"Bugs hide in the code\" - Bugs(1) hide(2) in(3) the(4) code(5) = 5 ✓\n- \"Silent errors whisper\" - Si-lent(2) er-rors(4) whis-per(6) = 6, need 7\n- Try: \"Silent errors always whisper\" - 7 ✓\n- \"Find them, fix, deploy\" - Find(1) them(2) fix(3) de-ploy(5) = 5 ✓\n\n2. About code in general:\n- \"Logic flows like streams\" (5) - Lo-gic(2) flows(3) like(4) streams(5) = 5 ✓\n- \"Through brackets and curved braces\" (7) - Through(1) brack-ets(3) and(4) curved(5) bra-ces(7) = 7 ✓\n- \"Dreams made into life\" (5) - Dreams(1) made(2) in-to(4) life(5) = 5 ✓\n\n3. Another option:\n- \"Fingers on the keys\" (5) - Fin-gers(2) on(3) the(4) keys(5) = 5 ✓\n- \"Building worlds from nothing\" (7) - Build-ing(2) worlds(3) from(4) no-thing(6) = 6, need 7\n- Try: \"Building worlds from empty void\" - Build-ing(2) worlds(3) from(4) emp-ty(6) void(7) = 7 ✓\n- \"Code becomes the light\" (5) - Code(1) be-comes(3) the(4) light(5) = 5 ✓\n\nLet me go with option 2 or 3, both are nice. I'll provide one clean haiku and maybe offer an alternative.\n\nActually, let me just give one good one. Option 3 feels more poetic and evocative.\n\nLet me verify option 3 once more:\n- \"Fingers on the keys\" - Fin-gers(2) on(3) the(4) keys(5) = 5 ✓\n- \"Building worlds from empty void\" - Build-ing(2) worlds(3) from(4) emp-ty(6) void(7) = 7 ✓\n- \"Code becomes the light\" - Code(1) be-comes(3) the(4) light(5) = 5 ✓\n\nThat works well. I could also provide a simpler one focused on a different aspect of programming.\n\nI'll give a haiku with a clean delivery. Let me also think about a second option to make it more useful, or just stick with one well-crafted one.\n\nI'll provide one haiku and keep it concise."

          }

        ]

      },

      "finish_reason": "stop"

    }

  ],

  "created": 1780336062,

  "model": "MiniMax-M3",

  "object": "chat.completion",

  "usage": {

    "total_tokens": 912,

    "prompt_tokens": 183,

    "completion_tokens": 729,

    "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"

  }

}


```

## Parameters

* [ Input ](#tab-panel-820)
* [ Output ](#tab-panel-821)

mask\_sensitive\_info

`boolean`

max\_completion\_tokens

`number`exclusiveMinimum: 0

max\_tokens

`number`exclusiveMinimum: 0

▶messages\[\]

`array`required

▶response\_format{}

`object`

stream

`boolean`

▶stream\_options{}

`object`

temperature

`number`maximum: 1minimum: 0

tool\_choice

`string`enum: none, auto

▶tools\[\]

`array`

top\_p

`number`maximum: 1minimum: 0

▶base\_resp{}

`object`

▶choices\[\]

`array`

created

`number`

id

`string`

input\_sensitive

`boolean`

model

`string`

object

`string`enum: chat.completion, chat.completion.chunk

output\_sensitive

`boolean`

▶usage{}

`object`

## API Schemas (Raw)

Input 

Output 

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"/directory/","name":"Directory"}},{"@type":"ListItem","position":2,"item":{"@id":"/ai/","name":"AI"}},{"@type":"ListItem","position":3,"item":{"@id":"/ai/models/","name":"Models"}}]}
```
