Overview
Qwen Image is an asynchronous image-to-image API. Provide one source image and a prompt, then poll the task until the generated variants are ready.| Capability | Value |
|---|---|
| Model ID | qwen |
| Mode | image-to-image |
| Prompt length | 1-2000 characters |
| Source image | Exactly 1 public image_url |
| Images per task | num_images must be 1, 2, 3, or 4 |
| Aspect ratios | 1:1, 4:3, 3:4, 9:16, 16:9 |
| Speed options | none, regular, high |
| Output formats | png, jpeg |
Endpoint and authentication
Base URL:| Method | Endpoint | Purpose |
|---|---|---|
POST | /generateTask/qwen | Submit an image-to-image task |
GET | /statusTask/qwen?taskId={taskId} | Poll task status and retrieve results |
Copy-paste async quickstart
taskId; you need it to poll for the final result.
Poll for result
resultJson after state becomes success:
Request body
Parameters
Result delivery mode. Use
async for polling with statusTask, or callback for webhook delivery.Required when
request_type is callback. Must be a callback URL that can receive the final task payload. See Webhooks.Qwen Image input parameters.
Response format
Submit task response
POST /generateTask/qwen returns a task ID when the task is accepted:
API status code.
200 means the task was accepted.Human-readable status message.
Unique task identifier used with the status endpoint.
Status response fields
Unique task identifier.
Current task state:
pending, processing, success, or failed.JSON string containing generated image URLs in
resultUrls. Present when state is success.Machine-readable failure code. Present when
state is failed.Human-readable failure message. Present when
state is failed.Task creation timestamp in Unix milliseconds.
Task completion timestamp in Unix milliseconds. Present after completion.
Processing duration in milliseconds when available.
Webhook callback mode
Use callback mode when your backend should receive the final result automatically instead of polling.Billing
Qwen Image is billed by the requestednum_images value.
| Requested images | APIXO price |
|---|---|
1 | $0.025 / generation |
2 | $0.050 / generation |
3 | $0.075 / generation |
4 | $0.100 / generation |
Latency and polling
Qwen Image tasks are asynchronous. Actual latency varies by source image fetch speed, requested image count, prompt complexity, and queue load.| Use case | Recommended first poll | Poll interval |
|---|---|---|
| Normal image-to-image task | 10s-15s after task creation | 5s-10s |
| Multiple outputs or high-concurrency workloads | Prefer callback mode | If polling, use 10s or longer |
429, slow down requests and retry with backoff. For account-level details, see System APIs.
Errors and troubleshooting
HTTP errors
| Code | Meaning | What to do |
|---|---|---|
400 | Invalid request body, parameter type, or value | Fix the request before retrying |
401 | Missing or invalid API key | Check the Authorization header |
402 | Insufficient balance or quota | Add balance or switch account/key |
403 | Key or route cannot access the model | Check permissions and route strategy |
404 | Task not found | Verify the taskId and model ID |
429 | Rate limit or concurrency limit reached | Retry with exponential backoff |
500 | Server or unmapped model error | Retry with backoff |
502 | Model service error | Retry with backoff |
504 | Model service timeout | Retry or use callback mode for long-running jobs |
Request validation
| Condition | Backend behavior |
|---|---|
Missing input | Returns The required parameter {{input}} is missing. |
Missing prompt | Returns The required parameter {{prompt}} is missing. |
| Prompt is empty or too long | Returns a validation or length error |
Missing image_url | Returns The required parameter {{image_url}} is missing. |
Invalid num_images | Returns The parameter {{num_images}} must be 1, 2, 3 or 4. |
Invalid aspect_ratio | Returns the supported aspect-ratio list |
Invalid speed | Returns The parameter {{speed}} must be either 'none', 'regular' or 'high'. |
Invalid output_format | Returns The parameter {{output_format}} must be either 'jpeg' or 'png'. |