MiniMax M2.7 API setup: base URL, exact id, first request.
Updated 2026-07-16
MiniMax-M2.7 is addressable through any OpenAI-compatible client: point base_url at https://api.apisrouter.com/v1, set the model field to MiniMax-M2.7 with its exact capitalization, and send a standard chat completions request. No MiniMax account, mainland phone number, or Chinese-language console involved.
Quick answer: two values, one capitalization trap.
Every OpenAI-compatible SDK takes a base URL and a key. Set the base URL to https://api.apisrouter.com/v1, set the model field to MiniMax-M2.7, and the request is the same /v1/chat/completions payload as every other chat model in the catalog. The id is the one gotcha: it is capitalized, MiniMax-M2.7, unlike most catalog ids, which are lowercase. Model ids are exact strings, so minimax-m2.7 returns model-not-found rather than routing anywhere. Copy the spelling from the /v1/models listing rather than from habit, and the wiring is done in one request.
curl https://api.apisrouter.com/v1/chat/completions \
-H "Authorization: Bearer $APISROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "MiniMax-M2.7",
"messages": [{"role": "user", "content": "Plan the steps to add pagination to a REST endpoint, then write the diff."}]
}'What MiniMax M2.7 actually is.
MiniMax released M2.7 on March 18, 2026, positioning it for agentic workflows, software engineering, and office tasks. Architecturally it is a sparse Mixture-of-Experts reported at about 230 billion total parameters with roughly 10 billion active per token, which is the design choice behind its economics: a small active footprint keeps serving costs low, and MiniMax's published rate reflects that. The launch's most-quoted claim is the self-evolution story: MiniMax described M2.7 as the first of its models to participate in its own development, with an internal version autonomously running more than a hundred optimization rounds over the reinforcement-learning pipeline that produced it. It is a striking claim and a vendor claim; treat it as positioning rather than a spec. The weights are public: coverage in April 2026 reported the open-weight release on Hugging Face under a Modified-MIT license, with one caveat that matters commercially and got its own news cycle: the license's commercial-use clause requires MiniMax's prior written authorization, so self-hosting it inside a paid product is a licensing conversation, not a download.
Quickstart: Python and JavaScript with the OpenAI SDK.
Both official OpenAI SDKs accept a custom base URL at client construction, and the model field passes through as a plain string. Nothing MiniMax-specific is required: chat completions, streaming, and the standard tools array work the way they do for every other id on the endpoint. Keep the key in an environment variable, and pin the id in one config constant, capitalization included, so the string lives in exactly one place.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["APISROUTER_API_KEY"],
base_url="https://api.apisrouter.com/v1",
)
resp = client.chat.completions.create(
model="MiniMax-M2.7",
messages=[
{"role": "system", "content": "You are a careful software engineer."},
{"role": "user", "content": "Review this function for edge cases and propose a fix: ..."},
],
max_tokens=4000,
)
print(resp.choices[0].message.content)
print(resp.usage) # prompt_tokens / completion_tokens per requestAgent and coding strengths, with the sources attached.
The practical read: M2.7's case is efficiency at agent work, competitive multi-step behavior from a 10B-active design at one of the lowest rates in the catalog's current generation. Loops that run hundreds of steps care about exactly that ratio, and the usage log prices it on your own workload within an afternoon.
- Agentic coding: MiniMax reported 56.2 on SWE-bench Pro and 57.0 on Terminal-Bench 2.0 at launch, with 76.5 on SWE-bench Multilingual, a benchmark family the M2 line has historically led among open models.
- Agentic browsing and tool use: a reported 77.8 on BrowseComp and launch materials emphasizing multi-step loops: inspect logs, reason about code, modify files, call tools, iterate.
- Office and artifact work: MiniMax's launch framing put document and office-task generation alongside coding, unusual among agent-focused releases and relevant if your loops produce reports rather than diffs.
- The caveat that applies to all of the above: these are vendor-reported launch figures. Independent leaderboards have M2.7 competitive in the open-weight agent class rather than atop it; the GLM-5.2 comparison linked below carries the strongest current rival's numbers.
Context: what the catalog serves vs what the vendor publishes.
One discrepancy to state plainly, because budgeting depends on it. The MiniMax-M2.7 catalog entry here lists a 1M-token context window. MiniMax's own model documentation describes M2.7 with a context on the order of 200K tokens (196,608 in the vendor's spec). Those numbers do not agree, and this page will not pretend they do. The conservative engineering choice is to budget prompts against the vendor's 200K figure until a long-context test on this route proves otherwise: send a deliberately oversized prompt once and observe where truncation or rejection actually lands. If your workload never approaches 200K, the discrepancy costs you nothing; if it does, five minutes of testing beats an assumption in either direction. Whichever ceiling applies, input tokens bill on every request, so the usual long-context discipline holds: scope prompts to the task, summarize long-lived state, and treat giant contexts as spend-worthy exceptions rather than defaults.
Pay-as-you-go · transparent per-model pricing
Selected models are priced below official list prices. Exact input, output, cache, and per-request prices are shown for each model.
| Model | Official Price | Our Price |
|---|---|---|
| MiniMax M2.7 | $0.30 / $1.20 per M | $0.27 / $1.08 per M |
| DeepSeek V4 Flash | $0.14 / $0.28 per M | $0.13 / $0.25 per M |
| Qwen 3.7 Plus | $0.29 / $1.14 per M | $0.26 / $1.03 per M |
| GLM-5.2 | $1.14 / $4.00 per M | $1.03 / $3.60 per M |
| Claude Sonnet 4.6 | $3.00 / $15.00 per M | $2.40 / $12.00 per M |
Verify the endpoint and debug the first request.
List the served models first and copy the exact id from the response; for this model the capitalization is the most common failure. The rest of the first-request list is standard. A 401 means the key was not exported into the shell running your code. A 404 on the path means the base URL is missing its /v1 suffix, since SDKs append /chat/completions to the base they are given. A response truncated with finish_reason=length on multi-step work means max_tokens is too tight for a model that reasons through plans; raise it with headroom before judging output quality. For what M2.7 costs against its published rate, and how the numbers work at volume, the dedicated MiniMax M2 pricing page linked below carries the worked examples; this page stays on setup so the two do not repeat each other.
curl -s https://api.apisrouter.com/v1/models \
-H "Authorization: Bearer $APISROUTER_API_KEY" | grep -i minimaxFAQ
What is the MiniMax M2 API base URL?
Through APIsRouter it is https://api.apisrouter.com/v1. Any OpenAI-compatible SDK accepts it as base_url (Python) or baseURL (JavaScript), and MiniMax-M2.7 is served under one key next to the rest of the catalog, with no MiniMax account required.
What is the exact MiniMax M2.7 model id?
MiniMax-M2.7, with capital M-i-n-i-M-a-x and a capital M in M2.7. It is the one commonly capitalized id in this catalog, and lowercase variants return model-not-found. The /v1/models listing is the authoritative spelling.
Is MiniMax M2.7 good for coding agents?
Its launch case is exactly that: vendor-reported 56.2 on SWE-bench Pro, 57.0 on Terminal-Bench 2.0, and 77.8 on BrowseComp, from a 10B-active MoE at one of the lowest current-generation rates here. Verify against your own loop; the figures are vendor-reported and the open-weight agent class is crowded.
What context window does MiniMax M2.7 have?
The catalog entry here lists 1M tokens; MiniMax's own documentation describes roughly 200K (196,608). Budget against the vendor's 200K until a long-context test on this route proves more, and let one oversized test request settle it empirically.
Is MiniMax M2.7 open weight?
Yes, with a license caveat: the weights are on Hugging Face under a Modified-MIT license whose commercial-use clause requires MiniMax's prior written authorization, per the license text and April 2026 coverage. Personal and research use is permissive; commercial self-hosting is a licensing conversation.
Does MiniMax M2.7 work with the OpenAI SDK and function calling?
Yes. Through the OpenAI-compatible surface here, chat completions, streaming, and the standard tools array work without a MiniMax-specific client, which is also how agent frameworks that speak the OpenAI protocol connect to it.