> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dreamto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create image

> Qwen-Image generation and editing (Alibaba Cloud Model Studio DashScope protocol). The single message in `input.messages` with only one `text` is text-to-image; adding 1–3 `image` items makes it image-to-image / editing. The request is synchronous and blocks until the images are ready, returning their links (PNG, valid for 24 hours) in `output.choices[0].message.content`.



## OpenAPI

````yaml /openapi/en/qwen-image-3-0-pro.json post /api/v1/services/aigc/multimodal-generation/generation
openapi: 3.1.0
info:
  description: >-
    Qwen-Image 3.0 Pro: the flagship Qwen image generation and editing 3.0 model
    from Alibaba Cloud, with upgraded text rendering, realistic textures and
    semantic adherence, for text-to-image and editing with 1–3 images.
  title: Qwen-Image 3.0 Pro
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: Qwen-Image 3.0 Pro
paths:
  /api/v1/services/aigc/multimodal-generation/generation:
    post:
      tags:
        - Qwen-Image 3.0 Pro
      summary: Create image
      description: >-
        Qwen-Image generation and editing (Alibaba Cloud Model Studio DashScope
        protocol). The single message in `input.messages` with only one `text`
        is text-to-image; adding 1–3 `image` items makes it image-to-image /
        editing. The request is synchronous and blocks until the images are
        ready, returning their links (PNG, valid for 24 hours) in
        `output.choices[0].message.content`.
      operationId: qwenImageGenerate
      requestBody:
        content:
          application/json:
            examples:
              Text to image:
                description: >-
                  `content` holds a single `text`; `size` is `WIDTH*HEIGHT`,
                  here 1328*1328 (1:1, 1K tier).
                summary: Text to image
                value:
                  model: qwen-image-3.0-pro
                  input:
                    messages:
                      - role: user
                        content:
                          - text: >-
                              An orange cat sitting on a sunlit wooden
                              windowsill, a city street after the rain outside,
                              droplets on the glass, soft natural light,
                              photorealistic
                  parameters:
                    size: 1328*1328
                    'n': 1
                    prompt_extend: true
                    watermark: false
              Poster with text:
                description: >-
                  Put the words to render in quotes; 16:9 landscape (1664*928),
                  `negative_prompt` excludes unwanted elements and rewriting is
                  off to follow the prompt literally.
                summary: Poster with text
                value:
                  model: qwen-image-3.0-pro
                  input:
                    messages:
                      - role: user
                        content:
                          - text: >-
                              A Mid-Autumn Festival poster: a golden full moon
                              in a deep blue night sky above the eaves and stone
                              bridge of a water town, the words "Full Moon,
                              Family Reunion" in gold calligraphy in the center
                              and a small line "Mid-Autumn 2026" at the bottom
                  parameters:
                    negative_prompt: low resolution, misspelled text, blurry, watermark
                    size: 1664*928
                    prompt_extend: false
              Prompt rewriting (agent mode):
                description: >-
                  A short prompt with `prompt_extend_mode: agent` (text-to-image
                  only) and `enable_thinking: true`: the model expands it in
                  more detail before generating, which takes longer.
                summary: Prompt rewriting (agent mode)
                value:
                  model: qwen-image-3.0-pro
                  input:
                    messages:
                      - role: user
                        content:
                          - text: A cafe in the middle of a forest
                  parameters:
                    prompt_extend: true
                    prompt_extend_mode: agent
                    enable_thinking: true
              Edit an image:
                description: >-
                  `content` holds one `image` and one instruction; `n: 2`
                  returns two candidates.
                summary: Edit an image
                value:
                  model: qwen-image-3.0-pro
                  input:
                    messages:
                      - role: user
                        content:
                          - image: https://your-cdn.example.com/portrait.png
                          - text: >-
                              Keep the face and hairstyle, change the outfit to
                              an off-white suit and the background to a modern
                              minimalist cafe
                  parameters:
                    'n': 2
                    prompt_extend: true
              Multi-image fusion:
                description: >-
                  Up to 3 images, referred to as "image 1", "image 2", "image 3"
                  in array order.
                summary: Multi-image fusion
                value:
                  model: qwen-image-3.0-pro
                  input:
                    messages:
                      - role: user
                        content:
                          - image: https://your-cdn.example.com/girl.png
                          - image: https://your-cdn.example.com/necklace.png
                          - image: https://your-cdn.example.com/bag.png
                          - text: >-
                              The girl in image 1 wears the necklace from image
                              2 and carries the bag from image 3 on her left
                              shoulder
                  parameters:
                    size: 1104*1472
                    seed: 42
              Base64 image input:
                description: >-
                  Images can also be sent as `data:{MIME type};base64,{data}`,
                  here to edit the text in an image.
                summary: Base64 image input
                value:
                  model: qwen-image-3.0-pro
                  input:
                    messages:
                      - role: user
                        content:
                          - image: data:image/png;base64,<BASE64_IMAGE_DATA>
                          - text: >-
                              Change "Take a Breather" on the note to "Relax and
                              Recharge" and keep the font and color
                  parameters:
                    prompt_extend: false
              2K output:
                description: >-
                  `size: 2048*2048` (more than 2,250,000 pixels, billed in the
                  2K tier) with a fixed `seed` for reproducibility.
                summary: 2K output
                value:
                  model: qwen-image-3.0-pro
                  input:
                    messages:
                      - role: user
                        content:
                          - text: >-
                              Macro photo of a green leaf with dew drops, sharp
                              veins, soft bokeh background, early-morning
                              backlight
                  parameters:
                    size: 2048*2048
                    watermark: false
                    seed: 20261117
            schema:
              $ref: '#/components/schemas/QwenImageRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                Text-to-image result:
                  description: >-
                    One 1024*1024 image in the 1K tier; without rewriting
                    `rewrite_status` is `not_use`.
                  summary: Text-to-image result
                  value:
                    request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                    output:
                      choices:
                        - finish_reason: stop
                          message:
                            role: assistant
                            content:
                              - type: image
                                image: >-
                                  https://dashscope-463f.oss-accelerate.aliyuncs.com/1d/bd/20261117/2299ae9b/qwen_image3_serving_output_0.png?Expires=1794997226&Signature=...
                      rewrite_status: not_use
                    usage:
                      output_width: 1024
                      output_height: 1024
                      input_image_count: 0
                      input_image_type: qima_input_1k
                      output_image_count: 1
                      output_image_type: qima_output_1k
                Edit result (two images):
                  description: >-
                    With `n: 2` all images are in `choices[0].message.content`;
                    `input_image_count` is the number of input images.
                  summary: Edit result (two images)
                  value:
                    request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                    output:
                      choices:
                        - finish_reason: stop
                          message:
                            role: assistant
                            content:
                              - type: image
                                image: >-
                                  https://dashscope-463f.oss-accelerate.aliyuncs.com/1d/bd/20261117/2299ae9b/qwen_image3_serving_output_0.png?Expires=1794997284&Signature=...
                              - type: image
                                image: >-
                                  https://dashscope-463f.oss-accelerate.aliyuncs.com/1d/bd/20261117/2299ae9b/qwen_image3_serving_output_1.png?Expires=1794997284&Signature=...
                      rewrite_status: success
                    usage:
                      output_width: 1328
                      output_height: 1328
                      input_image_count: 1
                      input_image_type: qima_input_1k
                      output_image_count: 2
                      output_image_type: qima_output_1k
                2K result:
                  description: >-
                    Above 2,250,000 output pixels `output_image_type` is
                    `qima_output_2k` and the 2K tier applies.
                  summary: 2K result
                  value:
                    request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                    output:
                      choices:
                        - finish_reason: stop
                          message:
                            role: assistant
                            content:
                              - type: image
                                image: >-
                                  https://dashscope-463f.oss-accelerate.aliyuncs.com/1d/bd/20261117/2299ae9b/qwen_image3_serving_output_0.png?Expires=1794997390&Signature=...
                      rewrite_status: success
                    usage:
                      output_width: 2048
                      output_height: 2048
                      input_image_count: 0
                      input_image_type: qima_input_2k
                      output_image_count: 1
                      output_image_type: qima_output_2k
              schema:
                $ref: '#/components/schemas/QwenImageResponse'
          description: >-
            Images generated. The links are in
            `output.choices[0].message.content[].image` and `usage` holds the
            billed quantities; `request_id` equals the `X-Request-Id` header.
          headers:
            X-Request-Id:
              description: ID of this request; include it when reporting issues.
              schema:
                type: string
        '400':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                    code: InvalidParameter
                    message: input.messages[0].content accepts at most 3 images.
              schema:
                $ref: '#/components/schemas/QwenImageErrorResponse'
          description: >-
            Bad request, not charged: the gateway's validation failed (`code`
            `InvalidParameter` with an English `message`) or the model rejected
            it (the official `code` is kept, e.g. `InvalidParameter` or
            `DataInspectionFailed`).
        '401':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                    code: InvalidApiKey
                    message: Invalid API key.
              schema:
                $ref: '#/components/schemas/QwenImageErrorResponse'
          description: >-
            The API Key is missing or invalid (`code` `InvalidApiKey`). Not
            charged.
        '402':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                    code: Arrearage
                    message: Insufficient balance.
              schema:
                $ref: '#/components/schemas/QwenImageErrorResponse'
          description: >-
            The DreamTo balance does not cover the highest possible cost of the
            request (`code` `Arrearage`); top up and retry. Not charged.
        '429':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                    code: Throttling
                    message: Requests are being throttled. Please retry later.
              schema:
                $ref: '#/components/schemas/QwenImageErrorResponse'
          description: >-
            Too many requests (`code` `Throttling`), from the model service or
            the rate limit of the DreamTo account or API Key; retry later. Not
            charged.
        '500':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_7c1e9a4b2d3f5a6b8c9d0e1f
                    code: InternalError
                    message: >-
                      The service is temporarily unavailable. Please retry
                      later.
              schema:
                $ref: '#/components/schemas/QwenImageErrorResponse'
          description: >-
            The service is temporarily unavailable (`code` `InternalError`);
            retry later. Not charged.
