> ## 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.

# Create a Qwen image edit task

> Create an asynchronous Qwen image edit task.



## OpenAPI

````yaml openapi/qwen-image-edit.yaml POST /qwen-image-edits/generations
openapi: 3.1.0
info:
  title: Qwen Image Edit API
  version: 1.0.0
  description: Model-specific GENGEN reference for asynchronous Qwen image editing.
servers:
  - url: https://gengen.farm/api/gengen/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /qwen-image-edits/generations:
    post:
      summary: Create a Qwen image edit task
      description: >-
        Create an asynchronous edit task from one source image and a text
        instruction.
      operationId: createQwenImageEditTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateQwenImageEditTaskRequest'
            example:
              model: qwen-image-edit-spicy
              prompt: Change the background to a sunny beach scene
              assets:
                referenceImages:
                  - https://example.com/photo.png
              controls:
                seed: 42
      responses:
        '200':
          description: The task was accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageTask'
              example:
                id: qwenedit:550e8400-e29b-41d4-a716-446655440000
                model: qwen-image-edit-spicy
                status: pending
                outputs:
                  images: []
                createdAt: '2026-06-18T08:00:00.000Z'
                updatedAt: '2026-06-18T08:00:00.000Z'
                statusUpdateTime: '2026-06-18T08:00:00.000Z'
        '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: Create task
          source: |
            curl --request POST \
              --url https://gengen.farm/api/gengen/v1/qwen-image-edits/generations \
              --header 'Authorization: Bearer gengen_live_xxxxxxxxxxxxxxxx' \
              --header 'Content-Type: application/json' \
              --data '{
                "model": "qwen-image-edit-spicy",
                "prompt": "Change the background to a sunny beach scene",
                "assets": {
                  "referenceImages": [
                    "https://example.com/photo.png"
                  ]
                },
                "controls": {
                  "seed": 42
                }
              }'
components:
  schemas:
    CreateQwenImageEditTaskRequest:
      type: object
      required:
        - model
        - prompt
        - assets
      properties:
        model:
          type: string
          const: qwen-image-edit-spicy
          description: Use the `qwen-image-edit-spicy` model.
        prompt:
          type: string
          minLength: 1
          description: Describe the edit to apply.
        assets:
          $ref: '#/components/schemas/QwenImageEditAssets'
        controls:
          $ref: '#/components/schemas/QwenImageEditControls'
      additionalProperties: false
    ImageTask:
      type: object
      required:
        - id
        - model
        - status
        - outputs
      properties:
        id:
          type: string
        model:
          type: string
          const: qwen-image-edit-spicy
        status:
          type: string
        outputs:
          $ref: '#/components/schemas/ImageOutputs'
        failureReason:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        statusUpdateTime:
          type: string
          format: date-time
      additionalProperties: true
    QwenImageEditAssets:
      type: object
      required:
        - referenceImages
      properties:
        referenceImages:
          type: array
          minItems: 1
          maxItems: 1
          description: >-
            Exactly one source image as a public image URL, image data URL, or
            Base64 image string.
          items:
            type: string
      additionalProperties: false
    QwenImageEditControls:
      type: object
      properties:
        seed:
          description: Pass `null`, `0`, or omit for provider-selected randomness.
          oneOf:
            - type: integer
            - type: 'null'
      additionalProperties: false
    ImageOutputs:
      type: object
      required:
        - images
      properties:
        images:
          type: array
          items:
            type: string
            format: uri
      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_`.

````