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

# Edit image

> OpenAI-compatible image edit / inpaint.

**Path:** `POST https://api.omniall.ai/v1/images/edits`

Supports **`application/json`** (`image`/`mask` as URL or Base64) and **`multipart/form-data`** (file upload). Multiple images: JSON `image` string array; form repeated `image[]` file parts.

Use `prompt` to describe edits; optional `mask` for editable regions.



## OpenAPI

````yaml openapi/xgapi-public.yaml POST /v1/images/edits
openapi: 3.0.3
info:
  title: Omniall AI Public API
  description: >-
    Omniall AI public API. Website: https://omniall.ai — API host:
    https://api.omniall.ai — Model Square: https://omniall.ai/pricing
  version: 1.1.0
servers:
  - url: https://api.omniall.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Models
    description: List models available to your API key.
  - name: ChatGPT Chat Completions
    x-group: ChatGPT
    description: OpenAI Chat Completions (`POST /v1/chat/completions`).
  - name: Responses
    description: OpenAI Responses API (`POST /v1/responses`).
  - name: Claude
    description: Anthropic Messages API (`POST /v1/messages`).
  - name: Gemini
    description: Google Gemini generateContent / streamGenerateContent.
  - name: Images
    description: >-
      Image generation (OpenAI Images), vendor guides, and Midjourney proxy
      APIs.
  - name: Video
    description: Async video tasks.
  - name: Audio
    description: Speech and related audio APIs.
  - name: Rerank
    description: Document reranking.
paths:
  /v1/images/edits:
    post:
      tags:
        - Images
      summary: Edit image
      description: >-
        OpenAI-compatible image edit / inpaint.


        **Path:** `POST https://api.omniall.ai/v1/images/edits`


        Supports **`application/json`** (`image`/`mask` as URL or Base64) and
        **`multipart/form-data`** (file upload). Multiple images: JSON `image`
        string array; form repeated `image[]` file parts.


        Use `prompt` to describe edits; optional `mask` for editable regions.
      operationId: createImageEdit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageEditRequest'
            examples:
              image_to_image:
                summary: Image-to-image (JSON)
                value:
                  model: gpt-image-1
                  prompt: Replace the background with a clean white studio backdrop
                  image: https://example.com/product.png
                  'n': 1
              multi_reference:
                summary: Image-to-image · multi-reference (JSON)
                value:
                  model: gpt-image-1
                  prompt: >-
                    Blend composition and subject from both references into one
                    ad image
                  image:
                    - https://example.com/ref-a.png
                    - https://example.com/ref-b.png
                  'n': 1
          multipart/form-data:
            schema:
              type: object
              required:
                - model
                - prompt
                - image
              description: >-
                OpenAI-compatible `multipart/form-data` edit request. Send text
                fields and image files in one form; the gateway forwards files
                upstream.
              properties:
                model:
                  type: string
                  description: Edit-capable model id.
                  example: gpt-image-1
                prompt:
                  type: string
                  description: Instruction describing how to edit the image.
                  example: Replace the background with a clean white studio backdrop
                image:
                  type: string
                  format: binary
                  description: >-
                    Source image file. Use field name `image` for one file; for
                    multiple references use repeated `image[]` or `image[0]`,
                    `image[1]` file parts.
                mask:
                  type: string
                  format: binary
                  description: Optional mask PNG. Transparent pixels mark editable regions.
                'n':
                  type: string
                  description: Number of outputs (string in form, e.g. `1`).
                  example: '1'
                size:
                  type: string
                  description: Output size when supported.
                quality:
                  type: string
                  description: Quality tier when supported.
                response_format:
                  type: string
                  enum:
                    - url
                    - b64_json
                  description: Response format.
            examples:
              form_image_to_image:
                summary: Image-to-image (multipart form)
                value:
                  model: gpt-image-1
                  prompt: Replace the background with a clean white studio backdrop
                  'n': '1'
      responses:
        '200':
          description: Edited image result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
        '500':
          description: Upstream/gateway error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenAIErrorResponse'
components:
  schemas:
    ImageEditRequest:
      type: object
      required:
        - model
        - prompt
      description: >-
        OpenAI-compatible image edit (`POST /v1/images/edits`). JSON and
        multipart/form-data supported.
      properties:
        model:
          type: string
          description: >-
            Edit-capable model id (e.g. `gpt-image-1`, `dall-e-2`, Gemini/Qwen
            edit models).
          example: gpt-image-1
        prompt:
          type: string
          description: Instruction describing how to edit the image.
          example: Replace the sky with a sunset
        image:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          description: >-
            Source image(s). JSON: URL / Base64 / **string array**. multipart:
            file field `image` (one) or repeated `image[]` / `image[n]`
            (multiple).
        mask:
          oneOf:
            - type: string
              description: Mask URL or Base64.
            - type: string
              format: binary
              description: '`mask` file in multipart form.'
          description: >-
            Optional mask. JSON: URL/Base64; multipart: `mask` file (PNG,
            transparent = editable).
        'n':
          type: integer
          description: Number of edited images to return.
          default: 1
        size:
          type: string
          description: Output size when supported.
        quality:
          type: string
          description: Quality tier when supported.
        response_format:
          type: string
          enum:
            - url
            - b64_json
        user:
          description: Opaque end-user id.
    ImageResponse:
      type: object
      description: OpenAI-compatible image response.
      properties:
        created:
          type: integer
          description: Unix timestamp when the image job completed.
        data:
          type: array
          description: Generated image payloads.
          items:
            type: object
            properties:
              url:
                type: string
                description: >-
                  Temporary HTTPS URL of the image (download promptly; may
                  expire).
              b64_json:
                type: string
                description: Base64-encoded image bytes when `response_format=b64_json`.
              revised_prompt:
                type: string
                description: Prompt rewritten by the model (e.g. DALL·E), if any.
    OpenAIErrorResponse:
      type: object
      description: OpenAI-style error envelope returned on auth/request failures.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              description: >-
                Human-readable error. The gateway may append a request id for
                support.
            type:
              type: string
              description: Error type, commonly `new_api_error`.
              example: new_api_error
            code:
              type: string
              description: >-
                Optional machine-readable code (e.g. `access_denied`). May be an
                empty string.
          description: Error object.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use Authorization: Bearer sk-... from https://omniall.ai/dashboard'

````

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