qwenapi.topGet API key

Switch your client in three lines

Get started with our uncensored API in minutes by updating your existing OpenAI SDK configuration. This guide covers authentication, basic requests, streaming, and tool usage for developers seeking a drop-in replacement.

Install the OpenAI SDK

Our endpoint is fully OpenAI-compatible, meaning you can use the official SDKs you already know. For most languages, the standard openai package works directly without modification. Install the library using your preferred package manager. This ensures you retain access to features like streaming, function calling, and JSON mode without rewriting your client logic.

Configure Base URL and Key

Authentication requires a valid API key and the correct base URL. Create your key on the Get API key page using Google or email. Then, update your client configuration to point to our dedicated endpoint. This isolates your usage from other models and ensures you are billed for this specific uncensored instance.

The base URL is https://api.qwenapi.top/v1. Set your API key in the environment variable OPENAI_API_KEY or pass it directly to the client constructor.

Basic Chat Completion Request

Sending a simple text request is identical to standard OpenAI usage. The model ID for this uncensored instance is uncensored. You can send prompts and receive text responses just like any other LLM. Errors during processing do not consume credit, so you can test freely.

Streaming Responses

For lower latency, enable streaming to receive tokens as they are generated. The SDK handles Server-Sent Events (SSE) automatically. Token usage statistics are included in the final chunk of the stream, allowing you to track billing accurately. This is ideal for applications requiring real-time text display.

Function Calling Support

The API supports structured tool usage via tools and tool_choice. Define your function schemas in the request, and the model will return structured arguments for execution. This enables complex workflows where the LLM acts as a controller for external services. JSON mode is also available via response_format for strict output formatting.

Limits, Errors, and Context

Your requests are subject to strict limits: 300 requests per minute and 8 concurrent requests per key. The context window allows 64,000 tokens total (prompt + completion), with a max output of 16,000 tokens. If you receive a 401, your key is invalid. A 402 indicates insufficient prepaid credit. A 429 means you have hit the rate limit. Credit never expires, so you can top up via crypto at your convenience.

cURL

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."}]
  }'

Python

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)

Node.js

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);

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)

Questions and answers

Do I need to change my model name?

Yes, set the model ID to "uncensored" in your requests. This ensures you are using our dedicated uncensored instance and not a default model if your SDK has one.

What happens if I get a 402 error?

A 402 error means your prepaid credit balance is zero. Top up via USDT or USDC to resume service. Errors and refusals do not consume credit.

Can I use this with LangChain or LlamaIndex?

Yes, since the endpoint is OpenAI-compatible, most frameworks that support OpenAI will work with minimal configuration changes to the base URL and API key.

Your key is one form away

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

Get API key