Base URL and Authentication
Use the dedicated endpoint for all requests. The base URL is https://api.minimaxapi.top/v1. Authentication requires an API key passed in the Authorization header as a Bearer token. You can generate your key via the Get API key page using Google or email. The API key is displayed immediately after creation and is required for all subsequent requests.
Sending a Chat Completion
Send text input and receive text output via the POST /v1/chat/completions endpoint. Specify the model as uncensored. The request body includes messages, temperature, and other standard parameters. Errors and refusals incur no charge; you only pay for actual token usage.
curl https://api.minimaxapi.top/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Write a blunt product review of a cheap VPN."}]
}'
Python SDK Integration
Update the OpenAI Python SDK client to point to our base URL. This allows you to use familiar library methods while accessing the uncensored model. Set the API key and base URL in your client configuration. The response structure matches the standard OpenAI chat completion format, including token usage in the final chunk.
from openai import OpenAI
client = OpenAI(base_url="https://api.minimaxapi.top/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)
Node SDK Configuration
Configure the OpenAI Node.js SDK similarly. Change the baseURL and provide your API key. This enables seamless switching between major providers and our uncensored alternative without altering your core application logic. The model ID remains uncensored.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.minimaxapi.top/v1", apiKey: process.env.API_KEY });
const resp = await client.chat.completions.create({
model: "uncensored",
messages: [{ role: "user", content: "Draft a villain monologue for my game." }],
});
console.log(resp.choices[0].message.content);
Streaming Responses (SSE)
Enable streaming by setting stream: true. The API returns Server-Sent Events (SSE) for real-time token delivery. Token usage data is included in the last chunk of the stream. This allows your application to display responses incrementally while tracking costs accurately.
stream = client.chat.completions.create(
model="uncensored",
messages=[{"role": "user", "content": "Tell the story in second person."}],
stream=True,
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
Limits, Errors, and Context Window
The context window is 100,000 tokens total (prompt + completion). There is no separate output cap, and if max_tokens is unset, the response can run to the end of the window. Rate limits are 300 requests per minute and 8 concurrent requests per key. Handle errors appropriately: 401 indicates an invalid key, 402 signals insufficient credit, and 429 means you have hit the rate limit. Credit never expires, and prepaid amounts are charged by real usage.