components:
  schemas:
    QwenImageRequest:
      additionalProperties: false
      description: Request body of image generation (DashScope protocol).
      properties:
        model:
          description: >-
            Model name.


            **Allowed values:**

            - `qwen-image-3.0-pro`: The flagship Qwen-Image 3.0 model, with the
            strongest text rendering, textures and semantic adherence
          enum:
            - qwen-image-3.0-pro
          type: string
        input:
          $ref: '#/components/schemas/QwenImageInput'
          description: 'Input: the prompt and optional reference images.'
        parameters:
          $ref: '#/components/schemas/QwenImageParameters'
          description: Optional generation parameters; all defaults apply when omitted.
      required:
        - model
        - input
      type: object
    QwenImageResponse:
      additionalProperties: false
      description: Successful response.
      properties:
        request_id:
          description: >-
            Request ID (issued by DreamTo), the same as the `X-Request-Id`
            header; include it when reporting issues.
          type: string
        output:
          $ref: '#/components/schemas/QwenImageOutput'
          description: Generation result.
        usage:
          $ref: '#/components/schemas/QwenImageUsage'
          description: >-
            Billed quantities of the call (image counts and tiers, not tokens);
            only returned on success.
      required:
        - request_id
        - output
        - usage
      type: object
    QwenImageErrorResponse:
      additionalProperties: false
      description: Error response (the official DashScope error envelope).
      properties:
        request_id:
          description: >-
            Request ID (issued by DreamTo), the same as the `X-Request-Id`
            header.
          type: string
        code:
          description: >-
            Error code, for example:

            - `InvalidParameter`: invalid request (including the gateway's
            validation)

            - `DataInspectionFailed`: the input or output failed content
            moderation

            - `Throttling`: too many requests

            - `InternalError`: service failure; retry later
          type: string
        message:
          description: Error message (English).
          type: string
      required:
        - request_id
        - code
        - message
      type: object
    QwenImageInput:
      additionalProperties: false
      description: Input.
      properties:
        messages:
          description: Messages; single-turn only, so exactly one message.
          items:
            $ref: '#/components/schemas/QwenImageMessage'
          maxItems: 1
          minItems: 1
          type: array
      required:
        - messages
      type: object
    QwenImageParameters:
      additionalProperties: false
      description: Generation parameters.
      properties:
        negative_prompt:
          description: >-
            Negative prompt: what should not appear in the image, e.g. "low
            resolution, misspelled text, blurry, extra fingers". Supported by
            the Qwen-Image 3.0 series.
          type: string
        size:
          description: >-
            Output resolution as `WIDTH*HEIGHT`, e.g. `1024*1024` or `1664*928`.
            For text-to-image and editing alike the total pixels must be between
            `512*512` and `2048*2048` and the aspect ratio between 1:8 and 8:1
            (the model service checks the pixel range). When omitted the model
            recommends a resolution from the prompt. Up to 2,250,000 total
            pixels is billed in the 1K tier, above it in the 2K tier.
          type: string
        'n':
          default: 1
          description: >-
            Number of images, 1–6, default 1. Billed per image; all images come
            back in the same `choices[0].message.content`.
          format: int64
          maximum: 6
          minimum: 1
          type: integer
        prompt_extend:
          default: true
          description: >-
            Whether to rewrite the prompt smartly; default `true` (recommended).
            The model optimizes the prompt as `prompt_extend_mode` selects,
            which helps short descriptions a lot; turn it off for detailed
            prompts or when latency matters.
          type: boolean
        prompt_extend_mode:
          default: direct
          description: >-
            Prompt rewriting mode, default `direct`; applies when
            `prompt_extend` is `true`.


            **Allowed values:**

            - `direct`: Direct Prompt Enhancement, fits most cases; supported
            for text-to-image and editing (default)

            - `agent`: Agent Prompt Enhancement, more refined rewriting;
            text-to-image only, editing with it returns 400
          enum:
            - direct
            - agent
          type: string
        enable_thinking:
          default: true
          description: >-
            Whether to enable thinking mode; default `true`. It strengthens
            reasoning for better images but takes longer, and needs
            `prompt_extend: true`. Supported for direct text-to-image, direct
            editing and agent text-to-image.
          type: boolean
        watermark:
          default: false
          description: Whether to add a watermark; default `false`.
          type: boolean
        seed:
          description: >-
            Random seed, `0`–`2147483647`; random when omitted. A fixed seed
            gives steadier results.
          format: int64
          maximum: 2147483647
          minimum: 0
          type: integer
      type: object
    QwenImageOutput:
      additionalProperties: false
      description: Generation result.
      properties:
        choices:
          description: >-
            Results, usually one item; with `n` above 1 all images are in that
            item's `message.content`.
          items:
            $ref: '#/components/schemas/QwenImageChoice'
          type: array
        rewrite_status:
          description: >-
            Prompt rewriting status, depending on whether rewriting was
            requested and how it went, e.g. `not_use` (rewriting off) or
            `success` (rewritten).
          type: string
      required:
        - choices
      type: object
    QwenImageUsage:
      additionalProperties: false
      description: Billed quantities.
      properties:
        output_width:
          description: Output image width in pixels.
          format: int64
          type: integer
        output_height:
          description: Output image height in pixels.
          format: int64
          type: integer
        input_image_count:
          description: >-
            Number of input images: 0 for text-to-image, the actual count for
            editing; billed per image.
          format: int64
          type: integer
        input_image_type:
          description: >-
            Input image tier, set by the output's total pixels: `qima_input_1k`
            up to 2,250,000, `qima_input_2k` above. Both tiers have the same
            input price.
          type: string
        output_image_count:
          description: Number of images returned; billed per image.
          format: int64
          type: integer
        output_image_type:
          description: >-
            Billing tier of the output images, set by their total pixels:
            `qima_output_1k` (1K tier) up to 2,250,000, `qima_output_2k` (2K
            tier) above.
          type: string
      required:
        - output_width
        - output_height
        - input_image_count
        - output_image_count
      type: object
    QwenImageMessage:
      additionalProperties: false
      description: A user message.
      properties:
        role:
          description: |-
            Message role, always `user`.

            **Allowed values:**
            - `user`: User message
          enum:
            - user
          type: string
        content:
          description: >-
            Content items, each `{"text": ...}` or `{"image": ...}`:

            - **Text-to-image**: a single `text`.

            - **Image-to-image / editing**: 1–3 `image` items plus one `text`.
            Images are "image 1", "image 2", "image 3" in array order.


            There must be exactly one `text`; none or several return 400.
          items:
            $ref: '#/components/schemas/QwenImageContent'
          maxItems: 4
          minItems: 1
          type: array
      required:
        - role
        - content
      type: object
    QwenImageChoice:
      additionalProperties: false
      description: One result.
      properties:
        finish_reason:
          description: |-
            Finish reason.

            **Allowed values:**
            - `stop`: Completed normally
          enum:
            - stop
          type: string
        message:
          $ref: '#/components/schemas/QwenImageResponseMessage'
          description: Message returned by the model.
      required:
        - finish_reason
        - message
      type: object
    QwenImageContent:
      additionalProperties: false
      description: 'One content item: set either `text` or `image`.'
      properties:
        text:
          description: >-
            Positive prompt describing the content, style and composition to
            generate or edit. Chinese and English are supported, ideally under
            4,500 tokens; it cannot be empty. Put words that should appear in
            the image in quotes.
          type: string
        image:
          description: >-
            Input image as a public `http` / `https` link or a Base64 data URI
            (`data:{MIME type};base64,{data}`). JPG, JPEG, PNG, BMP, TIFF, WEBP
            or GIF (first frame of animations only); width and height 1–8,000 px
            each, best at 384–2,048 px; long-to-short side ratio at most 10:1;
            up to 10 MB.
          type: string
      type: object
    QwenImageResponseMessage:
      additionalProperties: false
      description: Message returned by the model.
      properties:
        role:
          description: |-
            Message role.

            **Allowed values:**
            - `assistant`: Model reply
          enum:
            - assistant
          type: string
        content:
          description: Generated images, one per item.
          items:
            $ref: '#/components/schemas/QwenImageResponseImage'
          type: array
      required:
        - role
        - content
      type: object
    QwenImageResponseImage:
      additionalProperties: false
      description: A generated image.
      properties:
        type:
          description: |-
            Content type.

            **Allowed values:**
            - `image`: Image
          enum:
            - image
          type: string
        image:
          description: >-
            Image link (PNG), valid for 24 hours; download and keep the image
            promptly.
          type: string
      required:
        - image
      type: object
  securitySchemes:
    bearerAuth:
      description: >-
        API Key created in the DreamTo console, sent as `Authorization: Bearer
        <API Key>`.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.