Wan Uncensored: Prompts and scripts over one endpoint
Integrate the wan uncensored API into your creative pipeline with this quickstart guide. You will configure your client, send your first prompt, and handle streaming responses for real-time script generation.
https://api.wanuncensored.cc/v1uncensored
Prerequisites and Base URL
Before writing code, ensure you have an API key. Navigate to the Get API key page and sign in with Google or an email and password. Your key is displayed immediately and never expires.
All requests target the OpenAI-compatible base URL: https://api.wanuncensored.cc/v1. This URL works with standard SDKs by setting the base_url parameter. The model ID you must specify in every request is uncensored. This open-weight model runs on our servers and is tuned for content-agnostic text completion.
Make your first request
Start by sending a simple chat completion request. This confirms your authentication and token counting are working correctly. The endpoint expects a JSON body with the model name and message history.
curl https://api.wanuncensored.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."}]
}'Replace YOUR_API_KEY with the key generated on the dashboard. If the request succeeds, you will receive a JSON response containing the model's text output. Errors such as 401 indicate an invalid key, while 402 means your prepaid credit is exhausted.
Configure the Python SDK
For Python projects, use the official openai package. Install it via pip and initialize the client with your key and the correct base URL. This allows you to use familiar methods like chat.completions.create.
from openai import OpenAI
client = OpenAI(base_url="https://api.wanuncensored.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)The Python SDK handles the JSON serialization automatically. Ensure you pass the model parameter as uncensored. If you encounter a 429 error, you have exceeded the rate limit of 300 requests per minute. The SDK will raise an exception that you can catch and retry with exponential backoff.
Configure the Node SDK
Node.js developers should install the openai npm package. Set the apiKey and baseURL in the configuration object. This approach integrates cleanly with Express servers or serverless functions where you need to generate scripts or captions dynamically.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.wanuncensored.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);Pass model: 'uncensored' to the completion call. The SDK returns a Promise that resolves to the response object. If the request fails due to insufficient funds, check the error message for 402 status. You can top up your credit by crypto (USDT on TRC20, USDC on Base) directly from the dashboard.
Handle streaming responses
For longer scripts or real-time captioning, enable streaming by setting stream: true. The API returns data in chunks via Server-Sent Events (SSE). This reduces perceived latency for your users, as tokens are delivered as they are generated.
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)Iterate through the chunks to accumulate the final text. The last chunk in the stream contains token usage statistics, which are deducted from your prepaid balance. Streaming does not change the pricing; you still pay $0.15 per 1M input tokens and $0.50 per 1M output tokens. Errors during streaming are reported in the final error chunk.
Context windows and limits
Your total context window is 100,000 tokens, shared between the prompt and the completion. If you do not specify max_tokens, the response can run to the end of the window. This applies to both streaming and non-streaming responses.
Rate limits are set to 300 requests per minute per key, with a concurrency limit of 8 simultaneous requests. The request body must not exceed 8 MB. If you need to send larger payloads, consider chunking your text into multiple requests. Token usage is calculated precisely, and unused prepaid credit never expires.
API specifications
A quick checklist for developers: format, limits, features, billing.
| Spec | Value |
|---|---|
| API format | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Base URL | https://api.wanuncensored.cc/v1 |
| Model | uncensored |
| API key | Authorization: Bearer YOUR_KEY |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Sampling parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| Structured output | JSON object mode via response_format json_object |
| Context window | 100,000 tokens, input and output combined |
| Max output | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| SSE streaming | Supported (stream: true), usage included at the end |
| Tools / tool calls | Supported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages |
| Parallel requests | 8 requests at the same time per key |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Requests per minute | 300/min per key |
| Request size | 8 MB request body |
| Trial credit | $0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Billing | 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 |
| Volume bonus | +5% from $50, +10% from $100, +15% from $200 |
| Token prices | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Subscription | paid credit never expires, no subscription |
| Account | sign in with Google or with e-mail + password |
| Content policy | adult content allowed; sexual content involving minors is refused |
| Keys | one key per account, regenerate any time (the old one stops working) |
HTTP errors
Errors come back as JSON with a stable type; failed and refused requests are not billed.
| Code | Type | Meaning |
|---|---|---|
400 | bad_request | malformed request or too long for the context window |
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
Does the wan uncensored API generate images or video?
No. This API handles text completion only. It is designed for post-processing, script writing, and captioning in pipelines that use separate tools for video or image generation. We do not offer embeddings, fine-tuning, or media generation.
What happens if I hit the rate limit?
You will receive a 429 status code. The limit is 300 requests per minute and 8 concurrent requests per key. You can generate additional keys if you need higher throughput, though each account is limited to one active key at a time unless you replace it.
Is the trial credit renewable?
No. 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. After the trial expires or is used up, you must top up by crypto (USDT on TRC20, USDC on Base) to continue using the API.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.