Skip to content
English

Qwen Image 2.0

POST /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 for posters, social images, and fast image generation.

Production guidance

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

Chinese text rendering

Use when the image needs Chinese headlines, signs, or poster text.

prompt
Low-cost batches

Useful for content production, social images, and quick prototypes.

size
Negative constraints

Use negative_prompt to exclude unwanted elements.

negative_prompt
Prompt optimization

Enable prompt_extend when automatic prompt optimization is useful.

prompt_extend

Request parameters

model string required

Fixed value qwen-image-2.0.

example qwen-image-2.0
input object required

Business parameters.

prompt string required

Positive prompt text.

size enum optional

Output image size. Use WIDTH*HEIGHT.

default 2048*2048 enum: 2688*15362368*17282048*20481728*23681536*2688
negative_prompt string optional

Negative prompt.

default
prompt_extend boolean optional

Whether to optimize the prompt.

default true
watermark boolean optional

Whether to add a watermark.

default false
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.

example https://your-domain.com/hiapi/callback
when enum optional

Callback trigger timing. Use final for terminal-state notifications.

default final enum: final

Example requests

Basic text-to-image

Pass a prompt, size, and basic generation options.

Request body
{
  "model": "qwen-image-2.0",
  "input": {
    "prompt": "A small red apple on a pure white ceramic plate, white tabletop, studio lighting, photorealistic photography, no people, no landscape",
    "size": "2048*2048",
    "negative_prompt": "text, people, landscape, low resolution, malformed",
    "prompt_extend": false,
    "watermark": false
  }
}
With negative prompt

Exclude unwanted visual elements.

Request body
{
  "model": "qwen-image-2.0",
  "input": {
    "prompt": "A Chinese New Year poster with a clear readable Chinese headline, red and gold palette, festival lanterns",
    "size": "1728*2368",
    "negative_prompt": "blurry text, distorted characters, low resolution",
    "prompt_extend": true,
    "watermark": false
  }
}

Getting the result

  1. The response returns a taskId immediately without waiting for generation to finish.
  2. In production, prefer waiting for callback.url to receive the terminal notification. For local debugging, poll GET /v1/tasks/:id.
  3. When status=success, download the generated image from output[].url.
  4. When status=fail, fix the request based on the returned error instead of retrying the same invalid payload.

Next steps