Qwen-Image API
A general-purpose Qwen text-to-image model with a standard 1,024 × 1,024 resolution.
- Model:
qwen-image - Provider: Alibaba
- Type: image
POST /v1/images/generations
qwen-image: Image generation, required fields, nested response schema and a fictional example.
Basic request
Required parameters: model, input
Available parameters: model, input, parameters
Request parameters
| Parameter | Type | Required | Description |
|---|
model | string | Yes | Exact model identifier shown on this page. Options: qwen-image |
input | object | Yes | Input object. |
parameters | object | No | Optional image settings. |
## Usage and response conventions
- Follow required fields and the nested schema. Optional settings without a documented numeric default use the current model default.
- Context, output budgets and media constraints differ by model. Unverified limits are not universal guarantees.
- An absent value differs from a reported zero. Read status, content and usage as actually returned.
- Replace example.invalid addresses with readable media you are authorized to use.
- Save generated files promptly; result links need not remain available indefinitely.
## Reference
Terminology: [Qwen Image](https://docs.modelstudio.console.alibabacloud.com/en/model-studio/qwen-image-api-reference). Use this page's platform base URL and exact model identifier for requests. Reviewed: 2026-11-07.
## Complete nested field reference
Array elements use []. Required flags apply only when the enclosing object or content-block variant is used. Response fields can be absent or null as described; false does not imply a fabricated zero.
### Request headers
| Field path | Type | Required in its object | Meaning |
|---|---|---|---|
| `Content-Type` | string | Yes | JSON request-body content type. |
### Request body
| Field path | Type | Required in its object | Meaning |
|---|---|---|---|
| `model` | string | Yes | Exact model identifier shown on this page. Values: qwen-image |
| `input` | object | Yes | Input object. |
| `input.prompt` | string | Yes | Image prompt. |
| `parameters` | object | No | Optional image settings. |
| `parameters.n` | integer | No | Image count; the example requests one. Default: 1; Minimum: 1 |
| `parameters.size` | string | No | Width*height, for example 1024*1024; supported sizes depend on the model. |
| `parameters.seed` | integer | No | Optional seed; it does not guarantee identical pixels. |
| `parameters.watermark` | boolean | No | Request a watermark. |
### Response 200
| Field path | Type | Required in its object | Meaning |
|---|---|---|---|
| `request_id` | string | No | Opaque request identifier. |
| `output` | object | No | Image output; read the choices or results actually returned. |
| `output.choices` | array[object] | No | Image choices returned by some models. |
| `output.choices[].message` | object | No | Image output message. |
| `output.choices[].message.role` | string | No | Message role. |
| `output.choices[].message.content` | array[object] | No | Result content blocks. |
| `output.choices[].message.content[].image` | string | No | Generated image URL. |
| `output.choices[].message.content[].text` | string | No | Additional text. |
| `output.results` | array[object] | No | Image list returned by some models. |
| `output.results[].url` | string | No | Generated image URL. |
| `output.task_status` | string | No | Task status when provided. |
| `usage` | object | No | Reported image usage. |
| `usage.image_count` | integer | No | Returned image count. |
### Error response structure
| Field path | Type | Required in its object | Meaning |
|---|---|---|---|
| `error` | object | No | Error details for this request. |
| `error.message` | string | No | Image output message. |
| `error.type` | string | No | Type discriminator; use the values documented for the enclosing object. |
| `error.code` | string | No | Error code; it may be empty. |
Request example
curl --request POST https://api.router.ai/v1/images/generations \
--header "Authorization: Bearer $API_KEY" \
--header "Content-Type: application/json" \
--data-raw '{
"model": "qwen-image",
"input": {
"prompt": "A fictional blue paper boat on a plain white background."
},
"parameters": {
"n": 1
}
}'
Endpoint reference: Aliyun Qwen-Image text-to-image