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

# Qwen Image Edit Max Task

> Retrieve the status and result of a generation task

## Overview

Retrieve the status and result of a qwen-image-edit-max generation task.

## Task Status

| Status       | Description                       |
| ------------ | --------------------------------- |
| `pending`    | Task is waiting to be processed   |
| `processing` | Task is currently being processed |
| `completed`  | Task completed successfully       |
| `failed`     | Task failed with an error         |

## Response

When the task is completed, the response will include the generated/edited image URLs in the `images` array. Each URL is valid for 24 hours.

## Example Responses

### Completed Task

```json theme={null}
{
  "task_info": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "completed",
    "created_at": "2025-02-09T10:30:00Z",
    "updated_at": "2025-02-09T10:30:45Z"
  },
  "images": [
    "https://example.com/edited-image-1.jpg",
    "https://example.com/edited-image-2.jpg"
  ]
}
```

### Pending Task

```json theme={null}
{
  "task_info": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "pending",
    "created_at": "2025-02-09T10:30:00Z",
    "updated_at": "2025-02-09T10:30:00Z"
  }
}
```

### Processing Task

```json theme={null}
{
  "task_info": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "processing",
    "created_at": "2025-02-09T10:30:00Z",
    "updated_at": "2025-02-09T10:30:15Z"
  }
}
```

### Failed Task

```json theme={null}
{
  "task_info": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "status": "failed",
    "created_at": "2025-02-09T10:30:00Z",
    "updated_at": "2025-02-09T10:30:15Z",
    "error": {
      "code": 3001,
      "title": "Invalid Request",
      "detail": "The prompt contains prohibited content"
    }
  }
}
```

## Polling Guidelines

For asynchronous task processing:

1. **Initial Wait**: Wait at least 2-3 seconds before the first poll
2. **Poll Interval**: Poll every 2-3 seconds for `pending` or `processing` status
3. **Timeout**: Consider implementing a timeout (e.g., 5 minutes) for long-running tasks
4. **Exponential Backoff**: Consider increasing poll intervals for longer tasks

## Error Handling

If the task fails, check the `error` object in `task_info` for details:

* **code**: Numeric error code identifying the error type
* **title**: Brief error description
* **detail**: Detailed explanation of what went wrong

Common error scenarios:

* Invalid or prohibited content in prompt
* Image file size exceeds limit
* Unsupported image format
* Invalid resolution parameters


## OpenAPI

````yaml api-reference/endpoint/alibaba/qwen-image-edit-max/qwen-image-edit-max.yaml GET /vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}
openapi: 3.1.0
info:
  title: Qwen-Image-Edit-Max API
  description: Qwen-Image-Edit-Max Image Editing Model API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.mulerouter.ai/
security:
  - bearerAuth: []
paths:
  /vendors/alibaba/v1/qwen-image-edit-max/generation/{task_id}:
    get:
      summary: Get Generation Task
      description: Retrieve the status and result of a generation task
      operationId: qwen_image_edit_max_generation_get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Task result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QwenImageEditMaxResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    QwenImageEditMaxResponse:
      type: object
      additionalProperties: true
      properties:
        task_info:
          $ref: '#/components/schemas/TaskInfoResponse'
        images:
          type: array
          description: Generated image URLs (only present when status is success)
          items:
            type: string
            format: uri
            description: URL of the generated image (valid for 24 hours)
    ErrorResponse:
      type: object
      additionalProperties: true
      properties:
        task_info:
          $ref: '#/components/schemas/TaskInfoErrorResponse'
    TaskInfoResponse:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          description: UUID of the task
          format: uuid
        status:
          type: string
          description: Task status
          enum:
            - completed
            - pending
            - processing
            - failed
        created_at:
          type: string
          description: Task creation timestamp (ISO 8601)
          format: date-time
        updated_at:
          type: string
          description: Task last update timestamp (ISO 8601)
          format: date-time
      required:
        - id
        - status
        - created_at
        - updated_at
    TaskInfoErrorResponse:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
          description: UUID of the task
          format: uuid
        status:
          type: string
          description: Task status (always failed for error responses)
          enum:
            - failed
        created_at:
          type: string
          description: Task creation timestamp (ISO 8601)
          format: date-time
        updated_at:
          type: string
          description: Task last update timestamp (ISO 8601)
          format: date-time
        error:
          $ref: '#/components/schemas/TaskInfoErrorObject'
      required:
        - id
        - status
        - created_at
        - updated_at
        - error
    TaskInfoErrorObject:
      type: object
      additionalProperties: true
      properties:
        code:
          type: integer
          description: MuleRouter Error code
          example: 3001
        title:
          type: string
          description: MuleRouter Error title
          example: Invalid Request
        detail:
          type: string
          description: MuleRouter Error detail
          example: The prompt contains prohibited content
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````