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

# Generate or edit images with Qwen Image 3.0

> Generate or edit images synchronously with Qwen Image 3.0.



## OpenAPI

````yaml openapi/qwen-image-3.yaml POST /qwen-images/generations
openapi: 3.1.0
info:
  title: Qwen Image 3.0 API
  version: 1.0.0
  description: >-
    Model-specific GENGEN reference for synchronous Qwen Image 3.0 generation
    and editing.
servers:
  - url: https://gengen.farm/api/gengen/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /qwen-images/generations:
    post:
      summary: Generate or edit images with Qwen Image 3.0
      description: >
        Generate or edit images synchronously with `qwen-image-3-0`.

        This operation exposes only the modes and parameters supported by Qwen
        Image 3.0.
      operationId: createQwenImage3Generation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateQwenImage3Request'
            examples:
              textToImage:
                summary: Text to image
                value:
                  model: qwen-image-3-0
                  mode: text_to_image
                  prompt: A cinematic night market poster with precise neon typography
                  controls:
                    outputCount: 1
                    size: 1024*1024
                    promptExtend: true
                    watermark: false
              imageEdit:
                summary: Image edit
                value:
                  model: qwen-image-3-0
                  mode: image_edit
                  prompt: Replace the background with a modern minimalist coffee shop
                  assets:
                    referenceImages:
                      - https://example.com/portrait.png
                  controls:
                    outputCount: 2
                    negativePrompt: blur, distorted text
                    seed: 42
                    watermark: false
      responses:
        '200':
          description: The generated images are returned synchronously.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResult'
              example:
                id: qwenimage3:571ae02f-5c9d-436c-83c2-f221e6df0000
                model: qwen-image-3-0
                status: succeeded
                outputs:
                  images:
                    - https://example.com/qwen-image-3/result.png
                usage:
                  width: 1024
                  height: 1024
                  imageCount: 1
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          $ref: '#/components/responses/Forbidden'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: bash
          label: Text to image
          source: |
            curl --request POST \
              --url https://gengen.farm/api/gengen/v1/qwen-images/generations \
              --header 'Authorization: Bearer gengen_live_xxxxxxxxxxxxxxxx' \
              --header 'Content-Type: application/json' \
              --data '{
                "model": "qwen-image-3-0",
                "mode": "text_to_image",
                "prompt": "A cinematic night market poster with precise neon typography",
                "controls": {
                  "outputCount": 1,
                  "size": "1024*1024",
                  "promptExtend": true,
                  "watermark": false
                }
              }'
        - lang: bash
          label: Image edit
          source: |
            curl --request POST \
              --url https://gengen.farm/api/gengen/v1/qwen-images/generations \
              --header 'Authorization: Bearer gengen_live_xxxxxxxxxxxxxxxx' \
              --header 'Content-Type: application/json' \
              --data '{
                "model": "qwen-image-3-0",
                "mode": "image_edit",
                "prompt": "Replace the background with a modern minimalist coffee shop",
                "assets": {
                  "referenceImages": [
                    "https://example.com/portrait.png"
                  ]
                },
                "controls": {
                  "outputCount": 2,
                  "negativePrompt": "blur, distorted text",
                  "seed": 42,
                  "watermark": false
                }
              }'
components:
  schemas:
    CreateQwenImage3Request:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          const: qwen-image-3-0
          description: Use the `qwen-image-3-0` model.
        mode:
          type: string
          description: >
            When omitted, GENGEN selects `image_edit` when reference images are
            present and `text_to_image` otherwise.


            Supported values:


            - `text_to_image` — generate images from a text prompt

            - `image_edit` — edit one to three reference images
          enum:
            - text_to_image
            - image_edit
        prompt:
          type: string
          minLength: 1
          description: >-
            Positive generation prompt or editing instruction. Chinese and
            English are supported.
        assets:
          $ref: '#/components/schemas/QwenImage3Assets'
        controls:
          $ref: '#/components/schemas/QwenImage3Controls'
      additionalProperties: false
    ImageGenerationResult:
      type: object
      required:
        - id
        - model
        - status
        - outputs
      properties:
        id:
          type: string
        model:
          type: string
          const: qwen-image-3-0
        status:
          type: string
          const: succeeded
        outputs:
          $ref: '#/components/schemas/ImageOutputs'
        usage:
          $ref: '#/components/schemas/ImageUsage'
      additionalProperties: true
    QwenImage3Assets:
      type: object
      properties:
        referenceImages:
          type: array
          minItems: 1
          maxItems: 3
          description: Required for `image_edit` and not accepted for `text_to_image`.
          items:
            type: string
            description: A public HTTP or HTTPS image URL or an image data URL.
      additionalProperties: false
    QwenImage3Controls:
      type: object
      properties:
        outputCount:
          type: integer
          minimum: 1
          maximum: 6
          default: 1
        size:
          type: string
          pattern: ^[0-9]+\*[0-9]+$
          example: 1024*1024
          description: >-
            Output size in `width*height` form. Total pixels must be between
            `512*512` and `2048*2048`.
        negativePrompt:
          type: string
          description: Content that should not appear in the generated image.
        seed:
          type: integer
          minimum: 0
          maximum: 2147483647
        promptExtend:
          type: boolean
          default: true
          description: Enable intelligent prompt rewriting.
        watermark:
          type: boolean
          default: false
          description: Add the provider watermark to generated images.
      additionalProperties: false
    ImageOutputs:
      type: object
      required:
        - images
      properties:
        images:
          type: array
          items:
            type: string
            format: uri
      additionalProperties: true
    ImageUsage:
      type: object
      properties:
        width:
          type: integer
        height:
          type: integer
        imageCount:
          type: integer
      additionalProperties: true
    Error:
      type: object
      properties:
        error_code:
          type: string
        error:
          type: string
        error_params:
          type: object
          additionalProperties: true
      additionalProperties: true
  responses:
    BadRequest:
      description: The request is invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: The bearer token is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: The workspace does not have enough available balance.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The API key is not authorized for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnexpectedError:
      description: GENGEN or the Qwen provider could not complete the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: GENGEN API key
      description: A workspace API key beginning with `gengen_live_`.

````