MiniMax M2.7·续
</details>
<details>
<summary>Creative Writing — Higher temperature for creative output</summary>
const response = await env.AI.run(
'minimax/m2.7',
{
max_tokens: 2048,
messages: [{ content: 'Write a haiku about programming.', role: 'user' }],
temperature: 0.9,
},
)
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/m2.7",
"max_tokens": 2048,
"messages": [
{
"content": "Write a haiku about programming.",
"role": "user"
}
],
"temperature": 0.9
}'
Code flows like water
Logic weaves in silent streams
Bugs fade in sunrise
{
"id": "066cf8eba419a621e81c91dd2899b9e6",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Code flows like water \nLogic weaves in silent streams \nBugs fade in sunrise",
"name": "MiniMax AI",
"audio_content": "",
"reasoning_content": "The user asks: \"Write a haiku about programming.\" We need to respond with a haiku (5-7-5 syllable structure) about programming. No disallowed content. So simply produce a haiku. Perhaps a nice one. Let's think.\n\nDefinition: Haiku is a short poem with three lines: first line five syllables, second line seven syllables, third line five syllables. Must convey something about programming. Let's craft a haiku.\n\nPossible lines:\n\nLine1: \"Code flows like water\" (Count syllables: Code(1) flows(1) like(1) wa(1) ter(1) -> \"water\" is two syllables: wa-ter = 2, so total = 1+1+1+2 =5) Actually: \"Code flows like water\": Co-de (2) flows (1) like (1) wa-ter (2) = total 6? Let's count: \"Code\" is one syllable? Actually \"code\" is one syllable. So \"Code flows like water\": Code (1) flows (1) like (1) water (2) = total 5. Wait: Code = 1, flows = 1, like = 1, water = 2 => total = 5. Yes. So line1 is 5.\n\nLine2: \"Logic weaves in silent streams\" Count: Logic (2) weaves (1) in (1) si-lent (2) streams (1) = total = 2+1+1+2+1=7. Yes, 7.\n\nLine3: \"Bugs fade in sunrise\" Count: Bugs (1) fade (1) in (1) sun-rise (2) = total =5? Actually \"sunrise\" is two syllables: sun-rise. So Bugs (1) fade (1) in (1) sun-rise (2) = 5. Yes.\n\nAlternatively something about \"silicon dreams\" etc.\n\nMake sure we follow haiku structure: 5-7-5 syllables. Let's double-check.\n\nHaiku about programming:\n\nLine1: \"Code flows like water\" (5)\nLine2: \"Logic weaves in silent streams\" (7)\nLine3: \"Bugs fade in sunrise\" (5)\n\nAll good.\n\nAlternatively: \"Silent code compiles\" (5? Count: Si-lent (2) code (1) com-piles (2) =5) But it's okay.\n\nOk let's produce a haiku: maybe:\n\n\"Silicon sighs at night,\nfunctions dance in bright loops,\nbugs dissolve in dawn.\" Let's count.\n\nLine1: \"Silicon sighs at night\" Count: Si-li-con (3) sighs (1) at (1) night (1) =6? Actually \"silicon\" is three syllables: Si-li-con. sighs=1, at=1, night=1 => total = 3+1+1+1=6. Too many.\n\nMaybe \"Silicon sighs at dusk\" Count: Si-li-con (3) sighs (1) at (1) dusk (1) =6.\n\nOk not that.\n\nBetter to go with first attempt.\n\nMaybe \"Infinite loops at night\" Count: In-fi-nite (3) loops (1) at (1) night (1) =6.\n\nThus keep original.\n\nCheck:\n\nLine1: Code flows like water (5)\nLine2: Logic weaves in silent streams (7)\nLine3: Bugs fade in sunrise (5)\n\nBetter ensure second line count: Logic (2) weaves (1) in (1) silent (2) streams (1) =2+1+1+2+1=7.\n\nThird line: Bugs (1) fade (1) in (1) sunrise (2) =5.\n\nThus ok.\n\nOne could also add a title? The user only asked to write a haiku. So just output the haiku.\n\nThus final answer: the haiku.\n\nMake sure not to have any extra commentary beyond the haiku? The user just asked for a haiku. Typically we can output just the poem. Might add a short line like \"Here's a haiku:\" but that's extra. Safer to just output the poem.\n\nThus final.",
"reasoning_details": [
{
"type": "reasoning.text",
"id": "reasoning-text-1",
"format": "MiniMax-response-v1",
"index": 0,
"text": "The user asks: \"Write a haiku about programming.\" We need to respond with a haiku (5-7-5 syllable structure) about programming. No disallowed content. So simply produce a haiku. Perhaps a nice one. Let's think.\n\nDefinition: Haiku is a short poem with three lines: first line five syllables, second line seven syllables, third line five syllables. Must convey something about programming. Let's craft a haiku.\n\nPossible lines:\n\nLine1: \"Code flows like water\" (Count syllables: Code(1) flows(1) like(1) wa(1) ter(1) -> \"water\" is two syllables: wa-ter = 2, so total = 1+1+1+2 =5) Actually: \"Code flows like water\": Co-de (2) flows (1) like (1) wa-ter (2) = total 6? Let's count: \"Code\" is one syllable? Actually \"code\" is one syllable. So \"Code flows like water\": Code (1) flows (1) like (1) water (2) = total 5. Wait: Code = 1, flows = 1, like = 1, water = 2 => total = 5. Yes. So line1 is 5.\n\nLine2: \"Logic weaves in silent streams\" Count: Logic (2) weaves (1) in (1) si-lent (2) streams (1) = total = 2+1+1+2+1=7. Yes, 7.\n\nLine3: \"Bugs fade in sunrise\" Count: Bugs (1) fade (1) in (1) sun-rise (2) = total =5? Actually \"sunrise\" is two syllables: sun-rise. So Bugs (1) fade (1) in (1) sun-rise (2) = 5. Yes.\n\nAlternatively something about \"silicon dreams\" etc.\n\nMake sure we follow haiku structure: 5-7-5 syllables. Let's double-check.\n\nHaiku about programming:\n\nLine1: \"Code flows like water\" (5)\nLine2: \"Logic weaves in silent streams\" (7)\nLine3: \"Bugs fade in sunrise\" (5)\n\nAll good.\n\nAlternatively: \"Silent code compiles\" (5? Count: Si-lent (2) code (1) com-piles (2) =5) But it's okay.\n\nOk let's produce a haiku: maybe:\n\n\"Silicon sighs at night,\nfunctions dance in bright loops,\nbugs dissolve in dawn.\" Let's count.\n\nLine1: \"Silicon sighs at night\" Count: Si-li-con (3) sighs (1) at (1) night (1) =6? Actually \"silicon\" is three syllables: Si-li-con. sighs=1, at=1, night=1 => total = 3+1+1+1=6. Too many.\n\nMaybe \"Silicon sighs at dusk\" Count: Si-li-con (3) sighs (1) at (1) dusk (1) =6.\n\nOk not that.\n\nBetter to go with first attempt.\n\nMaybe \"Infinite loops at night\" Count: In-fi-nite (3) loops (1) at (1) night (1) =6.\n\nThus keep original.\n\nCheck:\n\nLine1: Code flows like water (5)\nLine2: Logic weaves in silent streams (7)\nLine3: Bugs fade in sunrise (5)\n\nBetter ensure second line count: Logic (2) weaves (1) in (1) silent (2) streams (1) =2+1+1+2+1=7.\n\nThird line: Bugs (1) fade (1) in (1) sunrise (2) =5.\n\nThus ok.\n\nOne could also add a title? The user only asked to write a haiku. So just output the haiku.\n\nThus final answer: the haiku.\n\nMake sure not to have any extra commentary beyond the haiku? The user just asked for a haiku. Typically we can output just the poem. Might add a short line like \"Here's a haiku:\" but that's extra. Safer to just output the poem.\n\nThus final."
}
]
},
"finish_reason": "stop"
}
],
"created": 1780336107,
"model": "MiniMax-M2.7",
"object": "chat.completion",
"usage": {
"total_tokens": 936,
"prompt_tokens": 48,
"completion_tokens": 888,
"total_characters": 0,
"completion_tokens_details": {
"reasoning_tokens": 872
}
},
"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>
Parameters
Schema variant
Chat CompletionsMessages
▶messages[]
arrayrequired
temperature
numberminimum: 0maximum: 1
max_tokens
numberexclusiveMinimum: 0
max_completion_tokens
numberexclusiveMinimum: 0
top_p
numberminimum: 0maximum: 1
stream
boolean
▶stream_options{}
object
▶tools[]
array
tool_choice
stringenum: none, auto
▶response_format{}
object
mask_sensitive_info
boolean
▶messages[]
arrayrequired
max_tokens
numberrequiredexclusiveMinimum: 0
system
string
temperature
numberminimum: 0maximum: 1
top_p
numberminimum: 0maximum: 1
top_k
numberexclusiveMinimum: 0
stream
boolean
▶metadata{}
object
id
string
▶choices[]
array
created
number
model
string
object
stringenum: chat.completion, chat.completion.chunk
▶usage{}
object
input_sensitive
boolean
output_sensitive
boolean
▶base_resp{}
object
id
string
type
stringconst: message
role
stringconst: assistant
▶content[]
array
model
string
stop_reason
string
▶usage{}
object
API Schemas (Raw)
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/ai/models/minimax/m2.7/#page","headline":"MiniMax M2.7","description":"MiniMax's M2.7 language model with multilingual capabilities.","url":"https://developers.cloudflare.com/ai/models/minimax/m2.7/","inLanguage":"en","image":"https://developers.cloudflare.com/og-docs.png","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: MiniMax's M3 language model with frontier coding and agentic capabilities, a 1M token context window, and multilingual support. title: MiniMax M3 image: https://developers.cloudflare.com/og-docs.png
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/llms.txt
Use this file to discover all available pages before exploring further.

