Qwen api Quickstart Guide

Connect your existing tools to our uncensored model using standard OpenAI-compatible endpoints. This guide covers authentication, code samples, streaming, and limits for the qwen API alternative.

https://api.apiqwen.com/v1uncensored

Authentication & Base URL

Use your API key with the base URL HTTPS://api.apiqwen.com/v1. This endpoint works with official OpenAI SDKs and any compatible client. Pass the key in the Authorization header. Do not use proxy URLs from other providers. Our service is independent and runs its own uncensored model. You can generate a key via Google or email on the dashboard. The key is shown immediately after signup. No phone number is required.

Chat Completions Endpoint

Send POST requests to /v1/chat/completions. Use the model ID "uncensored". The endpoint accepts standard chat messages. It returns text responses only. No embeddings or images are supported. Configure parameters like temperature and top_p. Set response_format to json_object for structured data. Function calling is available via tools. Requests are processed on our dedicated servers. This ensures consistent latency. Check the base URL carefully. Wrong URLs cause 404 errors.

Model Details & Limits

The context window is 100,000 tokens. This includes prompt and completion. Max output is 16,000 tokens. Default max is 2,048 tokens. You can send 300 requests per minute. Concurrency is limited to 8 simultaneous requests. Request body size is capped at 8 MB. Errors do not consume credit. Refusals are free. One key per account. Replace old keys with new ones. The model handles adult content. Minors are excluded from sexual content. Use this for coding or creative writing. No SLA guarantees are offered. Check pricing for token costs.

Streaming & Token Usage

Enable streaming by setting stream to true. The API returns Server-Sent Events. Token usage appears in the final chunk. This allows real-time display. Use this for chat interfaces. It reduces perceived latency. Read chunks sequentially. Handle partial responses carefully. JSON mode works with streaming. Function calls stream too. Monitor token counts. Costs accrue per million tokens. Input is $0.15. Output is $0.50. Balance tracks usage. Crypto billing applies. Top up with USDT or USDC.

Error Handling & Rate Limits

Handle 401 errors by checking your key. Ensure the Authorization header is correct. Use 402 errors to detect low balance. Top up via crypto to continue. 429 errors indicate rate limits. Wait before retrying. Exponential backoff works best. Check concurrency limits. Do not exceed 8 requests. Body size must be under 8 MB. Invalid JSON causes 400 errors. Unknown model IDs return 400. Log errors for debugging. Support page fixes billing issues. Credit never expires. No refunds are issued. Errors are free.

Python SDK Quickstart

Install the openai package. Set the base URL. Pass your API key. Call chat.completions.create. Use model "uncensored". Set stream to true. Iterate over chunks. Print tokens. Handle exceptions. Close the client. This works with existing code. Replace the base URL. Keep the API key secure. Use environment variables. Test with small prompts. Check token usage. Monitor costs. Upgrade to paid credits. Crypto payments only. USDT or USDC. Fast setup.

cURL

curl https://api.apiqwen.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "fix syntax error in python function"}]
  }'

Python

from openai import OpenAI

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

import OpenAI from "openai";

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

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)

Common 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 is the context window size?

The context window is 100,000 tokens. This includes both prompt and completion. Max output is 16,000 tokens per request. Default max is 2,048 tokens.

Is this the official Qwen API?

No, we are an independent provider. We host our own uncensored model. It is compatible with OpenAI clients. Check official docs for Qwen specifics. We do not serve their models.

Get your API key instantly

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

Open account