MiniMax M2.5 API Alternative With Streaming and Tools
Searching for the minimax m2.5 api usually means you want an OpenAI-style endpoint you can call from code. This page covers a different, independent service: one open-weight model behind a standard chat completions API, with streaming, JSON mode and tool calling.
Updated

Key points
- Base URL https://api.minimaxnsfw.top/v1, model ID uncensored, standard Bearer auth.
- Supports streaming over SSE, JSON mode and tool calling on POST /v1/chat/completions.
- Not the official MiniMax API and not a router; one open-weight model run by an independent provider.
- Pay as you go: $0.15 per 1M input and $0.50 per 1M output tokens.
What this API is and is not
Be clear on what you are reading about. If you need the official minimax m2.5 api, with MiniMax's own model and account system, go to MiniMax's documentation. This site is not that. It is an independent service that hosts one open-weight text model, tuned to answer without content refusals for lawful adult use, and exposes it through the same HTTP shape the OpenAI SDKs expect.
The practical result is that client code written for an OpenAI-style endpoint needs three edits: the base URL, the key and the model name. The model ID here is uncensored. There is only one model; the service is not a router across vendors, and GET /v1/models will not show you a catalog of other companies' models.
| Item | Value |
|---|---|
| Base URL | https://api.minimaxnsfw.top/v1 |
| Endpoints | POST /v1/chat/completions, GET /v1/models |
| Context window | 100,000 tokens, prompt plus completion |
| Max request body | 8 MB |
| Output | Text only |
The docs page shows how to reuse existing client code with this endpoint.
First request
With the Python SDK, a first call looks like this. The key comes from the API key page:
from openai import OpenAI
client = OpenAI(
base_url="https://api.minimaxnsfw.top/v1",
api_key="YOUR_KEY",
)
resp = client.chat.completions.create(
model="uncensored",
messages=[
{"role": "system", "content": "You write tight, vivid fiction."},
{"role": "user", "content": "Describe a lighthouse keeper's last night shift in 120 words."},
],
temperature=0.9,
top_p=0.95,
seed=42,
)
print(resp.choices[0].message.content)
Sampling controls are passed through to the model: temperature, top_p, stop, seed and the frequency and presence penalties. Using seed with the same parameters helps when you want repeatable test runs, though you should not rely on bit-identical output across everything.
The same request over curl, handy for debugging:
curl https://api.minimaxnsfw.top/v1/chat/completions \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"model":"uncensored","messages":[{"role":"user","content":"Hello"}],"max_tokens":50}'Streaming
For chat interfaces, set stream: true. The server sends server-sent events, and the last chunk carries usage so you can count tokens without a second request.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.minimaxnsfw.top/v1",
apiKey: process.env.KEY,
});
const stream = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Tell a two-paragraph ghost story." }],
stream: true,
stream_options: { include_usage: true },
});
for await (const chunk of stream) {
const piece = chunk.choices[0]?.delta?.content;
if (piece) process.stdout.write(piece);
if (chunk.usage) console.log("\nusage:", chunk.usage);
}
One operational detail matters here. A streamed request holds its concurrency slot until the stream ends. A full key allows 8 requests at once, and a trial key 2, so a UI that opens streams and never closes them will hit a 429 with the code concurrency sooner than you expect. Always read the stream to completion or abort it cleanly.
JSON mode
When your code parses the answer, ask for JSON mode with response_format: {"type": "json_object"}. Also say in the prompt that you want JSON and describe the shape. The flag constrains output to valid JSON; the prompt tells it which fields.
import json
from openai import OpenAI
client = OpenAI(base_url="https://api.minimaxnsfw.top/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
model="uncensored",
response_format={"type": "json_object"},
messages=[
{"role": "system", "content": "Reply only with JSON: {\"title\": str, \"tags\": [str]}."},
{"role": "user", "content": "Metadata for a story about a robot learning to paint."},
],
)
data = json.loads(resp.choices[0].message.content)
print(data["title"], data["tags"])
Validate the parsed object anyway. JSON mode guarantees syntax, not that your fields exist or have sensible values.
Tool calling
Tool calling follows the OpenAI shape. You describe functions in tools, optionally steer with tool_choice, run the function yourself when the model asks, and return the result as a message with role: "tool".
import json
from openai import OpenAI
client = OpenAI(base_url="https://api.minimaxnsfw.top/v1", api_key="YOUR_KEY")
tools = [{
"type": "function",
"function": {
"name": "roll_dice",
"description": "Roll n six-sided dice and return the results.",
"parameters": {
"type": "object",
"properties": {"n": {"type": "integer", "minimum": 1, "maximum": 10}},
"required": ["n"],
},
},
}]
messages = [{"role": "user", "content": "Roll three dice for my character's strength."}]
first = client.chat.completions.create(model="uncensored", messages=messages, tools=tools)
call = first.choices[0].message.tool_calls[0]
args = json.loads(call.function.arguments)
result = [4, 2, 6][: args["n"]] # your real function goes here
messages.append(first.choices[0].message)
messages.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(result)})
final = client.chat.completions.create(model="uncensored", messages=messages, tools=tools)
print(final.choices[0].message.content)
Streamed responses can carry tool_calls as well, delivered in pieces, so assemble the argument string across chunks before parsing it. Check that the model actually returned a tool call before indexing into it; production code should handle the plain-text case.
Choosing sampling settings for creative work
The model behind this endpoint is meant for fiction, roleplay, companion apps and editorial drafting, so sampling choices affect results more than people expect. Start from a few defaults and change one thing at a time.
- Temperature. Around 0.7 to 0.9 suits stories and dialogue. Drop to 0.2 to 0.4 for extraction, classification or anything you parse in code.
- top_p. A value near 0.9 to 0.95 trims the unlikely tail of word choices. Adjust either temperature or top_p, not both at once, so you can tell which change helped.
- Penalties. If a character repeats the same phrases, raise the frequency or presence penalty slightly, in steps of 0.1 to 0.2. Large values make prose oddly avoidant.
- stop. Pass a stop sequence such as a speaker label so the model does not write the user's next line for them.
- seed. Fix it while you compare prompt variants, then remove it in production if you want variety.
A short system prompt that sets voice, point of view and length usually beats a long list of rules. If replies run long, say how many paragraphs you want and set max_tokens as a backstop. Since output tokens are billed at $0.50 per 1M against $0.15 for input, a tighter reply length is also the cheapest saving available.
For multi-turn work, send the entire conversation each time, since the endpoint keeps no memory between requests. The window is 100,000 tokens for prompt and completion combined, so very long sessions need trimming or a rolling summary at some point.
Handling errors in code
Production clients should treat 429 as a normal event rather than an exception that ends the run. The pattern is simple: read the error code, wait, retry a bounded number of times.
import time
from openai import OpenAI, RateLimitError
client = OpenAI(base_url="https://api.minimaxnsfw.top/v1", api_key="YOUR_KEY", max_retries=0)
def ask(prompt, tries=4):
for attempt in range(tries):
try:
r = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": prompt}],
)
return r.choices[0].message.content
except RateLimitError as e:
wait = 5 if attempt == 0 else 5 * (2 ** attempt)
retry_after = e.response.headers.get("Retry-After")
if retry_after:
wait = int(retry_after)
time.sleep(wait)
raise RuntimeError("still rate limited after retries")
Disabling the SDK's own retries with max_retries=0 keeps the behavior visible while you tune it. Log X-Request-Id for any failure you cannot explain. Failed requests are not charged, so a retry loop with a cap is cheap, but an uncapped one can still hammer your concurrency limit.
Limits, errors and price
Limits depend on the key type:
| Full key | Trial key | |
|---|---|---|
| Concurrent requests | 8 | 2 |
| Requests per minute | 300 | 60 |
Over a limit you get HTTP 429, with the error code rate_limited for per-minute limits or concurrency for too many simultaneous requests. During temporary overload the API also returns 429 with Retry-After: 5. Responses include X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests and X-RateLimit-Limit-Concurrency.
Price is $0.15 per 1M input tokens and $0.50 per 1M output tokens, prepaid, with no subscription and no charge for failed or refused requests. Top-ups run from $20 to $500 in crypto (USDT on TRC20 or USDC on Base), with a bonus of 5% from $50, 10% from $100 and 15% from $200. See the pricing page for details.
The scope is text only. There is no image, audio or video generation, no embeddings and no fine-tuning, and sexual content involving minors is prohibited. Prompts are not used for training.
More guides
Questions and answers
Is this the official MiniMax M2.5 endpoint?
No. It is an independent provider running one open-weight model, not affiliated with MiniMax. Use MiniMax's own documentation for their API.
Which model ID do I send?
Send uncensored as the model. It is the only model on the service.
Does it support streaming and tools?
Yes. Streaming over SSE with usage at the end, tool calling with tools and tool_choice, and JSON mode via response_format are all supported.
Can I use the OpenAI SDK unchanged?
Yes, after changing the base URL to https://api.minimaxnsfw.top/v1, the API key and the model name.
Can it generate images or embeddings?
No. The service is text only: no image, audio or video generation, no embeddings and no fine-tuning.