Get API key

Switch your client in three lines

Connect your existing OpenAI-compatible client to our uncensored API in seconds. You only need to update the base URL and provide your API key.

uncensoredhttps://api.qwenapi.cc/v1

On this page
  1. Authentication and Base URL
  2. First Request
  3. Python SDK Integration
  4. Node.js SDK Integration
  5. Streaming Responses
  6. Limits, Errors, and Context
  7. Questions and answers
qwenapi.cc/docs/#text

Authentication and Base URL

Our API follows the standard OpenAI chat-completions pattern. To integrate, update your client's base URL to https://api.qwenapi.cc/v1 and pass your unique API key in the Authorization header. The model identifier you must send is uncensored. This is an open-weight model hosted on our servers, distinct from GPT or Qwen variants. No card is required for the initial setup, and your key is generated immediately upon signup via Google or email.

First Request

Send a standard chat completion request to test connectivity. The endpoint accepts POST requests with JSON bodies. Ensure you include the model field set to uncensored. If the key is invalid, you receive a 401 error. If your prepaid credit is exhausted, you receive a 402 error. Both errors are free, so you are not charged for failed attempts.

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

Python SDK Integration

Using the official openai Python package is the most straightforward path. Initialize the client with your key and the custom base URL. The library handles serialization automatically. Remember that the model name must be exactly uncensored. This approach works for any OpenAI-compatible SDK, allowing you to swap vendors without changing your core logic.

from openai import OpenAI

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

Node.js SDK Integration

For JavaScript and TypeScript developers, the Node SDK works identically. Set the apiKey and baseURL properties during initialization. This ensures that all subsequent calls route through our endpoint. You can continue using familiar methods like chat.completions.create() without rewriting your application logic. This makes the qwen api a true drop-in alternative for existing projects.

import OpenAI from "openai";

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

Streaming Responses

Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE). Each chunk contains partial text until the final chunk, which also includes token usage statistics. This is ideal for real-time UI updates. The streaming behavior matches the OpenAI standard, ensuring compatibility with existing streaming clients and libraries.

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, Errors, and Context

Your requests are subject to a rate limit of 300 requests per minute and 8 concurrent requests per key. The maximum request body size is 8 MB. The context window is 64,000 tokens total, with a maximum output of 16,000 tokens. If you exceed these limits, you receive a 429 error. Errors like invalid keys (401) or insufficient funds (402) do not consume your prepaid credit.

qwenapi.cc/docs/#s1

Questions and answers

Does this API support function calling?

Yes, the API supports function calling via the <code>tools</code> and <code>tool_choice</code> parameters. You can define tools in your request and the model will return structured arguments for them.

What happens if I get a 402 error?

A 402 error indicates that your prepaid credit is exhausted. You are not charged for the request, and you can top up your account with crypto to continue using the service.

Is the context window 64,000 tokens per request?

The total context window is 64,000 tokens for both prompt and completion combined. The maximum output you can generate in a single request is 16,000 tokens.

Your key is one form away

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

Get API key