Get API key
  1. Nsfwchat
  2. Quickstart: Integrate the Uncensored LLM

Quickstart: Integrate the Uncensored LLM

Integrate our uncensored LLM API into your application using standard OpenAI-compatible endpoints. This quickstart covers authentication, basic requests, streaming, and function calling to help you generate high-volume text without content refusals.

Base URL & Auth

Our API follows the OpenAI chat-completions standard, allowing you to use existing SDKs with minimal configuration. The base URL is https://api.nsfwchat.cc/v1. Authentication is handled via the Authorization header using your API key, which is generated immediately upon signup via Google or email.

No model routing or complex setup is required. You send requests to this endpoint, and the system routes them to our uncensored model identified as uncensored. This model is tuned to answer without refusals for lawful adult content, making it ideal for nsfw chat applications or unrestricted creative writing bots.

Chat Completions

Send text inputs and receive generated text responses. The endpoint supports standard parameters like temperature, top_p, and stop sequences. Ensure your payload includes the model ID uncensored. The context window is 64,000 tokens total, with a maximum output of 16,000 tokens per request.

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."}]
  }'

If you need structured data, you can enforce JSON output using the response_format parameter. This is particularly useful for integrating the API into backend services that require deterministic parsing. Remember that errors and refusals do not consume your prepaid credit, reducing the cost of experimentation.

Python SDK Integration

Use the official OpenAI Python library to interact with our API. Initialize the client with your API key and the correct base URL. This approach simplifies request construction and response handling, allowing you to focus on logic rather than HTTP details. The SDK automatically handles serialization and deserialization of the JSON responses.

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)

The uncensored model responds to standard chat messages. You can pass multiple messages in the messages list to maintain conversation history. The API supports up to 64,000 tokens of context, enabling long conversations or large document processing within a single session. Ensure you manage memory usage if processing large contexts frequently.

Node SDK Integration

For JavaScript and TypeScript projects, the OpenAI Node SDK provides a straightforward integration path. Configure the client with your API key and the nsfwchat base URL. This allows you to embed the LLM directly into web servers or Node.js applications without building custom HTTP clients.

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);

The SDK supports asynchronous operations, which is essential for maintaining high throughput in Node.js environments. You can stream responses or retrieve full completions in one go. The uncensored model handles diverse topics, making it suitable for character-driven apps or content generation tools that require minimal moderation filtering.

Streaming Responses

Stream responses using Server-Sent Events (SSE) for lower latency and better user experience. Streaming is enabled by setting stream: true in your request. The API returns chunks of text as they are generated, allowing you to display results in real-time. Token usage statistics are included in the final chunk.

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)

This method is ideal for chat interfaces where users expect immediate feedback. Each chunk contains a portion of the generated text, and the final chunk includes the total token counts. Streaming reduces perceived latency, especially for longer responses, and is fully compatible with the uncensored model's output format.

Rate Limits & Errors

Each API key is limited to 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB. If you exceed these limits, the API returns a 429 Too Many Requests error. Other common errors include 401 for invalid keys and 402 for insufficient credit.

Credit is charged based on real token usage, so errors do not incur costs. If you encounter issues, check your account balance or request limits. The uncensored AI API is designed for high-volume use, but adhering to these limits ensures stable performance. Use exponential backoff in your client to handle transient rate limits gracefully.

Questions and answers

How do I top up my API credit?

You can top up using USDT (TRC20) or USDC (Base). Minimum top-up is $10, and there are bonuses for larger amounts: +5% for $50+ and +10% for $100+. Credit never expires.

Is there a free trial?

Yes, every new account receives $0.50 in trial credit valid for 7 days. No credit card is required to start, and you can sign up using Google or email.

What is the context window size?

The model supports a 64,000-token context window, including both prompt and completion tokens. The maximum output per request is 16,000 tokens, or 2,048 tokens if <code>max_tokens</code> is not specified.

Your key is one form away

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