ナビゲーションにスキップ

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