Generate image (qwen-image)
post/v1/images/generations
Image generation with the Bailian qwen-image series.
Authentication
Send your OLETOKEN API key as a Bearer token. Keys are created on the API Keys page of the console.
Authorization: Bearer $OLETOKEN_API_KEYRequest body
Content-Type:application/json
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | — | |
| input | object | — | |
| messages | object[] | — | |
| role | string | — | — |
| content | object[] | — | — |
| text | string | — | — |
| parameters | object | — | — |
| negative_prompt | string | — | — |
| prompt_extend | boolean | — | — |
| watermark | boolean | — | — |
| size | string | — | — |
Responses
200Image generated
| Field | Type | Required | Description |
|---|---|---|---|
| created | integer | — | — |
| data | object[] | — | — |
| url | string | — | — |
| b64_json | string | — | — |
| revised_prompt | string | — | — |
Example request
curl -X POST 'https://api.oletoken.ai/v1/images/generations' \
-H "Authorization: Bearer $OLETOKEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "qwen-image-plus",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "一副典雅庄重的对联悬挂于厅堂之中,房间是个安静古典的中式布置,桌子上放着一些青花瓷,对联上左书“义本生知人机同道善思新”,右书“通云赋智乾坤启数高志远”, 横批“智启通义”,字体飘逸,在中间挂着一幅中国风的画作,内容是岳阳楼。"
}
]
}
]
},
"parameters": {
"negative_prompt": "",
"prompt_extend": true,
"watermark": false,
"size": "1328*1328"
}
}'
