EN ▾
qwenapi.topGet API key

First request in five minutes

Connect your existing OpenAI-compatible client to our uncensored API by updating three configuration lines. The same SDKs and tools you already use work immediately.

Install the OpenAI SDK

Our endpoint follows the standard chat.completions protocol, so you can use the official SDKs from your preferred language. For Python, install the package via pip. For Node.js, use npm. These libraries handle serialization, retries, and streaming out of the box.

pip install openai

npm install openai

Ensure you are using a recent version of the SDK to support all parameters like tool_choice and response_format. The client library manages the HTTP requests, so you only need to focus on the payload structure.

Configure Base URL and Key

Point your client to our dedicated endpoint. You do not need to change the model name logic; we expect you to pass model: "uncensored" in your requests. Authentication is handled via a simple API key passed in the header.

Set the base_url to https://api.qwenapi.top/v1. Generate your qwen api key on the dashboard. The key is displayed immediately after signup. No phone number or credit card is required for the initial setup.

Basic Chat Completion Request

Send a standard completion request. The model returns text responses directly. There are no complex routing layers; you are talking to a single instance tuned for uncensored outputs.

Below is a minimal example using curl to verify connectivity and response format.

curl https://api.qwenapi.top/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 response contains the generated text in choices[0].message.content. You can adjust parameters like temperature and top_p to control creativity.

Streaming Responses

For real-time token generation, enable streaming. The server sends Server-Sent Events (SSE). The final chunk includes token usage statistics, allowing you to track credit consumption accurately.

from openai import OpenAI

client = OpenAI(base_url="https://api.qwenapi.top/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)

Streaming is essential for long outputs. You can parse the stream and render tokens as they arrive. The SDK handles the SSE parsing automatically.

Function Calling Support

Define tools in your request. The model returns structured tool calls. You execute the tool, pass the result back, and the model continues. This works with tool_choice and standard function definitions.

import OpenAI from "openai";

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

JSON mode is also available via response_format. Use it when you need strict JSON output without tool overhead.

Limits, Errors, and Context

The context window is 100,000 tokens total. There is no separate output cap (if max_tokens is unspecified, the response can run to the end of the window). Rate limits are 300 requests per minute and 8 concurrent requests per key. Request bodies must stay under 8 MB.

Handle errors: 401 means invalid key, 402 means insufficient credit, 429 means rate limit exceeded. Errors are free; you only pay for consumed tokens. Credit never expires. If you double-charge, use the Support page for a fix.

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

If your tool speaks the OpenAI API, these are the details that matter.

ItemValue
API formatOpenAI Chat Completions schema; official openai SDKs work unchanged
EndpointsPOST /v1/chat/completions · GET /v1/models
Base URLhttps://api.qwenapi.top/v1
AuthenticationBearer token in the Authorization header
Model IDuncensored
SSE streamingSupported (stream: true), usage included at the end
Max context100,000 tokens, input and output combined
Max outputup to the rest of the 100,000-token window; max_tokens optional (no separate cap)
Sampling parameterstemperature, top_p, stop, seed and the two penalties are passed through
JSON moderesponse_format: {"type": "json_object"}
Function callingSupported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Requests per minute300 requests per minute per key
Max body8 MB request body
Parallel requestsup to 8 in parallel per key
Credit expirypaid credit never expires, no subscription
How you payprepaid credit, charged by real token usage; errors and refusals are free
Price$0.15 per 1M input tokens · $0.50 per 1M output tokens
Top-upUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
Volume bonus+5% from $50, +10% from $100, +15% from $200
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
Content policyuncensored for adults; the only hard rule: no sexual content involving minors
Sign-inGoogle or e-mail and password
Key managementone 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.

CodeTypeMeaning
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_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

Is this the official Qwen API?

No. We are an independent provider running an uncensored large language model. We are not affiliated with the original Qwen team or any other vendor. We serve our own instance tuned for uncensored use.

How do I top up credit?

Payments are by crypto (USDT on TRC20, USDC on Base). Minimum top-up is $20. You get +5% bonus for $50 or more, +10% for $100 or more, and +15% for $200 or more. No PayPal accepted.

What is the context window size?

The model supports 100,000 tokens for the combined prompt and completion. There is no separate output cap. If you do not set max_tokens, the response can run to the end of the window.

Your key is one form away

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

Get API key