Beta Qwen Image Generation & Editing API
POSThttps://api.yxai-tech.top/qwen-image/images

使用 Qwen Image 进行文生图与 1–3 张参考图编辑,支持批量输出、同步响应、异步任务和回调。

请求头

acceptstring
指定服务器返回响应的格式。如未指定,默认格式为 `application/json`。
请选择
authorizationstring
Bearer token

请求体

modelstring必填参数
{'zh-cn': '模型名称。qwen-image-3.0 适合高性价比批量创作;qwen-image-3.0-pro 提供更强细节与 1K/2K 分档。', 'en': 'Model ID. Use qwen-image-3.0 for efficient batch creation or qwen-image-3.0-pro for higher detail with 1K/2K pricing.'}
promptstring必填参数
{'zh-cn': '图像生成描述或编辑指令。编辑模式请同时传入 image_urls。', 'en': 'Generation prompt or editing instruction. Include image_urls for edit mode.'}
image_urlsarray
{'zh-cn': '可选参考图 URL 数组,支持 1–3 张;按真实输入张数计费。', 'en': 'Optional array of 1–3 reference image URLs, billed by the actual input image count.'}
ninteger
{'zh-cn': '输出图片数量,1–6 张。', 'en': 'Number of output images, from 1 to 6.'}
sizestring
{'zh-cn': '输出尺寸,像素面积需在 512×512 至 2048×2048 之间。', 'en': 'Output dimensions with pixel area between 512×512 and 2048×2048.'}
prompt_extendboolean
{'zh-cn': '是否增强提示词。', 'en': 'Whether to enhance the prompt.'}
请选择
prompt_extend_modestring
{'zh-cn': '提示词增强模式;agent 仅用于文生图。', 'en': 'Prompt enhancement mode; agent is text-to-image only.'}
请选择
enable_thinkingboolean
{'zh-cn': '是否启用增强推理。', 'en': 'Whether to enable enhanced reasoning.'}
请选择
negative_promptstring
{'zh-cn': '不希望出现在图像中的内容。', 'en': 'Content to exclude from the image.'}
seedinteger
{'zh-cn': '随机种子。', 'en': 'Random seed.'}
watermarkboolean
{'zh-cn': '是否添加水印。', 'en': 'Whether to add a watermark.'}
请选择
callback_urlstring
{'zh-cn': '异步完成回调地址。', 'en': 'Callback URL for asynchronous completion.'}
asyncboolean
{'zh-cn': '设为 true 时立即返回 task_id,并通过 /qwen-image/tasks 查询终态;任务查询不重复计费。', 'en': 'When true, returns a task_id immediately. Retrieve the terminal result through /qwen-image/tasks without an additional generation charge.'}
请选择

响应

集成指南

Shell

Python

JavaScript

Java

Go

PHP

温馨提示:对于流式请求,上面的代码可能不完全适用。请参阅对接文档以进行更改。

Qwen Image
允许用通用余额

启用「允许通用余额」后,专属余额不足将自动使用通用余额。