EN ▾
Get API key

Wu Shencha API Quick Start

Integrate the uncensored LLM via the Wu Shencha API and start using the standard OpenAI-compatible interface. This documentation provides basic configuration, request examples, and limits to help you start at zero cost.

Basic Configuration

The Wu Shencha API provides a standard OpenAI-compatible interface. You need to set the base URL and API key in your code. The base URL is fixed at https://api.wushenchaapi.com/v1. The model ID is uncensored, a fine-tuned open-weight model designed for uncensored scenarios, supporting lawful adult content.

The key is shown on the "Get API key" page after registration. Since the API is OpenAI-compatible, you can connect by simply modifying the base_url parameter in the official SDK. No extra routing or complex setup is needed.

Chat Completions Endpoint

Use the POST /v1/chat/completions endpoint to send text requests. The endpoint accepts standard message formats and returns generated text. This is the most basic interaction, suitable for most text generation scenarios.

The request body must include model, messages, and other fields. Ensure your request body size does not exceed 8 MB. If the key is invalid or the balance is insufficient, the API will return corresponding error codes.

curl https://api.wushenchaapi.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 SDK

Python developers can use the official openai SDK. Point the base_url to the Wu Shencha API endpoint and pass your API key. This maintains consistency with native OpenAI code, making migration easy.

Ensure you have the latest SDK version installed. The code example shows how to initialize the client and send messages. This approach is concise and efficient, ideal for rapid prototyping.

from openai import OpenAI

client = OpenAI(base_url="https://api.wushenchaapi.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 SDK

Node.js developers can also use the openai npm package. Configure it similarly to Python by setting baseURL and apiKey. This ensures cross-language consistency and reduces the learning curve.

Supports async requests and error handling. You can easily integrate it into existing Node.js applications. Handle async callbacks or Promises to avoid blocking.

import OpenAI from "openai";

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

Supports streaming via Server-Sent Events (SSE). Set the stream: true parameter, and the API returns response data in chunks. This is useful for real-time apps or long text generation, providing a lower latency experience.

Streaming does not change model behavior, only the data transmission method. You can choose streaming or non-streaming mode as needed.

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)

Limits and Quotas

Up to 300 requests per minute. The context window is 100,000 tokens (including prompt and completion). The API returns a 429 error if limits are exceeded, 401 for invalid keys, and 402 for insufficient balance.

Prepaid credit never expires, with no monthly fees. Each request body is limited to 8 MB. These limits ensure service stability. You can generate a new key at any time to revoke the old one.

Capabilities and limits

Before you integrate, here is exactly what you get with a key.

ParameterDetails
ProtocolOpenAI Chat Completions schema; official openai SDKs work unchanged
AuthenticationBearer token in the Authorization header
MethodsPOST /v1/chat/completions · GET /v1/models
Model IDuncensored
Base URLhttps://api.wushenchaapi.com/v1
Structured outputresponse_format: {"type": "json_object"}
Sampling parameterstemperature, top_p, stop, seed, presence_penalty, frequency_penalty
Max output16,000 tokens max; 2,048 if max_tokens is not set
Tools / tool callsYes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool
StreamingYes — server-sent events; the last chunk carries token usage
Context window100,000 tokens (prompt + completion together)
Parallel requests8 requests at the same time per key
Requests per minute300 requests per minute per key
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Request size8 MB request body
PaymentUSDT (TRC20) or USDC (Base), any whole amount from $10 to $500
Subscriptionno monthly fee; paid credit does not expire
Free trial$0.50 of credit valid 7 days, no card needed
Priceinput $0.25 / 1M tokens, output $1.00 / 1M tokens
Bonus credit+5% from $50, +10% from $100
How you paypay as you go from prepaid credit; nothing is charged for failed or refused requests
Sign-insign in with Google or with e-mail + password
Contentadult content allowed; sexual content involving minors is refused
Keysone key per account, regenerate any time (the old one stops working)

Error reference

Every error is JSON with a type you can switch on. You are never charged for an error.

StatusTypeReason
400bad_requestmalformed request or too long for the context window
401missing_key · invalid_key · key_revokedcheck the Authorization header or use your current key
402no_creditbalance is empty — top up, requests resume at once
403content_blockedrefused by the content policy
404not_foundonly /v1/chat/completions and /v1/models exist
413request_too_largebody over 8 MB
429rate_limited · concurrencyover 300/min or 8 parallel — back off and retry
503upstream_busytemporary overload, retry shortly

FAQ

Does the Wu Shencha API support embeddings or image generation?

Currently, only the chat completions endpoint is supported. Embeddings, images, audio, and video generation are not supported. Focus is on pure text interaction to ensure high performance and low latency.

How do I get an API key?

After registering, view it on the "Get API key" page. New accounts receive $0.50 in free trial credit, no credit card required. Keys can be regenerated at any time, and old keys become invalid immediately.

How is pricing calculated?

$0.25 per million input tokens, $1.00 per million output tokens. Pay as you go, no monthly fee. Top up starts at $10, with a 5% bonus for $50 and 10% for $100. Prepaid credit never expires.

Fill out the form to get your key

Create an account, copy the key, and modify the Base URL. Configuration is that simple.