ru ▾
Create key

Qwen api cost: API Documentation

Start using the uncensored LLM API immediately with standard OpenAI-compatible code. Send text, receive text, and bypass content filters without changing your client logic.

Authentication and Keys

Generate your API key instantly via Google or email login on the key page. Pass this key in the Authorization header as a Bearer token for every request. The system rejects invalid keys with a 401 status, ensuring secure access. Your key is the only credential required to interact with the endpoint.

Base URL and Endpoints

Direct all requests to the base URL https://api.qwenapicost.com/v1. Use the standard POST /v1/chat/completions endpoint for text generation. This URL works with any OpenAI-compatible SDK. Point your client library to this address and inject your API key. The service accepts text in and returns text out without additional model routing.

First Request

Send a simple completion request to verify connectivity. The model ID is uncensored. This request confirms your key works and credits are available. Replace YOUR_API_KEY with your actual key from the dashboard.

curl https://api.qwenapicost.com/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "uncensored",
    "messages": [{"role": "user", "content": "Check price per token for 128k context window"}]
  }'

Python SDK

Use the official OpenAI Python library to integrate the API. Set the base URL to the provider endpoint. Initialize the client with your key. Call the chat completions method with the uncensored model. This approach requires zero code changes from standard OpenAI implementations.

from openai import OpenAI

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

Integrate using the Node.js OpenAI package. Configure the base URL to point to the service. Pass the API key in the configuration object. Request completions from the uncensored model. The SDK handles serialization automatically. This allows rapid prototyping in JavaScript environments.

import OpenAI from "openai";

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

Enable streaming by setting stream: true in your request. The API returns Server-Sent Events (SSE) for real-time token delivery. Token usage metadata appears in the final chunk. This reduces perceived latency for long outputs. The streaming protocol ensures you receive data as it generates.

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

What is the qwen API cost for this uncensored model?

The pricing is $0.15 per 1M input tokens and $0.50 per 1M output tokens. You pay only for real token usage, with errors and refusals charged at zero. Prepaid credit never expires, and no monthly subscription is required.

How does the context window work for requests?

The model supports a 100,000 token context window combining prompt and completion. You can request up to 16,000 output tokens per call. If you do not specify <code>max_tokens</code>, the limit defaults to 2,048 tokens. This allows for extensive document processing or long-form generation.

What happens if I hit the rate limit?

The API enforces a limit of 300 requests per minute per key. If you exceed this, you receive a 429 status code. Concurrent requests are capped at 8 per key. Ensure your client handles these errors gracefully by implementing exponential backoff.

Get your key now

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

Create key