Qwen Image 2.0 Pro API
Higher-quality Qwen Image 2.0
qwen-image-v2-proSynchronousimageLive price on TokPort: $0.17 per imageFields marked * are required. The same definitions are published as OpenAPI 3.0 (https://tokport.io/api/openapi?model=qwen-image-v2-pro), ready for code generators and agents.
Text to image
POST /v1/images/generationsInput
| Field | Type | Description |
|---|---|---|
| model* | string | Model id. Always "qwen-image-v2-pro". |
| prompt* | string | What to generate. Be concrete about subject, style, lighting and composition. |
| size | string (enum) | Output size as "WIDTHxHEIGHT" pixels.1024x10241536x10241024x1536default: 1024x1024 |
| n | integer | Number of images to generate in one request. Each image is billed.default: 1range: 1–4 |
| response_format | string (enum) | Return hosted URLs (expire after a while) or inline base64 PNG data.urlb64_jsondefault: url |
Output
Synchronous. `data[]` holds one entry per generated image with `url` (or `b64_json` when requested). The `X-Oneapi-Request-Id` response header identifies the request in your usage log.
{
"created": 1726400000,
"data": [
{
"url": "https://cdn.example.com/generated/abc.png",
"revised_prompt": "a neon koi swimming through clouds, cinematic lighting"
}
]
}Runnable example: API tab.