<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: MiniMax M4 Guide</title>
    <description>The latest articles on DEV Community by MiniMax M4 Guide (@minimaxm4guide).</description>
    <link>https://dev.to/minimaxm4guide</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4281243%2F0c70b271-d7cd-4ae9-9c40-7ddad4aa17b0.png</url>
      <title>DEV Community: MiniMax M4 Guide</title>
      <link>https://dev.to/minimaxm4guide</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/minimaxm4guide"/>
    <language>en</language>
    <item>
      <title>How to call the MiniMax M4 API (model ID, pricing, code)</title>
      <dc:creator>MiniMax M4 Guide</dc:creator>
      <pubDate>Thu, 03 Dec 2026 18:34:45 +0000</pubDate>
      <link>https://dev.to/minimaxm4guide/how-to-call-the-minimax-m4-api-model-id-pricing-code-65k</link>
      <guid>https://dev.to/minimaxm4guide/how-to-call-the-minimax-m4-api-model-id-pricing-code-65k</guid>
      <description>&lt;p&gt;MiniMax M4 shipped on 3 December 2026. The useful part for anyone wiring a client is small: the platform model ID is &lt;code&gt;MiniMax-M4&lt;/code&gt;, the list price is $0.80 per 1M input tokens and $3.10 per 1M output tokens, and the context window is 1,000,000 tokens. This is an independent setup note, not an official MiniMax page. I am not publishing a benchmark here.&lt;/p&gt;

&lt;p&gt;If you want the longer endpoint and pricing write-up, use the independent &lt;a href="https://minimaxm4.org/minimax-m4-api" rel="noopener noreferrer"&gt;MiniMax M4 API guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Model ID: which string to send
&lt;/h2&gt;

&lt;p&gt;On the MiniMax platform itself, the ID string is &lt;code&gt;MiniMax-M4&lt;/code&gt;. OpenRouter lists &lt;code&gt;minimax/minimax-m4&lt;/code&gt; and names MiniMax as the only provider. Vercel AI Gateway uses the same gateway string. Send the bare &lt;code&gt;MiniMax-M4&lt;/code&gt; ID when your base URL is the platform. Send the slashed gateway string only on that gateway.&lt;/p&gt;

&lt;p&gt;Vendor materials describe a natively multimodal Mixture-of-Experts with 2.74 trillion total parameters and 66 billion active parameters per token. OpenRouter's listing adds native image and video understanding; Vercel lists tool calling and text plus image input. Those are input features stated by the gateways, not a second price.&lt;/p&gt;

&lt;p&gt;The release is described as open-weight, but the weights are not downloadable today. The official MiniMax-AI/MiniMax-M4 repository says the weights will be released soon, after safety review. You cannot self-host this model yet. Call it through an API.&lt;/p&gt;

&lt;h2&gt;
  
  
  List prices
&lt;/h2&gt;

&lt;p&gt;Rates below are per 1M tokens, from MiniMax's official blog and the platform pricing overview. M4 sits on the current table next to M3.1-Flash. M3 is on the Legacy table. The cache label differs by row because the sources use different wording.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Input / 1M&lt;/th&gt;
&lt;th&gt;Output / 1M&lt;/th&gt;
&lt;th&gt;Cache / 1M&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;M4&lt;/td&gt;
&lt;td&gt;$0.80&lt;/td&gt;
&lt;td&gt;$3.10&lt;/td&gt;
&lt;td&gt;$0.05 cached input&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M3.1-Flash&lt;/td&gt;
&lt;td&gt;$0.15&lt;/td&gt;
&lt;td&gt;$0.60&lt;/td&gt;
&lt;td&gt;$0.015 cache read&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;M3&lt;/td&gt;
&lt;td&gt;$0.60, listed permanent 50% off to $0.30&lt;/td&gt;
&lt;td&gt;$2.40, listed permanent 50% off to $1.20&lt;/td&gt;
&lt;td&gt;— (not verified in this set)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A quick arithmetic check, not a measured job: 100,000 input tokens plus 5,000 output tokens at the M4 list price is &lt;code&gt;$0.80 × 0.1 + $3.10 × 0.005 = $0.0955&lt;/code&gt;, before any cache hit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reasoning stays on
&lt;/h2&gt;

