Skip to content
中文

qwen-image (Text-to-Image)

Method: POSTEndpoint: /v1/images/generations

This section contains endpoint-specific behavior, parameters, or usage notes for this API.

Request Parameters

Header Parameters

text
Authorization
string
Optional
Default Value:
Bearer {{YOUR_API_KEY}}

Body Parameters application/json

text
model
string
Required
prompt
string
Required
size
string
Optional
This is ultimately converted into a ratio, so using aspect_ratio directly is recommended.
aspect_ratio
string
Optional
21:9, 16:9, 4:3, 3:2, 1:1, 2:3, 3:4, 9:16, 9:21
Example
{
"size"
:
"1024x1024"
,
"prompt"
:
"cat"
,
"model"
:
"qwen-image"
,
"n"
:
1
}

Example Request

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
}'

Response

🟢 200 Success

Content Type: application/json

Response Schema

text
object

Example

json
{}