跳到导航

Qwen Image 2.1

Generate or edit an image with up to ten public HTTPS references, 1K or 2K output and optional transparent PNG or WebP.

Supported modes

ModeRequired inputRules
Text to imagemodel, promptOmit images.
Reference imagemodel, prompt, imagesProvide 1–10 public HTTPS image URLs.

Request rules: auto follows the first reference image; without images it renders 1:1. enhance_prompt defaults to true without images and false with images. A transparent background requires png or webp, not jpeg. Reference example URLs are placeholders; replace them with accessible HTTPS images. These examples describe the saved public contract, not completed model calls.

Async flow: Create the task, save data.id, then poll the Task with GET /v1/tasks/{task_id}. On succeeded, read data.output.media. On failed, read data.error_code and data.error_message, then follow the error and retry policy.

Using a local file? upload a local input first and pass the returned data.url.

身份验证

AuthorizationBearer

Send your API key as Authorization: Bearer <BEATAPI_API_KEY>.

请求头

Idempotency-Keystring可选<=255 characters

请求

This endpoint expects an object.
modelenum必需

Must be qwen-image-2.1.

允许的值:
promptstring必需1-5000 characters

Generation or reference-editing instructions, from 1 to 5000 characters.

aspect_ratioenum可选默认为 auto

auto follows the first reference image; without images it renders 1:1.

backgroundenum可选默认为 opaque
opaque or transparent. Transparent output requires PNG or WebP.
允许的值:
enhance_promptboolean可选

Rewrites the prompt before rendering. Defaults to true without images and false with images; no unconditional default.

imageslist of strings可选

One to ten public HTTPS image URLs. Omit for text-to-image.

output_formatenum可选默认为 png

Output file format. Use png or webp with transparent background; jpeg cannot retain alpha.

允许的值:
resolutionenum可选默认为 1K
Output tier, 1K or 2K. A prompt cannot select a different tier.
允许的值:
seedinteger可选0-2147483647

Optional integer from 0 to 2147483647; no -1 value and no documented default.

响应

Contract example only, not an executed task or generated result. The 1K example amount comes from the bundled Qwen price catalogue; actual usage is returned by the task.

错误

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error