Qwen Image API

Model IDs, generation and reference-image examples, and task polling.

Use an Official Group API key. Qwen Image models use a separate image API from Qwen chat models that use Chat Completions.

Supported protocol

Generate with JSON POST /v1/images/generations, or upload files with POST /v1/images/edits (multipart/form-data). Submission returns 202 Accepted and a task id. Poll GET /v1/tasks/{id} until completed or failed. A 202 response is not a completed image.

This family uses Images + asynchronous tasks. Image generation through /v1/chat/completions or /v1/responses is not supported. See the complete submission and polling example.

Models and parameters

Public model IDresolutionnReference limit
qwen-image-2.01K / 2K1–61
qwen-image-2.0-pro1K / 2K1–61
qwen-image-3.01K / 2K1–63
qwen-image-3.0-pro1K / 2K1–63

resolution defaults to 1K and n to 1. Supported size ratios are 1:1, 4:3, 3:4, 16:9, 9:16, 3:2 and 2:3. Prompts are limited to 800 characters for 2.0 and 4000 for 3.0. Replace the example model with any ID in the table while respecting its reference-image limit.

Generate an image

Set APIPOOL_API_KEY to your key, then run:

APIPOOL_ENDPOINT="https://app.apipool.dev"

curl "$APIPOOL_ENDPOINT/v1/images/generations" \
  -H "Authorization: Bearer $APIPOOL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-image-3.0",
    "prompt": "A blue ceramic cup on a white table",
    "size": "1:1",
    "resolution": "1K",
    "n": 1
}'

Edit an image

Upload a local PNG, JPEG or WebP file, replacing source.png with its path:

curl "https://app.apipool.dev/v1/images/edits" \
  -H "Authorization: Bearer $APIPOOL_API_KEY" \
  -F "model=qwen-image-3.0" \
  -F "prompt=Change the cup to green" \
  -F "image=@./source.png" \
  -F "size=1:1" \
  -F "resolution=1K" \
  -F "n=1"

For multiple references, repeat -F "image=@./second.png" within the model's limit. To use publicly downloadable references, send image_urls to the same JSON generation endpoint:

{
  "model": "qwen-image-3.0",
  "prompt": "Change the cup to green",
  "size": "1:1",
  "resolution": "1K",
  "n": 1,
  "image_urls": ["https://your-cdn.example/source.png"]
}

Replace the example URL with a real address reachable by the server. Expired tunnels, DNS failures and download timeouts can fail the task. Browser-only localhost or authenticated image URLs are unsuitable.

Poll and retrieve results

Save the submission's id, such as imgtask_01..., and query with the same key:

TASK_ID="imgtask_01..."
curl "https://app.apipool.dev/v1/tasks/$TASK_ID" \
  -H "Authorization: Bearer $APIPOOL_API_KEY"

Continue polling for submitted, submission_unknown, processing or meter_pending. On completed, read data[].url and download before expiry. On failed, inspect error. Do not resubmit while waiting. See Asynchronous image tasks for all states, timeout handling and a runnable polling example.

Scope and billing

Send prompt and optional references, not Chat messages or Responses input. Image tasks do not support stream: true.

See the selected model and group in Models & pricing. Pricing and available parameter tiers depend on that listing. References for 3.0 / 3.0 Pro are billed individually.