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

# Midjourney V8.2 Upload Paint

> - Upload images for advanced canvas editing, supporting mask area specification and position adjustment
- Similar to mj-v8.2-edit, but does not depend on existing tasks, directly pass in images
- The result of an upload-paint task cannot be used as the source (`task_id`) of variation, remix or edit; the upstream only allows upscaling it, which this route does not expose
- Async processing mode, use the returned task ID to [query status](/en/api-manual/task-management/get-task-detail)

<Note>
  Midjourney has a built-in content moderation system. Each image is moderated individually: filtered images are left out of the results and the remaining images are delivered normally, so you may receive fewer images than usual. If at least one image passes, the task is `completed` and billed normally; if all images are filtered, the task ends as `failed` and the reserved credits are refunded in full. Please make sure your prompts and reference images comply with the content guidelines.
</Note>


## OpenAPI

````yaml en/api-manual/image-series/midjourney/mj-v8-2-upload-paint.json POST /v1/images/generations
openapi: 3.1.0
info:
  title: mj-v8.2-upload-paint Interface
  description: Midjourney V8.2 Advanced Edit Interface
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.evolink.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Image Generation
    description: AI image generation endpoints
paths:
  /v1/images/generations:
    post:
      tags:
        - Image Generation
      summary: mj-v8.2-upload-paint Interface
      description: >-
        - Upload images for advanced canvas editing, supporting mask area
        specification and position adjustment

        - Similar to mj-v8.2-edit, but does not depend on existing tasks,
        directly pass in images

        - The result of an upload-paint task cannot be used as the source
        (`task_id`) of variation, remix or edit; the upstream only allows
        upscaling it, which this route does not expose

        - Async processing mode, use the returned task ID to [query
        status](/en/api-manual/task-management/get-task-detail)
      operationId: createImageGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageGenerationRequest'
            examples:
              upload_paint_example:
                summary: Advanced Edit
                value:
                  model: mj-v8.2-upload-paint
                  prompt: Beautiful mountain scenery background
                  image_urls:
                    - >-
                      https://cdn.evolink.ai/model-cards/midjourney-v8-2/midjourney-v8-2-og-v1.jpg
                  model_params:
                    mask:
                      areas:
                        - width: 1200
                          height: 630
                          points:
                            - 100
                            - 100
                            - 400
                            - 100
                            - 400
                            - 400
                            - 100
                            - 400
                    canvas:
                      width: 1200
                      height: 630
                    img_pos:
                      width: 1200
                      height: 630
                      x: 0
                      'y': 0
                    speed: fast
      responses:
        '200':
          description: Image generation task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageGenerationResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: invalid_request
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: Unauthorized, invalid or expired token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unauthorized
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: Insufficient quota, please top up
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: insufficient_quota
                  message: Insufficient quota. Please top up your account.
                  type: insufficient_quota
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: model_access_denied
                  message: 'Token does not have access to model: mj-v8.2-upload-paint'
                  type: invalid_request_error
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: rate_limit_exceeded
                  message: Too many requests, please try again later
                  type: rate_limit_error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: internal_error
                  message: Internal server error
                  type: api_error
