Skip to content

Qwen image generation

and share a unified text-to-image endpoint.
http
POST /v1/images/generations
  • When you need or , prefer the native multimodal structure.
  • For basic parameters only, you can use the OpenAI-simplified structure.

Available models

Headers

NameTypeRequiredDescription
stringYesRequest authentication. Use a Bearer Token, for example:
stringYesRequest content type; must be

Request body

NameTypeRequiredDescription
stringYesMust be or
stringNoGeneration prompt for the simplified format; can be omitted when is provided
objectNoNative multimodal input containing . When provided, top-level may be empty; at least one of or top-level must supply valid text
objectNoQwen image generation parameters. When provided explicitly, the adapter uses them directly and does not copy , , or from the top level
stringNoSimplified-format output size as (e.g. )
integerNoSimplified-format output count. Treated as when omitted or
booleanNoSimplified-format watermark switch

input.messages item

NameTypeRequiredDescription
stringYesMessage role; fixed to
arrayYesMessage content list. Each element is either or . Text-to-image uses a single ; image-to-image / edit uses 1–3 items plus one

input.messages.content item

NameTypeRequiredDescription
stringNoText content: the generation prompt or edit instruction. For text-to-image, exactly one is required
stringNoReference image URL (HTTP/HTTPS) or a Data URL with MIME prefix. For image-to-image / edit, provide 1–3. Formats: JPG, JPEG, PNG, BMP, TIFF, WEBP, GIF. Official recommendation: width/height between 384–2048 px; each file ≤ 10 MB

parameters

NameTypeRequiredDescription
stringNoOutput size in native format (e.g. ). The simplified format uses top-level as
integerNoNumber of output images; upstream currently allows 1–6. Treated as when omitted or
booleanNoWhether to add a watermark
booleanNoWhether to enable prompt expansion
integerNoRandom seed

OpenAI-simplified structure

When using basic parameters only, pass , , , and at the top level. The adapter applies these conversions:

  • Maps to .
  • Converts in to the native separator.
  • Sets to when is omitted or .

Request example

bash
curl --request POST https://octopusx.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "qwen-image-3.0",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          { "text": "A warm film-style afternoon street portrait, the person holding a rose bouquet, backlight, shallow depth of field" }
        ]
      }
    ]
  },
  "parameters": {
    "prompt_extend": true,
    "size": "1080*1080",
    "n": 1,
    "watermark": false,
    "seed": 123456
  }
}'
bash
curl --request POST https://octopusx.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "qwen-image-3.0",
  "prompt": "A warm film-style afternoon street portrait",
  "size": "1080x1080",
  "n": 1,
  "watermark": false
}'

Response example

json
{
  "created": 1788188983,
  "data": [
    {
      "url": "https://example.com/generated.png"
    }
  ],
  "metadata": {
    "output": {
      "choices": [
        {
          "finish_reason": "stop",
          "message": {
            "role": "assistant",
            "content": [
              {
                "type": "image",
                "image": "https://example.com/generated.png"
              }
            ]
          }
        }
      ]
    },
    "request_id": "example-request-id",
    "usage": {
      "input_image_count": 0,
      "input_image_type": "qima_input_1k",
      "output_image_count": 1,
      "output_image_type": "qima_output_1k",
      "output_width": 1080,
      "output_height": 1080
    }
  }
}

Response fields

NameTypeDescription
integerUnix timestamp when AIX processed the request
array<object>OpenAI-style image result array
stringImage URL returned by upstream
stringPresent when upstream returns text content
objectRaw upstream response
objectRaw upstream output; holds the actual image URL. When is empty, use this field with to check whether upstream returned an image
stringUpstream request ID
objectInput/output image counts and resolution info
objectError object on failure (e.g. HTTP 400), with / (currently fixed ) / /