Generate Images (Qwen Native Format)
Besides the OpenAI-compatible format, YouQi AI also supports Alibaba Cloud Bailian's Qwen-Image native request structure. The endpoint path is the same; the gateway routes based on the model field in the request body. The request body shape (input.messages) differs from the OpenAI format. See also Edit images.
Endpoint
POST /v1/images/generationsRequest parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model identifier, e.g. qwen-image |
input.messages | array | Yes | Message list; content is an array with a text item |
parameters.size | string | No | Image size, e.g. 1328*1328 |
parameters.negative_prompt | string | No | Negative prompt |
parameters.prompt_extend | boolean | No | Whether to auto-expand the prompt |
parameters.watermark | boolean | No | Whether to add a watermark |
Request example
bash
curl https://ai.youqi.tech/v1/images/generations \
-H "Authorization: Bearer sk-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image",
"input": {
"messages": [
{ "role": "user", "content": [{ "text": "A white fox running under a starry sky, photorealistic" }] }
]
},
"parameters": { "size": "1328*1328", "watermark": false }
}'Response example
json
{
"created": 1715367049,
"data": [{ "url": "https://.../generated-image.png" }]
}TIP
The Qwen native format shares the same endpoint path as the OpenAI-compatible format; the gateway distinguishes formats by request body shape — do not mix the two body styles.