EN ▾
Get API key
Get API key

First request in five minutes

Connect your existing OpenAI-compatible client to the uncensored LLM API by updating the base URL and API key. This guide covers the essential endpoints, streaming behavior, and token limits for immediate integration.

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.

Questions and answers

How is token usage reported in streaming responses?

Token usage data is included in the last chunk of the stream. This allows you to calculate costs accurately as the response completes. The API returns usage statistics only in that final chunk, not in every intermediate token.

What happens if I exceed my API credit?

Requests will return a 402 error indicating no credit is available. You can top up by crypto (USDT on TRC20, USDC on Base) to resume service. Credit is charged based on actual token usage, and errors are free.

Can I use function calling with this API?

Yes, the API supports function calling via tools and tool_choice parameters. You can define tools in your request, and the model will respond with tool calls if appropriate. This works with the standard OpenAI-compatible client format.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

API facts in one table

Before you integrate, here is exactly what you get with a key.

ItemValue
CompatibilityOpenAI Chat Completions schema; official openai SDKs work unchanged
MethodsPOST /v1/chat/completions · GET /v1/models
Base URLhttps://api.minimaxapi.top/v1
Modeluncensored
AuthenticationAuthorization: Bearer YOUR_KEY
SSE streamingSupported (stream: true), usage included at the end
Max outputup to the rest of the 100,000-token window; max_tokens optional (no separate cap)
Structured outputresponse_format: {"type": "json_object"}
Context window100,000 tokens, input and output combined
Other parameterstemperature, top_p, stop, seed, presence_penalty, frequency_penalty
Function callingYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
Rate limit300 requests per minute per key
Request size8 MB request body
HeadersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Concurrency8 requests at the same time per key
Top-upcrypto: USDT on TRON or USDC on Base, $20–$500, any whole sum
Price$0.15 per 1M input tokens · $0.50 per 1M output tokens
Billingprepaid credit, charged by real token usage; errors and refusals are free
Bonus credit+5% on $50+, +10% on $100+, +15% on $200+
Credit expiryno monthly fee; paid credit does not expire
Trial credit$0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Sign-insign in with Google or with e-mail + password
Key managementone active key per account; a new key replaces the old one
Content policyuncensored for adults; the only hard rule: no sexual content involving minors

Error codes

Errors come back as JSON with a stable type; failed and refused requests are not billed.

CodeTypeMeaning
400bad_requestmalformed request or too long for the context window
401missing_key · invalid_key · key_revokedcheck the Authorization header or use your current key
402no_creditout of credit; add credit and retry
403content_blockedsexual content involving minors — refused, not billed
404not_foundunknown endpoint
413request_too_largerequest body larger than 8 MB
429rate_limited · concurrencyslow down: rate or parallel limit reached
503upstream_busymodel busy — retry in a few seconds