Skip to content
EN

qwen-image (文生图)

方法: POST路径: /v1/images/generations

最终会转换成比例,建议直接使用 aspect_ratio

请求参数

Header 参数

text
Authorization
string
可选
默认值:
Bearer {{YOUR_API_KEY}}

Body 参数 application/json

text
model
string
必需
prompt
string
必需
size
string
可选
最终会转换成比例,建议直接使用 aspect_ratio
aspect_ratio
string
可选
21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21
示例
{
"size"
:
"1024x1024"
,
"prompt"
:
"cat"
,
"model"
:
"qwen-image"
,
"n"
:
1
}

请求示例代码

Shell

bash
curl --location --request POST '/v1/images/generations' \
--header 'Authorization: Bearer {{YOUR_API_KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "size": "1024x1024",
    "prompt": "cat",
    "model": "qwen-image",
    "n": 1
}'

返回响应

🟢 200 成功

内容类型: application/json

响应结构

text
object

示例

json
{}