Theme
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
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Request authentication. Use a Bearer Token, for example: | |
| string | Yes | Request content type; must be |
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Must be or | |
| string | No | Generation prompt for the simplified format; can be omitted when is provided | |
| object | No | Native multimodal input containing . When provided, top-level may be empty; at least one of or top-level must supply valid text | |
| object | No | Qwen image generation parameters. When provided explicitly, the adapter uses them directly and does not copy , , or from the top level | |
| string | No | Simplified-format output size as (e.g. ) | |
| integer | No | Simplified-format output count. Treated as when omitted or | |
| boolean | No | Simplified-format watermark switch |
input.messages item
| Name | Type | Required | Description |
|---|---|---|---|
| string | Yes | Message role; fixed to | |
| array | Yes | Message 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
| Name | Type | Required | Description |
|---|---|---|---|
| string | No | Text content: the generation prompt or edit instruction. For text-to-image, exactly one is required | |
| string | No | Reference 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
| Name | Type | Required | Description |
|---|---|---|---|
| string | No | Output size in native format (e.g. ). The simplified format uses top-level as | |
| integer | No | Number of output images; upstream currently allows 1–6. Treated as when omitted or | |
| boolean | No | Whether to add a watermark | |
| boolean | No | Whether to enable prompt expansion | |
| integer | No | Random 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
| Name | Type | Description |
|---|---|---|
| integer | Unix timestamp when AIX processed the request | |
| array<object> | OpenAI-style image result array | |
| string | Image URL returned by upstream | |
| string | Present when upstream returns text content | |
| object | Raw upstream response | |
| object | Raw upstream output; holds the actual image URL. When is empty, use this field with to check whether upstream returned an image | |
| string | Upstream request ID | |
| object | Input/output image counts and resolution info | |
| object | Error object on failure (e.g. HTTP 400), with / (currently fixed ) / / |