components:
  schemas:
    ImageGenerationRequest:
      type: object
      required:
        - model
        - prompt
        - image_urls
        - model_params
      properties:
        model:
          type: string
          description: Model name
          enum:
            - mj-v8.2-upload-paint
          default: mj-v8.2-upload-paint
          example: mj-v8.2-upload-paint
        prompt:
          type: string
          description: Edit prompt
          maxLength: 8100
          example: Beautiful mountain scenery background
        image_urls:
          type: array
          description: >-
            Input image URL (first one is used). Public HTTP(S) URL of at most
            1024 characters; formats .png, .gif, .webp, .jpg, .jpeg
          items:
            type: string
            format: uri
          maxItems: 1
          example:
            - >-
              https://cdn.evolink.ai/model-cards/midjourney-v8-2/midjourney-v8-2-og-v1.jpg
        model_params:
          type: object
          description: Advanced edit parameters
          required:
            - mask
            - canvas
            - img_pos
          properties:
            mask:
              type: object
              description: >-
                Masked region to repaint (polygon coordinates or mask image)


                **Method 1 - Polygon coordinates:**

                ```json

                { "areas": [{ "width": 100, "height": 100, "points": [10, 10,
                10, 100, 100, 100, 100, 10] }] }

                ```


                **Method 2 - Mask image (black-and-white, white = repaint; same
                size as the source; URL or base64 data URI):**

                ```json

                { "url":
                "https://cdn.evolink.ai/model-cards/midjourney-v8-2/midjourney-v8-2-og-v1.jpg"
                }

                ```


                (The URL above is a placeholder — replace it with your own
                black-and-white mask image.)
              properties:
                areas:
                  type: array
                  description: Polygon region list
                  items:
                    type: object
                    properties:
                      width:
                        type: integer
                        description: >-
                          Basis width in source-image pixels (the coordinate
                          space of `points`)
                      height:
                        type: integer
                        description: >-
                          Basis height in source-image pixels (the coordinate
                          space of `points`)
                      points:
                        type: array
                        description: >-
                          Polygon vertex coordinates (x1,y1,x2,y2,...), in
                          source-image pixels, listed clockwise starting from
                          the top-left origin
                        items:
                          type: integer
                url:
                  type: string
                  format: uri
                  description: >-
                    Mask image URL or data URI. A black-and-white binary image
                    with the same pixel size as the source image: **white =
                    repaint, black = keep**. Base64 is accepted as a data URI
                    (`data:image/png;base64,...`). Do not use PNG transparency
                    for the mask: transparent pixels are treated as white
                    (repaint).
            canvas:
              type: object
              description: >-
                Canvas size. Canvas aspect ratio (width/height) MUST match the
                uploaded image aspect ratio, otherwise the task fails (status:
                failed, execution error).
              required:
                - width
                - height
              properties:
                width:
                  type: integer
                  description: Canvas width
                  example: 1200
                height:
                  type: integer
                  description: Canvas height
                  example: 630
            img_pos:
              type: object
              description: >-
                Image position and size within the canvas. Image fills the
                canvas (img W/H = canvas W/H) = pure edit/repaint; image smaller
                than canvas = outpaint (the surrounding blank area is generated
                from the prompt).
              required:
                - width
                - height
                - x
                - 'y'
              properties:
                width:
                  type: integer
                  description: Render width
                  example: 1200
                height:
                  type: integer
                  description: Render height
                  example: 630
                x:
                  type: integer
                  description: Top-left horizontal offset
                  example: 0
                'y':
                  type: integer
                  description: Top-left vertical offset
                  example: 0
            speed:
              type: string
              description: |-
                Speed mode

                - `fast`: Standard mode (default), 1x
              enum:
                - fast
              default: fast
              example: fast
        callback_url:
          type: string
          description: >-
            HTTPS callback URL for task completion


            **Callback timing:**

            - Triggered when the task is completed or failed

            - Sent after billing confirmation


            **Security restrictions:**

            - HTTPS protocol only

            - Callbacks to private IP addresses are prohibited (127.0.0.1,
            10.x.x.x, 172.16-31.x.x, 192.168.x.x, etc.)

            - URL length must not exceed `2048` characters


            **Callback mechanism:**

            - Timeout: `10` seconds

            - Up to `3` retries after failure (retries at `1`s/`2`s/`4`s after
            failure)

            - Callback response body format matches the task query endpoint

            - A 2xx status code is considered successful; other status codes
            trigger retries
          format: uri
          example: https://your-domain.com/webhooks/image-task-completed
    ImageGenerationResponse:
      type: object
      properties:
        created:
          type: integer
          description: Task creation timestamp
          example: 1757165031
        id:
          type: string
          description: Task ID
          example: task-unified-1757165031-mjv82
        model:
          type: string
          description: Actual model name used
        object:
          type: string
          enum:
            - image.generation.task
          description: Task object type
        progress:
          type: integer
          description: Task progress percentage (0-100)
          minimum: 0
          maximum: 100
          example: 0
        status:
          type: string
          description: Task status
          enum:
            - pending
            - processing
            - completed
            - failed
          example: pending
        task_info:
          $ref: '#/components/schemas/TaskInfo'
        type:
          type: string
          enum:
            - text
            - image
            - audio
            - video
          example: image
        usage:
          $ref: '#/components/schemas/Usage'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Error code identifier
            message:
              type: string
              description: Error message
            type:
              type: string
              description: Error type
    TaskInfo:
      type: object
      properties:
        estimated_time:
          type: integer
          description: Estimated completion time (seconds)
          minimum: 0
          example: 45
    Usage:
      type: object
      properties:
        billing_rule:
          type: string
          enum:
            - per_call
            - per_token
            - per_second
          example: per_call
        credits_reserved:
          type: number
          description: Estimated credits consumed
          minimum: 0
          example: 1.8
        user_group:
          type: string
          example: default
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        ## All endpoints require Bearer Token authentication ##


        **Get API Key:**


        Visit [API Key Management Page](https://evolink.ai/dashboard/keys) to
        get your API Key


        **Add to request header:**

        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

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