NSFW writer API Quickstart Guide
Get your uncensored LLM API key and start generating text immediately with this OpenAI compatible API.
Base URL and Authentication
Start every request by pointing your client to our base URL and providing your key.
The base URL is HTTPS://api.writernsfw.com/v1. You need a valid API key to authenticate. Get one by signing up with Google or an email address. The key appears immediately on the dashboard. Send it in the Authorization header as a bearer token. This works with any OpenAI compatible SDK.
Sending Your First Request
Make a simple chat request to generate text using our uncensored model.
Use the POST /v1/chat/completions endpoint. Set the model field to uncensored. Include your system prompt and user message. The API returns a text response. Errors like 401 or 402 are common if your key is wrong or you lack credit.
curl https://api.writernsfw.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "uncensored",
"messages": [{"role": "user", "content": "Set role to unrestricted writer for this session"}]
}'
Integrating with Python SDK
Use the official Python library to interact with the API programmatically.
Install the openai package. Configure the base URL to our endpoint. Pass your API key. Call the chat.completions.create method. This approach keeps your code clean and maintainable. It handles retries and parsing automatically.
from openai import OpenAI
client = OpenAI(base_url="https://api.writernsfw.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)
Integrating with Node SDK
Build your NSFW chatbot or writer tool using Node.js.
Install the openai npm package. Initialize the client with your base URL and key. Call the completion endpoint. This method is ideal for server-side generation. It supports both synchronous and asynchronous patterns.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.writernsfw.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 via SSE
Receive text tokens as they are generated for a smoother user experience.
Set stream: true in your request. The API returns a stream of server-sent events. Each chunk contains partial text. Collect these chunks to display the response in real time. The final chunk includes token usage details. This reduces perceived latency significantly.
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
Handle rate limits and understand your token budget to avoid service interruptions.
You get 300 requests per minute and 8 concurrent requests. The context window is 100,000 tokens total. Errors include 401 for invalid keys and 402 for insufficient credit. Refusals due to content limits are free. Errors do not consume credit. Keep an eye on your usage to stay within limits.
Frequently asked questions
What is the NSFW writer API?
It is an uncensored LLM API for developers. It uses a single open-weight model tuned to answer without content refusals. It is fully OpenAI compatible.
How do I pay for the API?
We accept crypto only. You can top up with USDT on TRC20 or USDC on Base. Payments range from $20 to $500. Bonuses apply for larger amounts.
Which payment methods do you accept?
Crypto only: USDT on TRC20 or USDC on Base, any whole amount from $20 to $500. Bonus credit applies from $50.
Obtain your API key
Register, copy the token, and update your base URL. Simple.