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

# GPT Image 2 Edit

> [Core Function] GPT Image 2 Edit is a high-resolution image-to-image editing model. [Strengths] It excels at making high-fidelity edits and style transformations to a single source image based on a text prompt, preserving details at up to 4K resolutions. [Best For] Highly recommended for: professional photo retouching, upscaling style transfers, and modifying high-resolution concept art. [Limitations] Do NOT use this model for multi-image merging (it only accepts one input image). Do NOT use if you need precise input fidelity control or transparent backgrounds. [Routing] Use this model by default when the user wants to edit a single image and prioritize output resolution/quality. If they need to merge multiple images or control the strictness of the edit (fidelity), use GPT Image 1.5 Edit.



## OpenAPI

````yaml /model-api/openai/openai-i2i.json post /openai/gpt-image-2-edit
openapi: 3.1.0
info:
  description: The image-to-image (image editing) models API from OpenAI.
  version: 1.0.0
  contact:
    name: Modellix Support
    email: support@modellix.ai
  title: OpenAI Image-to-Image Models API
servers:
  - url: https://api.modellix.ai/api/v1
    description: The image-to-image models API from OpenAI.
security:
  - bearerAuth: []
paths:
  /openai/gpt-image-2-edit:
    post:
      tags:
        - GPT Image Edit
      summary: GPT Image 2 Edit
      description: >-
        [Core Function] GPT Image 2 Edit is a high-resolution image-to-image
        editing model. [Strengths] It excels at making high-fidelity edits and
        style transformations to a single source image based on a text prompt,
        preserving details at up to 4K resolutions. [Best For] Highly
        recommended for: professional photo retouching, upscaling style
        transfers, and modifying high-resolution concept art. [Limitations] Do
        NOT use this model for multi-image merging (it only accepts one input
        image). Do NOT use if you need precise input fidelity control or
        transparent backgrounds. [Routing] Use this model by default when the
        user wants to edit a single image and prioritize output
        resolution/quality. If they need to merge multiple images or control the
        strictness of the edit (fidelity), use GPT Image 1.5 Edit.
      operationId: gptImage2EditAsync
      requestBody:
        description: Request payload for GPT Image 2 Edit model.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GPTImage2EditRequest'
            examples:
              basic:
                summary: Basic image editing
                value:
                  images:
                    - https://example.com/input.png
                  prompt: Add a watercolor effect to this image
              advanced_4k:
                summary: 4K high-resolution editing
                value:
                  images:
                    - https://example.com/input.png
                  prompt: Replace the sky with a dramatic sunset
                  size: 3840x2160
                  quality: high
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncTaskResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    GPTImage2EditRequest:
      description: Request payload for GPT Image 2 Edit model.
      type: object
      required:
        - images
        - prompt
      properties:
        prompt:
          type: string
          description: Description of the desired edits, supports up to 32,000 characters
          minLength: 1
          maxLength: 32000
          example: Add a watercolor effect to this image
        images:
          type: array
          description: >-
            Input image URL(s) to edit. Direct HTTPS URLs as string array.
            Supports up to 16 images for GPT Image models
          minItems: 1
          maxItems: 16
          items:
            type: string
            description: Direct image URL (https only)
            example: https://example.com/image.png
          example:
            - https://example.com/input.png
        size:
          type: string
          description: >-
            Output size as width x height, or 'auto' for model-selected size.
            Presets are valid under OpenAI constraints (total pixels
            655360-8294400, edges multiples of 16). Mapping: 1:1 1K/2K; 3:2
            1K/2K; 2:3 1K/2K; 4:3 1K/2K; 3:4 1K/2K; 16:9 2K/4K; 9:16 2K/4K. No
            1K for 16:9/9:16; no 4K for non-widescreen ratios.
          default: 1024x1024
          enum:
            - auto
            - 1024x1024
            - 2048x2048
            - 1536x1024
            - 3072x2048
            - 1024x1536
            - 2048x3072
            - 1024x768
            - 2048x1536
            - 768x1024
            - 1536x2048
            - 2048x1152
            - 3840x2160
            - 1152x2048
            - 2160x3840
          example: 1024x1024
        quality:
          type: string
          description: >-
            Output quality level. 'low': fast draft (default), 'medium':
            balanced, 'high': best quality
          default: low
          enum:
            - low
            - medium
            - high
          example: high
        mask:
          type: string
          description: >-
            Optional mask URL. Must be PNG with alpha channel; dimensions must
            match the input image exactly. Transparent areas are edited, opaque
            areas locked, semi-transparent areas blend with the original.
          example: https://example.com/mask.png
    AsyncTaskResponse:
      description: Response object for asynchronous task submission.
      type: object
      required:
        - code
        - message
        - data
      properties:
        code:
          type: integer
          description: Response code, 0 indicates success
          example: 0
        message:
          type: string
          description: Response message
          example: success
        data:
          description: Detailed data about the submitted asynchronous task.
          type: object
          required:
            - status
            - task_id
            - model_id
          properties:
            status:
              type: string
              description: Task status
              enum:
                - pending
                - processing
                - completed
                - failed
              example: pending
            task_id:
              type: string
              description: Unique task identifier for status polling
              example: task_abc123xyz
            model_id:
              type: string
              description: Model identifier used for this task
              example: gpt-image-2-edit
    ErrorResponse:
      description: Standard error response object.
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          description: Error code
          example: 400
        message:
          type: string
          description: Error message
          example: Invalid request parameters
        details:
          type: object
          description: Additional error details
          additionalProperties: true
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Authentication required or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````