NSFW TopQuickstart: integrate the nsfw top API
Quickstart: integrate the nsfw top API
Integrate the uncensored LLM API with a single base URL and standard OpenAI-compatible endpoints. Get started immediately with your API key and see how requests behave in your preferred language.
uncensoredhttps://api.nsfwtop.cc/v1
Base URL and authentication
The NSFW top API uses a single base URL for all requests. Change the base URL in your OpenAI SDK configuration to https://api.nsfwtop.cc/v1. Pass your API key in the Authorization header. You receive one active key per account. The key appears immediately after signup via Google or email.
curl https://api.nsfwtop.cc/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "list all api endpoints"}]
}'Every request requires this header. If the key is missing or invalid, the API returns a 401 error. Your prompts are not used for training. No phone number is required to start.
First request with Python
Send a chat completion request using the official OpenAI Python SDK. Configure the client with the custom base URL and your API key. Use the model ID uncensored for responses without standard content refusals.
from openai import OpenAI
client = OpenAI(base_url="https://api.nsfwtop.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)Set the max_tokens parameter to control output length. The default max output is 2,048 tokens if you do not specify a limit. Input and output tokens count toward your 100,000 token context window.
Node SDK integration
Use the OpenAI Node SDK to integrate the API into your JavaScript or TypeScript applications. Initialize the client with the baseURL pointing to the NSFW top endpoint. Pass your API key as the apiKey value.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.nsfwtop.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);Call chat.completions.create() with the model uncensored. The response includes the generated text and token usage details. You can stream responses or receive them all at once depending on your use case.
Streaming responses with SSE
Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) as tokens are generated. This reduces perceived latency for long responses. Process the stream to display text incrementally.
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)The final chunk in the stream contains the total token usage for the request. You can track cost and context usage in real time. Streaming works with all parameters like temperature and top_p.
JSON mode and function calling
Force structured output by setting response_format to {"type": "json_object"}. This ensures the model returns valid JSON instead of free text. Use this for parsing data or integrating with other systems.
Function calling is supported via the tools parameter. Define functions in the tools array. The model can call these functions and return structured arguments. Use tool_choice to control when functions are invoked.
Rate limits and constraints
The API enforces a limit of 300 requests per minute per key. You can have up to 8 concurrent requests simultaneously. The maximum request body size is 8 MB. Exceeding these limits results in a 429 error. Wait before retrying or upgrade your credit usage.
If you have no credit, requests return a 402 error. Errors and refusals do not consume tokens. The context window allows 100,000 tokens total for prompt and completion. Manage your token usage carefully to avoid unexpected charges.
Frequently asked questions
What is the NSFW top API base URL?
The base URL is HTTPS://api.nsfwtop.cc/v1. It is compatible with standard OpenAI SDKs. Change the base URL in your client configuration to use it.
How do I pay for the API?
You can top up credit using crypto. We accept USDT on TRC20 or USDC on Base. Minimum top-up is $20. Credit never expires and is charged by real token usage.
What happens if I get a 401 error?
A 401 error means your API key is invalid or missing. Check your key in the dashboard. Generate a new key if the old one was revoked. Each account has one active key at a time.
Your API key is almost ready
Register, copy your key, update the base URL. That covers the entire configuration.