EN ▾
Get API key

NSFW Model: Integrate the Uncensored LLM API

Get started with the uncensored LLM API in minutes by pointing your existing OpenAI SDKs to our base URL and authenticating with your new API key.

Base URL and Authentication

Integration begins by setting your base URL to https://api.nsfwmodel.cc/v1. The service uses standard API key authentication via the Authorization header. You receive your key immediately after signing up with Google or an email address. There are no monthly fees or subscriptions; credit is prepaid and charged by real token usage. Errors and refusals do not consume your balance, making it efficient for testing.

Your First Request

Send a POST request to /v1/chat/completions with the model ID uncensored. This endpoint returns text completions based on your prompt. The model is open-weight and tuned to answer without content refusals for lawful adult use, security research, or controversial topics. It does not refuse based on standard political or social filters.

The request structure mirrors the OpenAI API standard, ensuring drop-in compatibility with your existing codebase.

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

Verify the response includes the generated text in the choices array. If you receive a 401, check your key. A 402 indicates insufficient credit, and a 429 means you hit the rate limit.

Python SDK Integration

Use the official OpenAI Python SDK to interact with the API. Set the base_url and api_key attributes before creating the client instance. This allows you to use familiar methods like chat.completions.create without modifying your logic significantly.

Pass the model name uncensored in your calls. The SDK handles serialization and parsing of JSON responses automatically. Streaming is supported via the stream parameter, which returns an iterator of chunks.

from openai import OpenAI

client = OpenAI(base_url="https://api.nsfwmodel.cc/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)

This approach works for both synchronous and asynchronous applications, providing flexibility for different use cases.

Node SDK Integration

For JavaScript and TypeScript developers, the OpenAI Node SDK offers similar ease of integration. Configure the client with the correct base URL and API key. The uncensored model ID is used in all chat completion requests.

The SDK supports streaming responses, which is essential for real-time applications. You can handle events as they arrive, updating the UI incrementally. Error handling is standard, catching network issues or API limits.

import OpenAI from "openai";

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

Ensure your environment supports the required Node version for the SDK. The integration is straightforward, requiring minimal boilerplate code.

Streaming Responses via SSE

Enable streaming by setting the stream parameter to true. The API returns Server-Sent Events (SSE) containing partial text chunks. This reduces perceived latency for users, as tokens are delivered as soon as they are generated.

Each chunk includes metadata like usage statistics in the final chunk. This allows you to track token consumption in real-time. Streaming is ideal for chat interfaces and real-time data visualization.

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)

Handle the stream events to update your application state. Ensure your client can handle partial JSON if parsing is required.

Limits, Errors, and Context Window

The context window is 100,000 tokens total, with no separate output cap per request. If max_tokens is not set, the response can run to the end of the window. Rate limits are 300 requests per minute and 8 concurrent requests per key. Request bodies are limited to 8 MB.

Common errors include 401 (invalid key), 402 (no credit), and 429 (rate limit). Credit never expires, and mistakes like double charges are fixed via Support. The model refuses sexual content involving minors. Use the API for lawful adult content, coding, and research.

Questions and answers

Does the uncensored model refuse controversial topics?

No, the model is tuned to answer without content refusals for lawful adult, fictional, or controversial topics. It does not apply standard political or social filters, making it ideal for unrestricted generation.

What is the maximum output length?

You can request output up to the end of the window. If you do not specify max_tokens, the response can run to the end of the window. The total context window is 100,000 tokens.

Can I use my existing OpenAI SDKs?

Yes, the API is OpenAI-compatible. You only need to update the base_url and api_key in your SDK configuration. The model ID is uncensored.

Your key is one form away

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

Specs at a glance

The numbers below are the real limits of this API, not marketing. Compare them with what your app needs.

ItemValue
API formatOpenAI Chat Completions schema; official openai SDKs work unchanged
EndpointsPOST /v1/chat/completions · GET /v1/models
Base URLhttps://api.nsfwmodel.cc/v1
Modeluncensored
AuthenticationBearer token in the Authorization header
Context window100,000 tokens (prompt + completion together)
SSE streamingYes — server-sent events; the last chunk carries token usage
Sampling parameterstemperature, top_p, stop, seed and the two penalties are passed through
Max outputprompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap
JSON modeJSON object mode via response_format json_object
Tools / tool callsSupported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages
HeadersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Parallel requests8 requests at the same time per key
Requests per minute300 requests per minute per key
Max body8 MB request body
Billingpay as you go from prepaid credit; nothing is charged for failed or refused requests
Subscriptionpaid credit never expires, no subscription
Free trial$0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Bonus credit+5% from $50, +10% from $100, +15% from $200
Top-upUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
Token pricesinput $0.15 / 1M tokens, output $0.50 / 1M tokens
Content policyadult content allowed; sexual content involving minors is refused
Key managementone active key per account; a new key replaces the old one
Accountsign in with Google or with e-mail + password

HTTP errors

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

StatusTypeReason
400bad_requestmalformed request or too long for the context window
401missing_key · invalid_key · key_revokedno key, wrong key, or a key replaced by a newer one
402no_creditout of credit; add credit and retry
403content_blockedsexual content involving minors — refused, not billed
404not_foundonly /v1/chat/completions and /v1/models exist
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