Qwen Image 2.0
/v1/tasks All models are called through the Unified Async API POST /v1/tasks endpoint; only the input fields differ (see input parameters below).
Model summary
| Model name | qwen-image-2.0 |
|---|---|
| Type | Image generation |
| Endpoint | POST /v1/tasks |
| Pricing | See HiAPI Pricing |
Qwen Image 2.0 is a low-cost image model with strong Chinese prompt and text-rendering behavior. The current docs show the tested native structure.
Production guidance
- For production, pass callback.url at the top level of the request body so HiAPI can notify your service when the task reaches a terminal state.
- GET /v1/tasks/:id is better for local debugging, low-volume jobs, or fallback reconciliation if a callback is missed.
- Use callback.when=final. Both success and fail are terminal states, so your service should deduplicate by taskId.
Best suited for
Use when the image needs Chinese headlines, signs, or poster text.
input.messages[].content[].textUseful for content production, social images, and quick prototypes.
parameters.sizeUse negative_prompt to exclude unwanted elements.
parameters.negative_promptEnable prompt_extend when automatic prompt optimization is useful.
parameters.prompt_extendRequest parameters
model string required Fixed value qwen-image-2.0.
input object required Business parameters. The tested structure is input.messages plus parameters.
input.messages[].role enum required User message role. Fixed to user.
input.messages[].content[].text string required Positive prompt text.
parameters.size enum optional Output image size. Use WIDTH*HEIGHT.
parameters.negative_prompt string optional Negative prompt.
parameters.prompt_extend boolean optional Whether to optimize the prompt.
parameters.watermark boolean optional Whether to add a watermark.
parameters.seed integer optional Random seed, range 0-2147483647.
callback object optional Optional callback configuration. In production, pass callback.url so HiAPI can notify your service when the task reaches a terminal state.
url string required HTTPS URL that receives terminal task notifications.
when enum optional Callback trigger timing. Use final for terminal-state notifications.
Example requests
Current docs show the tested native input.messages structure.
{
"model": "qwen-image-2.0",
"input": {
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "A small red apple on a white table, clean studio lighting"
}
]
}
]
},
"parameters": {
"size": "1328*1328",
"n": 1,
"prompt_extend": false,
"watermark": false
}
}
}Exclude unwanted visual elements.
{
"model": "qwen-image-2.0",
"input": {
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "A Chinese New Year poster with clear readable Chinese headline"
}
]
}
]
},
"parameters": {
"size": "1328*1328",
"n": 1,
"negative_prompt": "blurry text, distorted characters",
"prompt_extend": true,
"watermark": false
}
}
}Getting the result
- The response returns a taskId immediately without waiting for generation to finish.
- In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
- When status=success, download the generated image from output[].url.
- When status=fail, fix the request based on the returned error instead of retrying the same invalid payload.