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_KEY

Request body

Content-Type:application/json

FieldTypeRequiredDescription
modelstring
inputobject
messagesobject[]
rolestring
contentobject[]
textstring
parametersobject
negative_promptstring
prompt_extendboolean
watermarkboolean
sizestring

Responses

200Image generated

FieldTypeRequiredDescription
createdinteger
dataobject[]
urlstring
b64_jsonstring
revised_promptstring

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