Quickstart for Wan NSFW pipelines
This quickstart guides you through integrating the Wan NSFW uncensored LLM API into your text-heavy AI pipelines. Use the standard OpenAI-compatible endpoints to generate raw text, scripts, or prompts without content refusals.
Authentication & Base URL
The API uses standard Bearer token authentication. Your API key is generated immediately after signing up with Google or an email address on the Get API key page. One active key is allowed per account; generating a new key replaces the previous one. All requests must point to the base URL https://api.wannsfw.com/v1.
Include the header Authorization: Bearer YOUR_API_KEY in every request. The model identifier you must send is uncensored. This is an open-weight model run on our servers, tuned for lawful adult use without content refusals. It is not GPT, Claude, or any other vendor's model. The account requires only an email address, and prompts are not used for training.
Ensure your requests stay under the 8 MB body limit. The API serves a single model, so there is no model routing or vendor selection involved.
Basic Chat Completion Request
Send a POST request to /v1/chat/completions with the model uncensored. The API returns text output based on your input prompt. You can control the response behavior using parameters like temperature, top_p, stop, and seed.
The context window supports 100,000 tokens total (prompt + completion). If you do not set max_tokens, the response can run to the end of the window. This is useful for generating long scripts, detailed prompts, or extensive post-processing text.
Use the following cURL command to test the basic integration.
curl
Python SDK Integration
For developers using Python, the official OpenAI SDK works directly by pointing it to our base URL. This allows you to use familiar methods like client.chat.completions.create() while benefiting from the uncensored nature of the Wan NSFW model.
Install the standard library and set the base_url and api_key in your configuration. This approach is ideal for backend services that need to generate text for AI pipelines, such as script writing or prompt extraction. The SDK handles the JSON serialization and HTTP communication for you.
Configure the client as shown in the example below.
python
Node SDK Integration
JavaScript and TypeScript developers can also use the official OpenAI SDK. Set the baseURL to https://api.wannsfw.com/v1 and provide your API key. This enables seamless integration into Node.js applications that require raw text generation.
The SDK supports all standard parameters, including function calling and JSON mode. This is particularly useful for extracting structured data from text or generating prompts for other AI tools in your pipeline. The uncensored model ensures that your text generation is not interrupted by content filters.
Initialize the client and make a request as demonstrated here.
node
Streaming Responses (SSE)
Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) with incremental chunks of text. This is useful for real-time text generation in applications or for monitoring the progress of long completions.
Token usage information is provided in the last chunk of the stream. This allows you to track costs and context window usage accurately. Streaming helps reduce perceived latency for users, especially when generating long scripts or detailed prompts.
Handle the stream as shown in the example below.
stream
Limits, Errors, and Context
Each API key is limited to 300 requests per minute and 8 concurrent requests. The request body must not exceed 8 MB. If you exceed these limits, the API will reject the request. You can monitor your usage and manage your account via the dashboard.
Account credit is charged based on real token usage. Errors and refusals are free. If you run out of credit, you will need to top up via crypto (USDT on TRC20 or USDC on Base). The trial credit of $0.50 is valid for 7 days and requires no card. Claim this credit with one click on your API key page. Credit never expires.
cURL
curl https://api.wannsfw.com/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."}]
}'Python
from openai import OpenAI
client = OpenAI(base_url="https://api.wannsfw.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.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.wannsfw.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
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)Specs at a glance
Use this table to decide whether the API fits your project before you buy credit.
| Feature | Support |
|---|---|
| Compatibility | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Base URL | https://api.wannsfw.com/v1 |
| Endpoints | POST /v1/chat/completions · GET /v1/models |
| Authentication | Authorization: Bearer YOUR_KEY |
| Model | uncensored |
| Max output | up to the rest of the 100,000-token window; max_tokens optional (no separate cap) |
| Max context | 100,000 tokens (prompt + completion together) |
| Function calling | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Sampling parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| Streaming | Yes — server-sent events; the last chunk carries token usage |
| JSON mode | JSON object mode via response_format json_object |
| Parallel requests | up to 8 in parallel per key |
| Max body | 8 MB request body |
| Rate limit | 300 requests per minute per key |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Price | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Credit expiry | paid credit never expires, no subscription |
| Volume bonus | +5% from $50, +10% from $100, +15% from $200 |
| How you pay | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Payment | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Trial credit | $0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Keys | one key per account, regenerate any time (the old one stops working) |
| Sign-in | sign in with Google or with e-mail + password |
| Content | uncensored for adults; the only hard rule: no sexual content involving minors |
HTTP errors
The type field is stable, the message is for humans. Errors cost nothing.
| HTTP | Type | What to do |
|---|---|---|
400 | bad_request | invalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend |
401 | missing_key · invalid_key · key_revoked | no key, wrong key, or a key replaced by a newer one |
402 | no_credit | balance is empty — top up, requests resume at once |
403 | content_blocked | refused by the content policy |
404 | not_found | unknown endpoint |
413 | request_too_large | body over 8 MB |
429 | rate_limited · concurrency | over 300/min or 8 parallel — back off and retry |
503 | upstream_busy | model busy — retry in a few seconds |
Questions and answers
What is the cost of the API?
The API costs $0.15 per 1M input tokens and $0.50 per 1M output tokens. Credit is prepaid and never expires. Top-ups are available via crypto (USDT or USDC) from $20 to $500, with bonuses for larger amounts.
Does the API support function calling?
Yes, the API supports function calling (tools and tool_choice). You can define tools in your request and the model will return structured data if needed. This is useful for integrating text generation with other parts of your AI pipeline.
Is there a free trial?
Yes, new users get $0.50 of trial credit valid for 7 days, one per person. Claim this credit with one click on your API key page. No credit card is required to start. You can sign up using Google or an email address to get your API key immediately.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.