&lt;p&gt;Press notes and the OpenRouter model page say thinking cannot be turned off. Official platform docs expose the depth as &lt;code&gt;reasoning_effort&lt;/code&gt; on the OpenAI-compatible path and as &lt;code&gt;output_config.effort&lt;/code&gt; on the Anthropic-compatible path. The documented levels are &lt;code&gt;low&lt;/code&gt;, &lt;code&gt;medium&lt;/code&gt;, &lt;code&gt;high&lt;/code&gt;, &lt;code&gt;xhigh&lt;/code&gt;, and &lt;code&gt;max&lt;/code&gt;. The default is &lt;code&gt;max&lt;/code&gt;. Vercel describes the intensity as adjustable, which matches picking a level, not an off switch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Call the MiniMax API
&lt;/h2&gt;

&lt;p&gt;Official model-invocation docs live on &lt;code&gt;platform.minimax.io&lt;/code&gt;. The OpenAI-compatible base URL is &lt;code&gt;https://api.minimax.io/v1&lt;/code&gt;. The Anthropic-compatible base URL, which those docs call the recommended path, is &lt;code&gt;https://api.minimax.io/anthropic&lt;/code&gt;. Export your platform key as &lt;code&gt;MINIMAX_API_KEY&lt;/code&gt; and do not put it in a repo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://api.minimax.io/v1/chat/completions \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $MINIMAX_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{
    "model": "MiniMax-M4",
    "reasoning_effort": "max",
    "messages": [
      {"role": "user", "content": "List three risks in this diff."}
    ]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# pip install openai&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"MINIMAX_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://api.minimax.io/v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"MiniMax-M4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;reasoning_effort&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"max"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"List three risks in this diff."&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same docs show an Anthropic-compatible &lt;code&gt;POST&lt;/code&gt; to &lt;code&gt;https://api.minimax.io/anthropic/v1/messages&lt;/code&gt;, with &lt;code&gt;output_config: {"effort": "max"}&lt;/code&gt; and a required &lt;code&gt;max_tokens&lt;/code&gt; field.&lt;/p&gt;

&lt;h2&gt;
  
  
  Call it through OpenRouter
&lt;/h2&gt;

&lt;p&gt;If you already have an OpenRouter key, change the base URL and the model string. Keep &lt;code&gt;reasoning_effort&lt;/code&gt; out of this sample unless you have confirmed the field on that gateway; OpenRouter's listing only states that reasoning stays on.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://openrouter.ai/api/v1/chat/completions \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $OPENROUTER_API_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{
    "model": "minimax/minimax-m4",
    "messages": [
      {"role": "user", "content": "List three risks in this diff."}
    ]
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# pip install openai&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"OPENROUTER_API_KEY"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://openrouter.ai/api/v1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"minimax/minimax-m4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"role"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"user"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"List three risks in this diff."&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What to watch for
&lt;/h2&gt;

&lt;p&gt;The 1,000,000-token context is the figure given by the platform, OpenRouter (as 1.0M), and Vercel AI Gateway. A long context is not free: output is billed at $3.10 per 1M tokens, and the default effort is &lt;code&gt;max&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;M3.1-Flash and M3 remain available if you want a cheaper or legacy ID. They are different rows on the price table, not aliases for &lt;code&gt;MiniMax-M4&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I am not repeating vendor leaderboard claims here. MiniMax's own blog says the model sits at the intelligence frontier among Chinese and open-source models on several task families, and also says a substantial gap remains compared with the very best overseas models. Those sentences belong to the vendor, not to this post.&lt;/p&gt;

&lt;p&gt;For the compact ID, pricing, and sample set in one place, see the &lt;a href="https://minimaxm4.org/minimax-m4-api" rel="noopener noreferrer"&gt;MiniMax M4 API guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Sources: MiniMax official blog ("MiniMax M4: The Intelligence Frontier Under Compute Constraints"); MiniMax platform docs (model invocation and pricing overview); MiniMax-AI/MiniMax-M4 GitHub technical report; OpenRouter and Vercel AI Gateway model pages for &lt;code&gt;minimax/minimax-m4&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>api</category>
      <category>minimax</category>
    </item>
  </channel>
</rss>
