EN ▾
Get API key

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.

FeatureSupport
CompatibilityOpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key
Base URLhttps://api.wannsfw.com/v1
EndpointsPOST /v1/chat/completions · GET /v1/models
AuthenticationAuthorization: Bearer YOUR_KEY
Modeluncensored
Max outputup to the rest of the 100,000-token window; max_tokens optional (no separate cap)
Max context100,000 tokens (prompt + completion together)
Function callingYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
Sampling parameterstemperature, top_p, stop, seed, presence_penalty, frequency_penalty
StreamingYes — server-sent events; the last chunk carries token usage
JSON modeJSON object mode via response_format json_object
Parallel requestsup to 8 in parallel per key
Max body8 MB request body
Rate limit300 requests per minute per key
Response headersX-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 expirypaid credit never expires, no subscription
Volume bonus+5% from $50, +10% from $100, +15% from $200
How you paypay as you go from prepaid credit; nothing is charged for failed or refused requests
Paymentcrypto: 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
Keysone key per account, regenerate any time (the old one stops working)
Sign-insign in with Google or with e-mail + password
Contentuncensored 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.

HTTPTypeWhat to do
400bad_requestinvalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend
401missing_key · invalid_key · key_revokedno key, wrong key, or a key replaced by a newer one
402no_creditbalance is empty — top up, requests resume at once
403content_blockedrefused by the content policy
404not_foundunknown endpoint
413request_too_largebody over 8 MB
429rate_limited · concurrencyover 300/min or 8 parallel — back off and retry
503upstream_busymodel 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.