Developer documentation for the uncensored model

Get started with an uncensored LLM that speaks your language. This guide covers authentication, endpoints, and streaming for your NSFW API key.

Authentication and Base URL

The first step is obtaining your key. Sign up with a Google account or email. You receive a key immediately. No phone number required. Use the base URL https://api.nsfwapikey.com/v1 in your client. Replace the default sk-... with your new key. This works with standard OpenAI SDKs. The API requires no complex routing. It is a direct connection to the model.

First request

Send a POST request to /v1/chat/completions. Include your key in the authorization header. Set the model to uncensored. You can send simple text prompts. The response returns raw text without polite refusals. This works for creative or functional use cases. The endpoint is straightforward. No extra parameters are needed for basic text.

curl https://api.nsfwapikey.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Generate a JSON config for port 8080"}]
  }'

Python SDK integration

Use the official OpenAI Python package. Configure the base URL to point to our server. Pass your API key as the API key variable. Set the model ID to uncensored. This allows you to use familiar methods. You can send messages as a list. The response contains the generated text. Error handling is standard for HTTP clients. Stream or sync, your choice.

from openai import OpenAI

client = OpenAI(base_url="https://api.nsfwapikey.com/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 usage

Initialize the OpenAI client with your custom base URL. Pass the API key string. The client handles the HTTP requests. Set the model to uncensored. You can use the chat completions method. The response object contains the choices. Access the message content directly. This fits into any Node.js project. No extra middleware is required.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.nsfwapikey.com/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 and token usage

Enable streaming by setting stream: true. You receive chunks of text. Each chunk contains part of the response. The final chunk includes token usage data. This helps you track costs. The model outputs tokens sequentially. This reduces perceived latency. You can render text as it arrives. The SSE format is standard for OpenAI clients.

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

You have 300 requests per minute. The context window is 100,000 tokens. Max output is 16,000 tokens. Errors like 401 mean an invalid key. 402 means no credit. 429 means you hit the rate limit. Credit never expires. Refusals are free. Errors do not cost tokens. Use these codes to debug quickly. The system is transparent about usage.

FAQ

What is the context window size?

The context window is 100,000 tokens for prompt and completion combined. Max output is 16,000 tokens per request. This allows for long documents or conversations.

How do I handle API errors?

Use standard HTTP status codes. 401 indicates an invalid or missing key. 402 means your prepaid credit is exhausted. 429 signals you exceeded the 300 requests per minute limit. Errors and refusals do not consume tokens.

Is the NSFW API key free?

No, it is prepaid crypto. You pay $0.15 per 1M input tokens and $0.50 per 1M output tokens. Errors are free. You get $0.50 trial credit for 7 days.

Get your key now

Register, copy the key, update the base URL. That’s it.

Start now