Quickstart for Qwencoder users
Drop in the Qwencoder base URL and key to replace OpenAI-compatible endpoints for uncensored text generation. This guide covers the exact syntax for cURL, Python, Node, and streaming responses.
Authentication & Base URL
Qwencoder implements the standard OpenAI chat-completions interface. To use it, set your base URL to https://api.qwencoder.cc/v1 and pass your API key in the Authorization header. You do not need to install vendor-specific libraries; the official OpenAI SDKs work out of the box with these two variables. Sign up via Google or email to receive your key immediately—no credit card is required for the initial trial credit of $0.50. Claim this credit with one click on your API key page.
curl https://api.qwencoder.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."}]
}'Keep your key secure. Each account supports one active key at a time; generating a new one revokes the previous key. The x-model-override header is optional since the model ID is fixed, but you may include it for compatibility with clients that expect it.
Chat Completions Endpoint
Send requests to POST /v1/chat/completions. The API accepts standard message structures with roles like user and assistant. The model ID is always uncensored. This endpoint handles raw text generation without content refusals for lawful adult topics, making it suitable for creative writing, roleplay, and technical analysis. Unlike general-purpose models, this service focuses exclusively on text output.
from openai import OpenAI
client = OpenAI(base_url="https://api.qwencoder.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)Set the max_tokens parameter to control output length. If omitted, the response can run to the end of the window. The context window allows up to 100,000 tokens total, including both the prompt and the completion. This allows for extensive conversation history or large document processing.
Streaming & Token Usage
Enable streaming by setting stream: true in your request. The API returns a Server-Sent Events (SSE) stream. Each chunk contains partial text, but token usage details (input and output counts) are only provided in the final chunk. This allows you to process text in real-time while still tracking your credit consumption accurately.
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)Errors and refusals do not consume credit, so streaming is safe to use even if a request fails. The trial credit expires in 7 days, but prepaid credits never expire. Use streaming for applications requiring low latency, such as chat interfaces or live coding assistants.
Function Calling Support
Qwencoder supports function calling via the tools parameter. Define your functions in the tools array and set tool_choice to auto or a specific function name. The model will return a structured response with the function name and arguments if appropriate. This is useful for integrating the API with external systems or automating tasks.
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.qwencoder.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);Ensure your function definitions follow the standard OpenAI tool schema. The API does not execute the functions; it only returns the instructions. You must parse the response and execute the logic on your side. This separation keeps the API lightweight and focused on text generation.
JSON Mode Configuration
For applications requiring structured output, set response_format to {"type": "json_object"}. The model will attempt to return valid JSON, which is ideal for data extraction, configuration generation, or API responses. This mode reduces the need for post-processing regex patterns.
While JSON mode improves structure, it may slightly increase latency or token usage. Test your prompts thoroughly to ensure the model adheres to your schema. Combine JSON mode with function calling for robust, structured data pipelines. The uncensored nature of the model means it may follow unconventional formatting if the prompt encourages it, so specify your schema clearly.
Error Handling & Limits
Monitor HTTP status codes for errors. A 401 indicates an invalid or revoked API key. A 402 means your prepaid credit is exhausted; top up by crypto (USDT on TRC20, USDC on Base) to continue. A 429 error signals that you have exceeded the rate limit of 300 requests per minute or 8 concurrent requests. The request body must also stay under 8 MB.
If you receive a 429, implement exponential backoff in your client. Since pricing is transparent ($0.15/1M input tokens, $0.50/1M output tokens), errors are free, so you can retry without cost. The model refuses sexual content involving minors, which may trigger a specific refusal response, but this does not consume credit.
Specs at a glance
A quick checklist for developers: format, limits, features, billing.
| Feature | Support |
|---|---|
| Protocol | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Base URL | https://api.qwencoder.cc/v1 |
| Model ID | uncensored |
| API key | Authorization: Bearer YOUR_KEY |
| Streaming | Yes — server-sent events; the last chunk carries token usage |
| Function calling | Yes — tools, tool_choice; replies carry tool_calls, also when streaming; send results back as role: tool |
| Max output | prompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap |
| JSON mode | response_format: {"type": "json_object"} |
| Sampling parameters | temperature, top_p, stop, seed, presence_penalty, frequency_penalty |
| Max context | 100,000 tokens, input and output combined |
| Response headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Max body | 8 MB request body |
| Concurrency | 8 requests at the same time per key |
| Rate limit | 300/min per key |
| Top-up | crypto: USDT on TRON or USDC on Base, $20–$500, any whole sum |
| Credit expiry | paid credit never expires, no subscription |
| How you pay | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Free trial | $0.50 of credit valid 7 days, no card needed · Trial key: 2 parallel requests, 60 req/min; full limits (8 and 300) after first top-up |
| Volume bonus | +5% on $50+, +10% on $100+, +15% on $200+ |
| Token prices | $0.15 per 1M input tokens · $0.50 per 1M output tokens |
| Account | sign in with Google or with e-mail + password |
| Content policy | adult content allowed; sexual content involving minors is refused |
| Key management | one key per account, regenerate any time (the old one stops working) |
When a request fails
Errors come back as JSON with a stable type; failed and refused requests are not billed.
| Code | Type | Meaning |
|---|---|---|
400 | bad_request | invalid JSON, empty messages, bad parameter, or a prompt longer than the window — fix and resend |
401 | missing_key · invalid_key · key_revoked | check the Authorization header or use your current key |
402 | no_credit | out of credit; add credit and retry |
403 | content_blocked | refused by the content policy |
404 | not_found | unknown endpoint |
413 | request_too_large | request body larger than 8 MB |
429 | rate_limited · concurrency | over 300/min or 8 parallel — back off and retry |
503 | upstream_busy | model busy — retry in a few seconds |
Questions and answers
How do I top up my credit?
Top-ups are accepted by crypto (USDT on TRC20, USDC on Base). You can top up any whole amount from $20 to $500. Credits never expire, and you receive a bonus of +5% from $50, +10% from $100, +15% from $200.
Is the uncensored model the same as Qwen or Llama?
No. Qwencoder hosts an open-weight model tuned for uncensored responses. It is not GPT, Claude, Gemini, Grok, DeepSeek, Qwen, Llama, or any other vendor's model. It runs on our own servers and is optimized for raw text generation without content refusals.
What happens if I make a mistake with my API key?
If you generate a new key, the old one is immediately revoked. If you double-charge or make a payment error, contact Support via the Support page. Credit is not refunded, but mistakes are resolved through support. The trial credit of $0.50 is one per person and valid for 7 days. Claim this credit with one click on your API key page.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.