EN ▾
Get API key

Prompts and scripts over one endpoint

Integrate our uncensored LLM API into your text-to-image workflow using standard OpenAI-compatible endpoints. This quickstart covers authentication, request formats, streaming, and token limits for prompt generation and post-processing.

Base URL and Authentication

To start, point your OpenAI SDK or HTTP client to our base URL. All requests require an API key passed in the Authorization header. You obtain this key during signup via Google or email on the Get API key page. The key is displayed immediately and is unique to your account.

We do not offer image, audio, or video generation. This is a text-only service for your pipeline scripts. Ensure your client library supports custom base URLs. If you are using a standard OpenAI SDK, set the base_url parameter to our endpoint and provide your key. No subscription is required; you pay per token with prepaid credit.

Chat Completions Endpoint

Send text to the POST /v1/chat/completions endpoint. The model ID is uncensored. This model is an open-weight LLM tuned to answer without content refusals for lawful adult use, making it suitable for generating creative prompts, captions, or metadata without censorship filters blocking niche topics.

Requests are charged by token usage. Errors and refusals (except for the hard limit on minor-specific content) are free. Below is an example of a basic synchronous request.

curl https://api.qwenimageapi.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."}]
  }'

Remember that the context window is 100,000 tokens total. There is no separate output cap per request, and if max_tokens is not specified, the response can run to the end of the window.

Python SDK Integration

Using the official OpenAI Python SDK is the most straightforward way to interact with our API. Install the library and initialize the client with our base URL. This ensures compatibility with standard parameters like temperature, top_p, and stop.

The Python example demonstrates how to send a system prompt and user message. The response includes token usage details, which you can log for billing transparency. This method is ideal for batch processing or script-based workflows where you need the full text before proceeding to the next step in your image pipeline.

from openai import OpenAI

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

Node SDK Integration

For JavaScript or TypeScript environments, the OpenAI Node SDK works seamlessly. Initialize the client with the same base URL and API key. This approach is useful for server-side rendering or API gateways where you need to generate text dynamically based on user input or image metadata.

Node SDK users can leverage async/await patterns for clean code. The response structure mirrors the standard OpenAI format, making it easy to swap in other providers later if needed, though we do not offer model routing. Ensure you handle the response data to extract the generated text for your workflow.

import OpenAI from "openai";

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

Streaming Responses

For real-time feedback, enable streaming by setting stream: true. The API uses Server-Sent Events (SSE). Each chunk contains partial text, and the final chunk includes the total token usage. This is valuable for user-facing interfaces where you want to show generated text as it is produced.

Streaming does not affect pricing or token limits. The same context window and output limits apply. Use this feature when building chat-like interfaces or when you need to display progress to the user. The last chunk will contain the usage object with details on input and output tokens.

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)

Limits, Errors, and Context Window

Our API enforces specific limits to ensure reliability. You are allowed 300 requests per minute and 8 concurrent requests per key. The request body must not exceed 8 MB. If you exceed these limits, you will receive a 429 rate limit error.

Authentication errors return 401 if the key is invalid. If your prepaid credit is exhausted, you receive a 402 error. Errors and refusals are free, so you are not charged for failed requests. The hard content limit blocks sexual content involving minors, which is also free. Credit never expires, so you can top up via crypto (USDT TRC20 or USDC Base) at any time.

API specifications

If your tool speaks the OpenAI API, these are the details that matter.

ItemValue
API formatOpenAI Chat Completions schema; official openai SDKs work unchanged
Base URLhttps://api.qwenimageapi.cc/v1
Modeluncensored
MethodsPOST /v1/chat/completions · GET /v1/models
API keyBearer token in the Authorization header
StreamingYes — server-sent events; the last chunk carries token usage
Max context100,000 tokens, input and output combined
Sampling parameterstemperature, top_p, stop, seed and the two penalties are passed through
Tools / tool callsSupported: tools + tool_choice, tool_calls in the reply (streamed too), tool results as role: tool messages
Max outputprompt + completion fit within 100,000 tokens; max_tokens optional, no separate output cap
Structured outputresponse_format: {"type": "json_object"}
Parallel requests8 requests at the same time per key
Response headersX-Request-Id, X-Balance-USD, X-RateLimit-Limit-Requests, X-RateLimit-Limit-Concurrency
Request size8 MB request body
Requests per minute300 requests per minute per key
Credit expirypaid credit never expires, no subscription
Top-upUSDT (TRC20) or USDC (Base), any whole amount from $20 to $500
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
Volume bonus+5% from $50, +10% from $100, +15% from $200
How you payprepaid credit, charged by real token usage; errors and refusals are free
Priceinput $0.15 / 1M tokens, output $0.50 / 1M tokens
Contentadult content allowed; sexual content involving minors is refused
Sign-insign in with Google or with e-mail + password
Key managementone active key per account; a new key replaces the old one

HTTP errors

Every error is JSON with a type you can switch on. You are never charged for an error.

CodeTypeMeaning
400bad_requestmalformed request or too long for the context window
401missing_key · invalid_key · key_revokedno key, wrong key, or a key replaced by a newer one
402no_creditout of credit; add credit and retry
403content_blockedrefused by the content policy
404not_foundonly /v1/chat/completions and /v1/models exist
413request_too_largebody over 8 MB
429rate_limited · concurrencyslow down: rate or parallel limit reached
503upstream_busytemporary overload, retry shortly

Questions and answers

Does this API generate images or videos?

No. This is a text-only LLM API. It generates text responses such as prompts, captions, or metadata that you can use in your image or video pipelines. It does not produce visual or audio media itself.

How does billing work for errors and refusals?

Errors (like 429 or 402) and refusals are free. You are only charged for tokens consumed in successful completions. The only hard refusal that always applies is for sexual content involving minors, which is also free.

Can I use this API with other OpenAI SDKs?

Yes. It is an OpenAI-compatible API. You can use any SDK that supports the OpenAI format by setting the base URL to our endpoint and providing your API key. The model ID is uncensored.

Your key is one form away

Create an account, copy the key, change the base URL. That is the whole setup.