Skip to content
MiniMax logo

MiniMax M3

Text GenerationMiniMax

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

Model Info
Context Window1,000,000 tokens
Terms and Licenselink
More informationlink
Zero data retentionYes
Request formatsChat Completions, Anthropic Messages
PricingView pricing in the Cloudflare dashboard

Usage

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)
The capital of France is **Paris**.

Examples

With System Prompt — Using a system prompt to guide behavior
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)
# 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! 🍝
Multi-turn Conversation — Continuing a conversation with context
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)
Use UDP for time-sensitive applications like video streaming, online gaming, or VoIP where speed matters more than perfect reliability.
Creative Writing — Higher temperature for creative output
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)
Fingers on the keys,
Building worlds from empty void—
Code becomes the light.

Parameters

Schema variant
temperature
numberminimum: 0maximum: 1
max_tokens
numberexclusiveMinimum: 0
max_completion_tokens
numberexclusiveMinimum: 0
top_p
numberminimum: 0maximum: 1
stream
boolean
tool_choice
stringenum: none, auto
mask_sensitive_info
boolean

API Schemas (Raw)

Input
Output