EN ▾
Get API key

MiniMax NSFW: Switch your client in three lines

Connect your existing OpenAI-compatible client to our uncensored endpoint in minutes. This quickstart covers the base URL, authentication, and the core chat completions interface.

Base URL and Authentication

Our API is fully OpenAI-compatible. To switch, update your client's base_url to https://api.minimaxnsfw.top/v1 and provide your API key. You generate this key instantly on the Get API key page via Google or email. Each account holds one active key; issuing a new one invalidates the previous key immediately.

  • Endpoint: https://api.minimaxnsfw.top/v1
  • Authentication: Authorization: Bearer YOUR_API_KEY
  • Model ID: uncensored

No phone number or credit card is required to start. New users get $0.50 of trial credit, one per person.

First Request with cURL

Send your first completion to verify connectivity. The following example targets the standard chat endpoint using the uncensored model. Replace YOUR_API_KEY with your actual key from the dashboard.

curl https://api.minimaxnsfw.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."}]
  }'

This request demonstrates a simple text-in, text-out interaction. The response includes usage statistics in the final chunk if streaming is enabled, or in the standard completion object.

Python SDK Integration

Use the official openai Python library. Set the base URL to our endpoint and specify the model. This approach works for any Python client that supports the OpenAI protocol.

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": "user", "content": "Summarise this thread without softening it."}],
)
print(resp.choices[0].message.content)

The client handles retries and JSON parsing automatically. Ensure your openai package is up to date to support all features like function calling and streaming.

Node.js SDK Integration

Initialize the OpenAI client in Node.js by providing the API key and our base URL. This allows you to use familiar methods like chat.completions.create() without rewriting your integration logic.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.minimaxnsfw.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);

This setup is ideal for server-side applications or edge functions where you need reliable, uncensored text generation without modifying your existing client code structure.

Streaming Responses

Enable streaming by setting stream: true in your request. The API returns a Server-Sent Events (SSE) stream. Token usage details are provided in the final chunk of the stream.

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)

Streaming reduces perceived latency for long outputs. It is particularly useful for chat interfaces where users expect to see text appearing in real-time. The API supports this natively without extra configuration.

Limits, Errors, and Context Window

The model supports a 100,000 token context window (prompt + completion). There is no separate output cap (if max_tokens is unset, the response can run to the end of the window). You are limited to 300 requests per minute and 8 concurrent requests per key.

Error handling is straightforward. A 401 status indicates your API key is invalid or no longer active. A 402 status signals that your prepaid credit is exhausted. A 429 status means you have exceeded the rate limit. Errors and refusals consume no credit, so you are only charged for successful token generation.

Under the hood: specs

Use this table to decide whether the API fits your project before you buy credit.

FeatureSupport
CompatibilityOpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key
EndpointsPOST /v1/chat/completions · GET /v1/models
AuthenticationAuthorization: Bearer YOUR_KEY
Base URLhttps://api.minimaxnsfw.top/v1
Modeluncensored
Other parameterstemperature, top_p, stop, seed and the two penalties are passed through
Structured outputJSON object mode via response_format json_object
Tools / tool callsYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
StreamingYes — server-sent events; the last chunk carries token usage
Max outputprompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap
Max context100,000 tokens, input and output combined
Rate limit300/min per key
Concurrencyup to 8 in parallel per key
HeadersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Max body8 MB request body
Bonus credit+5% on $50+, +10% on $100+, +15% on $200+
Top-upUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
Token prices$0.15 per 1M input tokens · $0.50 per 1M output tokens
Subscriptionno monthly fee; paid credit does not expire
How you payprepaid credit, charged by real token usage; errors and refusals are free
Free trial$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
Content policyadult content allowed; sexual content involving minors is refused
AccountGoogle or e-mail and password
Key managementone key per account, regenerate any time (the old one stops working)

HTTP errors

The type field is stable, the message is for humans. Errors cost nothing.

HTTPTypeWhat to do
400bad_requestinvalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend
401missing_key · invalid_key · key_revokedno key, wrong key, or a key replaced by a newer one
402no_creditbalance is empty — top up, requests resume at once
403content_blockedrefused by the content policy
404not_foundunknown endpoint
413request_too_largerequest body larger than 8 MB
429rate_limited · concurrencyover 300/min or 8 parallel — back off and retry
503upstream_busymodel busy — retry in a few seconds

Questions and answers

Does the API key expire?

Your prepaid credit never expires. However, each account holds only one active key at a time; generating a new key immediately invalidates the previous one. Keys do not have a fixed expiration date independent of your account status.

What happens when I run out of credit?

The API returns a 402 status code when your balance is insufficient. No credit is charged for requests that fail due to model errors or refusals, so your balance is preserved until you top up via crypto.

Is the context window 100,000 tokens for input only?

No. The 100,000 token limit applies to the combined total of input tokens (prompt) and output tokens (completion). A single output can run to the end of the window unless you specify a lower max_tokens value.

Your key is one form away

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