altrouter.ai
Models/Alibaba/Qwen Image
QW

Alibaba: Qwen Image

Imageqwen-image

Alibaba's Qwen-Image: generation and editing with strong in-image text.

API docs
Playgroundqwen-image
Reference image
Size
Negative prompt
Steps
Guidance
Format
Acceleration
Seed
Latency6.3 s
24hnow
Specifications
Authoralibaba
ModalityImage
Price$0.018 / image$0.035 / image
Savings50%
Quick start
from openai import OpenAI

client = OpenAI(
    base_url="https://api.altrouter.ai/v1",
    api_key="ar-...",
)

img = client.images.generate(
    model="qwen-image",
    prompt="a red fox in the snow",
)
print(img.data[0].url)

Same OpenAI-compatible endpoint — just swap base_url and key.

API

OpenAI-compatible image generation endpoint. The result is re-hosted on our CDN and returned as a URL.

POST/v1/images/generations
Body parameters
modelstringrequired"qwen-image"
The model id.
promptstringrequired
The text description of the image.
imagestringURL or base64
Reference images for editing.
image_sizeenumsquare_hd · square · portrait_4_3 · portrait_16_9 · landscape_4_3 · landscape_16_9default square_hd
Image size / orientation preset.
negative_promptstring
What to exclude from the image.
num_inference_stepsnumber2–49
Diffusion steps — higher is better but slower.
guidance_scalenumber0–20
How strictly to follow the prompt.
output_formatenumpng · jpegdefault png
Output file format (PNG / JPEG).
accelerationenumnone · regular · highdefault none
Generation acceleration mode.
seednumber0–2147483647
Seed for reproducibility.
Response
createdinteger
Unix creation time (seconds).
dataarray
Images. Each: url (our CDN), b64_json, revised_prompt.
Example
cURLPythonJSON
curl https://api.altrouter.ai/v1/images/generations \
  -H "Authorization: Bearer ar-..." \
  -H "Content-Type: application/json" \
  -d '{
  "model": "qwen-image",
  "prompt": "a red fox in the snow",
  "image_size": "square_hd",
  "output_format": "png"
}'
Errors
400Invalid request.
401Missing or invalid API key.
402Insufficient credits, or the key’s spending cap is exhausted.
404Model not found.
429Rate limit exceeded.
More from Alibaba
Wan 2.7
wan-2.7
Wan 2.7 Video
wan-2.7-video