EN ▾
Get API key

Quickstart for NSFW Wan pipelines

Integrate the uncensored text API into your NSFW Wan media pipelines with this quickstart guide. Use the OpenAI-compatible endpoints to generate prompts, scripts, or metadata for your video and image workflows.

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/completions endpoint 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);

API specifications

One table with every limit, feature and price that applies to your key.

SpecValue
ProtocolOpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key
Base URLhttps://api.nsfwwan.cc/v1
MethodsPOST /v1/chat/completions · GET /v1/models
AuthenticationBearer token in the Authorization header
Model IDuncensored
Function callingSupported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages
Max context100,000 tokens (prompt + completion together)
StreamingYes — server-sent events; the last chunk carries token usage
Max outputprompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap
JSON modeJSON object mode via response_format json_object
Other parameterstemperature, top_p, stop, seed, presence_penalty, frequency_penalty
Concurrencyup to 8 in parallel per key
HeadersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Max bodyup to 8 MB per request
Requests per minute300/min per key
Priceinput $0.15 / 1M tokens, output $0.50 / 1M tokens
Bonus credit+5% on $50+, +10% on $100+, +15% on $200+
Top-upcrypto: USDT on TRON or USDC on Base, $20–$500, any whole sum
Billingprepaid credit, charged by real token usage; errors and refusals are free
Free trial$0.50 for 7 days, no card · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up
Subscriptionno monthly fee; paid credit does not expire
Key managementone active key per account; a new key replaces the old one
Accountsign in with Google or with e-mail + password
Content policyadult content allowed; sexual content involving minors is refused

Errors and what to do

Errors come back as JSON with a stable type; failed and refused requests are not billed.

CodeTypeMeaning
400bad_requestinvalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend
401missing_key · invalid_key · key_revokedcheck the Authorization header or use your current key
402no_creditout of credit; add credit and retry
403content_blockedsexual content involving minors — refused, not billed
404not_foundonly /v1/chat/completions and /v1/models exist
413request_too_largerequest body larger than 8 MB
429rate_limited · concurrencyslow down: rate or parallel limit reached
503upstream_busytemporary overload, retry shortly

Questions and answers

Does the API key expire?

No, your prepaid credit never expires, so your API key remains valid indefinitely. The only reason a key might stop working is if you generate a new one, which replaces the old active key, or if the key is manually revoked.

Are errors billed?

Errors and refusals are free. However, the fact sheet states that mistakes such as a double charge are fixed through the Support page, implying that while rare, billing errors can occur and are not automatically guaranteed to be zero for all network failures.

What is the maximum output length?

There is no separate output cap. If you do not set the max_tokens parameter, the response can run to the end of the window. The total context window (input + output) is 100,000 tokens.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.

Get API key