Prerequisites and Base URL
To start using the NSFW Wan API, you need an API key. Sign up via Google or email on the Get API key page to receive your key immediately. No phone number is required. The API is hosted at https://api.nsfwwan.cc/v1. This base URL works with any standard OpenAI SDK or HTTP client by updating the base_url configuration.
- Model ID: Send requests to the model named
uncensored. - Compatibility: The API follows the standard
/v1/chat/completionsendpoint structure. - Requirements: You only need an email address for the account; prompts are not used for training.
Authentication with API Key
Include your API key in the Authorization header of every request. The format is Bearer YOUR_API_KEY. If the key is invalid, the API returns a 401 error. Unlike some services, our prepaid credit never expires, so an active key with sufficient balance will remain valid indefinitely until you choose to revoke it.
Your account allows one active key at a time; generating a new key replaces the old one. Ensure you store your key securely, as it provides direct access to your prepaid credits.
Basic Chat Completion Request
Send a standard chat completion request to generate text. The API accepts standard parameters like temperature, top_p, and stop. The model is uncensored, meaning it will answer lawful adult, fictional, or controversial topics without refusal, except for content involving minors which is always blocked.
Below is a basic example using cURL to generate a script snippet for an NSFW Wan video pipeline.
curl https://api.nsfwwan.cc/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."}]
}'The API returns a JSON object containing the generated text. Errors and refusals are free, but network errors during transmission might not always be billed depending on the specific failure mode.
Streaming Responses (SSE)
For real-time output, use Server-Sent Events (SSE). Streaming is essential for integrating text generation into interactive media workflows. The API streams tokens as they are generated, allowing you to process text incrementally.
The final chunk of the stream contains the total token usage for the request. This allows you to track costs in real-time without waiting for the full response.
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)Use this method when building dynamic prompt generators or real-time metadata extractors for your NSFW Wan pipelines.
Function Calling and JSON Mode
Structured output is critical for pipeline automation. Use response_format: {"type": "json_object"} to force the model to return valid JSON. This is ideal for extracting metadata, generating structured scripts, or passing data between media stages.
You can also use function calling (tools) to let the model decide which function to invoke based on the input. This is useful for complex decision-making in your NSFW Wan workflow, such as determining the appropriate captioning style or script length based on video content.
Rate Limits and Parameters
Each API key is limited to 300 requests per minute and 8 concurrent requests. The maximum request body size is 8 MB. The context window is 100,000 tokens, with no separate output cap (if max_tokens is not set, the response can run to the end of the window).
Error Codes:
401: Invalid API key.402: Insufficient credit.429: Rate limit exceeded.
If you encounter a double charge due to a mistake, contact Support. Mistakes are fixed through the Support page; credits are not automatically refunded but are adjusted manually.
Python
from openai import OpenAI
client = OpenAI(base_url="https://api.nsfwwan.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)Node.js
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.nsfwwan.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);