EN ▾
Get API key
  1. Nsfwchat
  2. NSFW Chat: Quickstart: Integrate the Uncensored LLM

NSFW Chat: Quickstart: Integrate the Uncensored LLM

Integrate our uncensored LLM API using standard OpenAI-compatible endpoints. This quickstart covers authentication, request formats, and streaming for high-volume text generation.

Base URL & Auth

Use the dedicated base URL for all requests. Authentication relies on a single API key generated during signup. Include the key in the Authorization header as a Bearer token. Your key is displayed immediately after creation. Each account holds one active key; generating a new one replaces the old.

The base URL is: https://api.nsfwchat.cc/v1. No additional routing or proxy layers are required. This setup works with any OpenAI-compatible client by adjusting the base URL and API key.

Chat Completions

Send text prompts to the POST /v1/chat/completions endpoint. The model ID is uncensored. This endpoint accepts standard chat messages and returns generated text. It does not support embeddings, images, or audio. The model is tuned for uncensored responses to lawful adult content.

Ensure your payload includes the model ID and message history. The API processes text input and returns text output directly.

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

Python SDK

Use the official OpenAI Python SDK for integration. Set the base_url to our API endpoint and provide your API key. The SDK handles serialization and error parsing automatically. Configure parameters like temperature and top_p to control output randomness.

Initialize the client with your key and base URL. Call chat.completions.create() with the model ID and messages. This approach reduces boilerplate code for simple text generation tasks.

from openai import OpenAI

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

Node SDK

The Node.js OpenAI SDK works identically to the Python version. Configure the client with the custom base URL and your API key. Use the chat.completions.create method to send requests.

This method is ideal for server-side integrations. The SDK manages connection pooling and retries. Set the model to uncensored to ensure uncensored responses. Pass messages as an array of role and content objects.

import OpenAI from "openai";

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

Streaming Responses

Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE). Each chunk contains partial text. Token usage details appear in the final chunk.

Streaming reduces perceived latency for long outputs. Process each chunk sequentially to reconstruct the full response. This method is essential for real-time UI updates. Handle errors within the stream events to maintain connection stability.

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)

Rate Limits & Errors

Respect the rate limits to avoid service disruption. The API allows 300 requests per minute and 8 concurrent requests per key. The maximum request body size is 8 MB. A 401 status indicates an invalid or missing API key. A 429 status indicates you have exceeded the rate limit.

The context window is 100,000 tokens for prompt and completion combined. If you exceed this limit, the request will be rejected. There is no truncation; ensure your input fits within the window. A 402 status indicates insufficient prepaid balance. Errors and refusals do not consume credit.

What the API supports

If your tool speaks the OpenAI API, these are the details that matter.

ParameterDetails
CompatibilityOpenAI Chat Completions schema; official openai SDKs work unchanged
Modeluncensored
AuthenticationAuthorization: Bearer YOUR_KEY
Base URLhttps://api.nsfwchat.cc/v1
MethodsPOST /v1/chat/completions · GET /v1/models
Structured outputresponse_format: {"type": "json_object"}
Max context100,000 tokens, input and output combined
StreamingSupported (stream: true), usage included at the end
Other parameterstemperature, top_p, stop, seed, presence_penalty, frequency_penalty
Tools / tool callsYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
Max outputprompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap
Max body8 MB request body
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Concurrency8 requests at the same time per key
Requests per minute300 requests per minute per key
Credit expiryno monthly fee; paid credit does not expire
Billingpay as you go from prepaid credit; nothing is charged for failed or refused requests
PaymentUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
Trial credit$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% on $50+, +10% on $100+, +15% on $200+
Priceinput $0.15 / 1M tokens, output $0.50 / 1M tokens
Key managementone key per account, regenerate any time (the old one stops working)
Accountsign in with Google or with e-mail + password
Contentuncensored for adults; the only hard rule: no sexual content involving minors

Error reference

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

CodeTypeMeaning
400bad_requestinvalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend
401missing_key · invalid_key · key_revokedcheck the Authorization header or use your current key
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 · concurrencyslow down: rate or parallel limit reached
503upstream_busytemporary overload, retry shortly

Questions and answers

Does the API support function calling?

Yes, the API supports function calling via the tools and tool_choice parameters. You can define tools in your request and the model will return structured JSON for tool use. This feature works with standard OpenAI-compatible clients.

What is the context window size?

The context window is 100,000 tokens, combining both the prompt and the completion. There is no separate output cap per request, and if max_tokens is not set, the response can run to the end of the window. Requests exceeding this window are rejected.

How are errors handled?

Error responses include a status code and a message. A 401 code means the API key is invalid. A 429 code means you have hit the rate limit. A 402 code indicates insufficient prepaid balance. Errors do not consume your token credit.

Your key is one form away

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

Read the docs