Skip to main content
POST
  1. After submission, a task_id will be returned. If you provided a callback_url, when the task status becomes finished or failed, a POST request will be sent to the callback_url.
  2. Regardless of whether callback_url is provided, you can retrieve the result through the unified Query Task Status endpoint.
Use qwen-image-2.1 for text-to-image generation, multi-reference image editing, transparent assets, and local edits. Each request produces one image. Omit image_urls or pass an empty array for text-to-image. Provide 1–10 reference image URLs for image-to-image. Reference order matches references in your prompt, such as “the first image”. For stronger detail preservation, use four or fewer reference images.

Models

  • qwen-image-2.1 — Qwen Image 2.1

Required parameters

  • prompt is required, with non-empty text up to 5,000 characters.

Optional parameters

  • image_urls accepts up to 10 publicly accessible HTTP(S) reference URLs. JPEG, PNG, and WebP are supported, up to 30MB and 25MP per image. Media limits are checked during generation.
  • size supports 1:1, 4:3, 3:4, 3:2, 2:3, 16:9, 9:16, 21:9, and 9:21. Reference-image requests also support auto. Defaults to 1:1 for text-to-image and auto for image-to-image.
  • resolution supports 1K (default) and 2K.
  • output_format supports png (default), webp, and jpeg.
  • prompt_extend controls prompt enhancement, enabled by default.
  • enable_safety_checker controls content safety checking, enabled by default.
  • background supports opaque (default) and transparent. Transparent output requires PNG or WebP.
  • mask_url accepts an HTTP(S) mask URL, used with exactly one reference image and an opaque background.
  • seed accepts an optional integer. Omit it to generate with a random seed.
Use size, prompt_extend, and enable_safety_checker as shown above. negative_prompt and multiple-image output parameters are not supported.

Examples

Text-to-Image

Multi-Reference Generation

Replace the example URLs with publicly accessible images.

Transparent Assets

Describe the subject only. Background, scene, or surface descriptions may prevent a transparent result. JPEG cannot carry transparency.

Mask Editing

White mask areas are edited; black areas stay unchanged. Use a mask with the same aspect ratio as the reference image; its dimensions are scaled to the reference. Exactly one reference image is required, and transparent backgrounds are unavailable in this mode. The output follows the reference image’s aspect ratio. size and prompt_extend are ignored when a mask is supplied.

Authorizations

Authorization
string
header
required

All API endpoints require Bearer Token authentication.

Create an API key: sign in to PoYo, open Dashboard → API Key at poyo.ai/dashboard/api-key, and click to create a key.

Add it to the request header:

Body

application/json
model
enum<string>
required
Available options:
qwen-image-2.1
input
object
required
callback_url
string<uri>

Response

Task submitted successfully

code
enum<integer>
required

Business status code. 200 means success; any other value means the request failed. Always check this field: some validation errors return HTTP 200 with code: 400 in the body.

  • 200: Success
  • 400: Invalid request parameters
  • 401: Missing or invalid API key
  • 402: Insufficient credits
  • 403: Permission denied
  • 404: Resource not found
  • 408: Request timeout
  • 429: Rate limit exceeded
  • 500: Internal server error
  • 502: Upstream service error
  • 503: Service unavailable

See Error Codes for details.

Available options:
200,
400,
401,
402,
403,
404,
408,
429,
500,
502,
503
Example:

200

data
object
required