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

# Midjourney Image Edit

> Generate four images based on image and description, **asynchronous task**

<Note>
  Midjourney's official image editing feature includes built-in cropping, so editable images must use supported aspect ratios. The currently supported ratios are 1:1, 1:2, 2:1, 2:3, 3:2, 3:4, 4:3, 9:16, and 16:9. If an uploaded image does not match one of these ratios, the system automatically adjusts it before generating a new image.
</Note>


## OpenAPI

````yaml openapi/en/midjourneyedit.json POST /midjourney/image-edits/submit
openapi: 3.1.0
info:
  title: Midjourney Edit API DOCS
  version: 1.0.0
  description: Midjourney image editing related endpoints
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /midjourney/image-edits/submit:
    post:
      description: >-
        Generate four images based on image and description, **asynchronous
        task**
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageeditsRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    ImageeditsRequest:
      type: object
      properties:
        prompt:
          type: string
          description: Prompt for modifying images, English performs best
        image:
          type: string
          description: >-
            Image files support URL and Base64, and only png, jpg, jpeg, bmp,
            webp formats are allowed. <br/> Note: The areas to be edited in the
            image should be transparent.
        mode:
          type: string
          description: Speed mode for image editing
          enum:
            - relax
            - fast
            - turbo
          default: fast
        type:
          type: string
          description: Editing type
          enum:
            - edit
            - retexture
          default: edit
        hookUrl:
          type: string
          description: >-
            Callback URL. When task completes or fails, this URL will be
            notified. If not set, you need to request the <a href="fetch"
            target="_self">Get task status endpoint</a>
      required:
        - prompt
        - image
  responses:
    SuccessResponse:
      description: Request successful
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            required:
              - status
              - message
              - data
    400Response:
      description: Parameter error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: Authorization failed
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        You can obtain your API key from the <a
        href='https://dashboard.ttapi.io' target='_blank'>TTAPI Dashboard</a>.

````