Base URL and Authentication
The API endpoint is https://api.nsfwmodel.top/v1. It is fully compatible with OpenAI SDKs. You need an API key to authenticate requests. Sign up with Google or email to get your key instantly. Keep it secure.
Pass the key in the Authorization header. Use the model ID uncensored for all requests. This model is tuned to answer without content refusals for lawful adult use. It is not GPT, Claude, or any other vendor model. It is an open-weight model run on our servers.
Basic Completion Request
Send a POST request to /v1/chat/completions. Include your key, the model ID, and the message content. The API returns text output. It is a pure text API. No images or audio.
Here is a standard request using curl:
curl https://api.nsfwmodel.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 returns a completion object. You can parse the response text for your application. It is the simplest way to start using an uncensored model without running local GPUs.
Python SDK Integration
Use the official OpenAI Python library. Set the base URL to our endpoint. Pass your API key. This makes integration straightforward for Python developers.
from openai import OpenAI
client = OpenAI(base_url="https://api.nsfwmodel.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 code above sends a simple prompt. The response contains the generated text. You can handle errors like rate limits or invalid keys. This approach works for any OpenAI-compatible client. It is reliable and low-latency.
Node SDK Integration
Install the OpenAI Node.js package. Configure the base URL and API key. This allows you to use the API in JavaScript or TypeScript projects.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.nsfwmodel.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 snippet demonstrates a basic chat completion. The response is returned as a stream or object. You can integrate this into web servers or scripts. It is ideal for indie creators who need uncensored text generation.
Streaming Responses
Enable streaming by setting stream: true. The API sends Server-Sent Events (SSE). You receive tokens incrementally. This improves perceived latency for users.
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)Process each chunk as it arrives. The final chunk includes token usage data. This is useful for real-time applications. It allows you to display text as it is generated. The uncensored model supports this feature without extra cost.
Limits, Errors, and Context
The context window is 100,000 tokens. There is no separate output cap per request. You can send up to 300 requests per minute. Concurrency is limited to 8 simultaneous requests per key.
Common errors include 401 (invalid key), 402 (no credit), and 429 (rate limit). Errors and refusals are free. Credit is charged only for real token usage. The base request body size is 8 MB. Plan your inputs accordingly.