Skip to navigation

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.

Authentication

AuthorizationBearer

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

Headers

Idempotency-KeystringOptional<=255 characters

Request

This endpoint expects an object.
modelenumRequired

Must be qwen-image-2.1.

Allowed values:
promptstringRequired1-5000 characters

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

aspect_ratioenumOptionalDefaults to auto

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

backgroundenumOptionalDefaults to opaque
opaque or transparent. Transparent output requires PNG or WebP.
Allowed values:
enhance_promptbooleanOptional

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

imageslist of stringsOptional

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

output_formatenumOptionalDefaults to png

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

Allowed values:
resolutionenumOptionalDefaults to 1K
Output tier, 1K or 2K. A prompt cannot select a different tier.
Allowed values:
seedintegerOptional0-2147483647

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

Response

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.

Errors

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