EN ▾
Open account

Qwen api docs: Quickstart Guide

This guide helps you integrate our uncensored LLM into your application using standard OpenAI SDKs. You will learn to configure the base URL, send requests, and handle streaming with transparent pricing.

Install the Standard OpenAI SDK

Start by installing the official SDK for your preferred language. This ensures compatibility with our OpenAI-compatible endpoint without requiring custom wrappers. You can use pip for Python or npm for Node.js to add the necessary libraries to your project environment.

from openai import OpenAI

client = OpenAI(base_url="https://api.qwenapidocs.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)
import OpenAI from "openai";

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

Configure Base URL and Key

Point your SDK client to our specific base URL and provide your API key. This directs all requests to our uncensored model rather than the default OpenAI servers. The base URL is HTTPS://api.qwenapidocs.com/v1 and you retrieve your key from the dashboard.

curl https://api.qwenapidocs.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "List the current pricing tiers for the qwen endpoint"}]
  }'

Send Your First Uncensored Request

Make a standard chat completion call to receive raw, unrestricted text output. Our model ignores typical content filters for lawful adult use, providing direct responses to your prompts. The model identifier is simply "uncensored".

from openai import OpenAI

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

Handle Streaming Responses (SSE)

Enable streaming to receive tokens as they are generated, reducing perceived latency for long outputs. The SDK yields chunks of text as they become available, allowing for real-time display in your application. The final chunk contains the total token usage for billing.

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)

Enable Tool Calling and JSON Mode

Use the standard function calling format or enforce JSON output for structured data extraction. Our API supports tool definitions and response_format parameters just like the OpenAI standard. This allows you to integrate our uncensored model into complex agent workflows without custom parsing logic.

Monitor Token Usage and Limits

You are charged per 1M input and output tokens, with errors and refusals being free. Your account has a limit of 300 requests per minute and a context window of 100,000 tokens. Monitoring usage helps you manage your prepaid crypto credit effectively.

Frequently asked questions

Which payment methods do you accept?

Crypto only: USDT on TRC20 or USDC on Base, any whole amount from $20 to $500. Bonus credit applies from $50.

What are the qwen API pricing details?

Input tokens cost $0.15 per million and output tokens cost $0.50 per million. You pay only for actual usage with prepaid crypto credit that never expires. Errors and refusals do not consume your credit.

Why is it considered an uncensored LLM?

The model is tuned to answer without content refusals for lawful adult, fictional, or controversial topics. It does not apply the standard safety filters found in major vendor models, providing raw output for developers who need it.

Generate your API key

Sign up, copy the key, update the base URL. That’s it.

Open account