EN ▾
Get API key

First request in five minutes

Connect your existing OpenAI SDK client to our uncensored LLM API in minutes. This quickstart guide covers authentication, basic requests, streaming, and key constraints for the qwen nsfw API.

https://api.qwennsfw.cc/v1uncensored

Prerequisites and Base URL

Before writing code, ensure you have an API key. Sign up via the Get API key page using Google or an email address. You receive a single active key; generating a new one replaces the previous key. Our endpoint is strictly OpenAI-compatible, meaning you only need to update the base URL and API key in your existing client configuration.

Use https://api.qwennsfw.cc/v1 as your base URL. The model ID to target is uncensored. This is an open-weight model hosted on our servers, distinct from GPT, Claude, or the original Qwen vendor models. It is tuned for lawful adult content and does not apply standard refusals to controversial or fictional topics.

Authentication and First Request

Authentication is handled via the Authorization header. Include your API key as a bearer token. If the key is invalid or expired, you will receive a 401 error. If your prepaid credit is exhausted, you will receive a 402 error. Credit never expires, but you must top up via crypto (USDT TRC20 or USDC on Base) to continue.

Below is a basic cURL request to verify connectivity and receive a completion.

curl https://api.qwennsfw.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."}]
  }'

This request sends a prompt to the uncensored model and returns a text response. No embeddings or image generation are available, so ensure your payload uses the messages array format standard to chat completions.

Python SDK Integration

Using the official OpenAI Python SDK is the fastest way to integrate. Point the client to our base URL and set your API key. The model parameter must be set to uncensored.

from openai import OpenAI

client = OpenAI(base_url="https://api.qwennsfw.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 response object contains the generated text in response.choices[0].message.content. Errors such as rate limits (429) or insufficient funds (402) are raised as standard SDK exceptions. You can catch these to prompt the user to top up their credit via the dashboard.

Node.js SDK Integration

For Node.js environments, the openai NPM package works identically. Configure the apiKey and baseURL properties before making requests. This ensures compatibility with existing codebases that already target OpenAI or other compatible providers.

import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://api.qwennsfw.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);

The response structure mirrors the standard OpenAI format. Remember that this API does not support fine-tuning, audio, or video generation. Stick to text-based chat completions for the best performance and predictable token billing.

Streaming Responses

Enable streaming by setting stream: true in your request. The API returns a Server-Sent Events (SSE) stream. Each chunk contains a partial response, allowing you to display text to the user in real-time.

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)

The final chunk in the stream includes token usage statistics. Note that errors during streaming may result in incomplete chunks. Always handle stream termination gracefully. Streaming does not affect token billing; you are charged for the total input and output tokens regardless of streaming status.

Limits, Errors, and Context Window

Understand these hard limits before deploying. The context window is 100,000 tokens (prompt + completion combined). There is no separate output cap per request; if max_tokens is unset, the response can run to the end of the window. You are limited to 300 requests per minute and 8 concurrent requests per key.

Common errors include 401 (invalid key), 402 (no credit), and 429 (rate limit). Request bodies must not exceed 8 MB. If you encounter a 429, reduce concurrency or implement exponential backoff. Token usage is charged accurately, and errors do not consume credit.

Under the hood: specs

Everything the endpoint can and cannot do, in one place — check it before you top up.

ParameterDetails
CompatibilityOpenAI Chat Completions schema; official openai SDKs work unchanged
AuthenticationAuthorization: Bearer YOUR_KEY
MethodsPOST /v1/chat/completions · GET /v1/models
Base URLhttps://api.qwennsfw.cc/v1
Model IDuncensored
Completion lengthprompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap
Structured outputJSON object mode via response_format json_object
Tools / tool callsSupported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages
Max context100,000 tokens, input and output combined
StreamingSupported (stream: true), usage included at the end
Other parameterstemperature, top_p, stop, seed, presence_penalty, frequency_penalty
Concurrencyup to 8 in parallel per key
Request size8 MB request body
HeadersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Requests per minute300 requests per minute per key
Price$0.15 per 1M input tokens · $0.50 per 1M output tokens
How you paypay as you go from prepaid credit; nothing is charged for failed or refused requests
Free trial$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
PaymentUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
Credit expiryno monthly fee; paid credit does not expire
Volume bonus+5% from $50, +10% from $100, +15% from $200
Sign-inGoogle or e-mail and password
Contentuncensored for adults; the only hard rule: no sexual content involving minors
Keysone key per account, regenerate any time (the old one stops working)

Error reference

The type field is stable, the message is for humans. Errors cost nothing.

HTTPTypeWhat to do
400bad_requestmalformed request or too long for the context window
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_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 · concurrencyover 300/min or 8 parallel — back off and retry
503upstream_busytemporary overload, retry shortly

Questions and answers

Does this API support image or audio generation?

No. This is a pure text API. It serves the uncensored large language model via chat completions. There are no endpoints for embeddings, images, audio, or video.

How does billing work if I get an error?

Errors such as 401 (invalid key), 402 (no credit), or 429 (rate limit) do not consume your prepaid credit. You are only charged for actual token usage in successful or partial completions.

Can I use the same model for function calling?

Yes. The uncensored model supports function calling (tools), tool_choice, and JSON mode. You can pass tools in the request, and the model will return structured output compatible with the OpenAI SDK.

Your key is one form away

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

https://api.qwennsfw.cc/v1