Quickstart for Qwen Image pipelines
Integrate the uncensored LLM API into your image, video, or speech pipelines with this quickstart guide. Use the OpenAI-compatible endpoint to generate prompts, captions, and scripts without corporate safety filters.
Prerequisites: Install the OpenAI SDK
To interact with the qwen image api text endpoint, you need a supported programming language and the official OpenAI SDK. The API follows the standard Chat Completions interface, so you can use the same client libraries you would use for GPT-4 or other OpenAI models. Install the SDK via your package manager. For Python, use pip. For Node.js, use npm. Ensure your environment has an active internet connection and that your firewall allows outbound HTTPS requests toapi.qwenimageapi.com. No special authentication libraries are required beyond standard HTTP headers.
Configuration: Set Base URL and API Key
Authentication requires a valid API key obtained from your account dashboard. Create an account using Google or email/password, then retrieve your key from the Get API key page. Set your base URL tohttps://api.qwenimageapi.com/v1. This allows any OpenAI-compatible client to route requests to our uncensored model. Pass the key in the Authorization: Bearer header. If you switch keys, remember that one active key replaces the old one immediately. Keep your key secure, as it is the sole credential for your prepaid credit.
Basic Request: Send a Prompt
Send a text prompt to generate captions, scripts, or post-processing instructions. The model ID is alwaysuncensored. The endpoint accepts standard chat completions parameters. You can set temperature, top_p, and stop sequences. Requests are charged based on token usage. Errors and refusals (except for the hard minor content limit) do not consume credit. Use the following example to verify connectivity and basic functionality. This confirms your integration with the text engine powering your multimodal pipeline.
Streaming Responses via SSE
For long-form script generation or detailed captioning, enable streaming to receive tokens as they are generated. This reduces perceived latency in your application. Setstream: true in your request body. The server sends Server-Sent Events (SSE). The final chunk contains the total token usage for the request. This is useful for updating UI progress bars in real-time. Ensure your client library handles SSE streams correctly to avoid memory leaks or incomplete responses. Streaming works with all standard parameters, including JSON mode and function calling.
Function Calling & JSON Mode
Extract structured data from text or prepare JSON payloads for other pipeline stages. Useresponse_format: {"type": "json_object"} to force JSON output. This is critical for parsing image metadata or generating structured prompts. You can also define function schemas for tool use. The model supports tool_choice parameters. Use JSON mode when you need deterministic structures for downstream processing. Function calling is useful when the text output must trigger specific actions in your image or video pipeline. Test thoroughly with your specific schema requirements.
Token Usage & Limits
The context window is 100,000 tokens total. If you omitmax_tokens, the response can run to the end of the 100,000-token window. Rate limits are 300 requests per minute and 8 concurrent requests per key. Request bodies must be under 8 MB. HTTP 401 errors indicate an invalid or expired key. HTTP 429 errors mean you have exceeded the rate limit. Errors and refusals are free. Credit never expires. Top up with USDT or USDC. No card is needed for the trial. Ensure your code handles retries for 429s gracefully to maintain pipeline throughput.cURL
curl https://api.qwenimageapi.com/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.qwenimageapi.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.qwenimageapi.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)Technical reference
Everything the endpoint can and cannot do, in one place — check it before you top up.
| Item | Value |
|---|---|
| API format | OpenAI-compatible: any OpenAI SDK or client works — change the base URL and the key |
| API key | Bearer token in the Authorization header |
| Base URL | https://api.qwenimageapi.com/v1 |
| Model ID | uncensored |
| Methods | POST /v1/chat/completions · GET /v1/models |
| Max output | up to the rest of the 100,000-token window; max_tokens optional (no separate cap) |
| Function calling | Supported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages |
| Sampling parameters | temperature, top_p, stop, seed and the two penalties are passed through |
| SSE streaming | Yes — server-sent events; the last chunk carries token usage |
| JSON mode | JSON object mode via response_format json_object |
| Context window | 100,000 tokens (prompt + completion together) |
| Headers | X-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency |
| Request size | up to 8 MB per request |
| Concurrency | 8 requests at the same time per key |
| Requests per minute | 300/min per key |
| Payment | USDT (TRC20) or USDC (Base), any whole amount from $20 to $500 |
| Price | input $0.15 / 1M tokens, output $0.50 / 1M tokens |
| Volume bonus | +5% from $50, +10% from $100, +15% from $200 |
| Billing | pay as you go from prepaid credit; nothing is charged for failed or refused requests |
| Trial credit | $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 |
| Subscription | no monthly fee; paid credit does not expire |
| Content | uncensored for adults; the only hard rule: no sexual content involving minors |
| Sign-in | sign in with Google or with e-mail + password |
| Key management | one key per account, regenerate any time (the old one stops working) |
HTTP errors
The type field is stable, the message is for humans. Errors cost nothing.
| 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 | balance is empty — top up, requests resume at once |
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 | slow down: rate or parallel limit reached |
503 | upstream_busy | temporary overload, retry shortly |
Questions and answers
How do I top up my credit?
Top up using cryptocurrency only. We accept USDT on the TRC20 network or USDC on the Base network. Minimum top-up is $20, maximum is $500. You receive a 5% bonus for $50+ and a 10% bonus for $100+. No credit cards or PayPal are accepted.
What is the uncensored model?
It is an open-weight model hosted on our servers, tuned to answer without content refusals for lawful adult use. It is not GPT, Claude, or Qwen. It blocks sexual content involving minors but allows other controversial or adult topics. It is designed for prompt engineering and text generation in media pipelines.
Do errors cost credits?
No. Errors and refusals do not consume your prepaid credit. You are only charged for successful token generation. This makes the API cost-effective for debugging and iterative prompt development. Credit also never expires, so you can use it whenever needed.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.