Skip to content

Qwen Image 2.0 API

Fast Qwen Image 2.0 text-to-image

qwen-image-v2SynchronousimageLive price on TokPort: $0.065 per image

Fields marked * are required. The same definitions are published as OpenAPI 3.0 (https://tokport.io/api/openapi?model=qwen-image-v2), ready for code generators and agents.

Text to image

POST /v1/images/generations

Input

FieldTypeDescription
model*stringModel id. Always "qwen-image-v2".
prompt*stringWhat to generate. Be concrete about subject, style, lighting and composition.
sizestring (enum)Output size as "WIDTHxHEIGHT" pixels.1024x10241536x10241024x1536default: 1024x1024
nintegerNumber of images to generate in one request. Each image is billed.default: 1range: 1–4
response_formatstring (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.