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

# Create image edit (inpainting / image-to-image)

> GoModel API reference for POST /v1/images/edits: Create image edit (inpainting / image-to-image).



## OpenAPI

````yaml /openapi.json post /v1/images/edits
openapi: 3.0.0
info:
  description: >-
    AI gateway routing requests to multiple LLM providers (OpenAI, Anthropic,
    Gemini, Groq, Fireworks AI, Meta, OpenRouter, Kilo AI, DeepSeek, Z.ai, xAI,
    MiniMax, Xiaomi MiMo, OpenCode Go, Oracle, Ollama, Bailian). Drop-in
    OpenAI-compatible API.
  title: GoModel API
  contact: {}
  version: '1.0'
servers:
  - url: '{base_url}'
    description: Edit the base URL to point at your GoModel deployment.
    variables:
      base_url:
        default: http://localhost:8080
        description: Your GoModel deployment URL
security: []
paths:
  /v1/images/edits:
    post:
      tags:
        - images
      summary: Create image edit (inpainting / image-to-image)
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                image:
                  description: >-
                    Source image to edit (single-image form; gpt-image-1 and
                    DALL·E 2). At least one of image or image[] is required
                  type: string
                  format: binary
                image[]:
                  description: >-
                    Repeatable field carrying several source images
                    (gpt-image-1, up to 16). At least one of image or image[] is
                    required
                  type: array
                  maxItems: 16
                  items:
                    type: string
                    format: binary
                prompt:
                  description: Text description of the desired edit
                  type: string
                model:
                  description: Model ID
                  type: string
                mask:
                  description: >-
                    PNG whose transparent areas mark where the image should be
                    edited
                  type: string
                  format: binary
                'n':
                  description: Number of images to generate
                  type: integer
                  minimum: 1
                size:
                  description: Output size, e.g. 1024x1024
                  type: string
                quality:
                  description: Output quality (model-specific)
                  type: string
                response_format:
                  description: >-
                    url or b64_json (DALL·E 2 only; gpt-image-1 always returns
                    b64_json)
                  type: string
                user:
                  description: End-user identifier forwarded to the provider
                  type: string
              required:
                - prompt
                - model
              anyOf:
                - required:
                    - image
                - required:
                    - image[]
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.ImageGenerationResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/core.OpenAIErrorEnvelope'
      security:
        - BearerAuth: []
components:
  schemas:
    core.ImageGenerationResponse:
      type: object
      properties:
        background:
          type: string
        created:
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/core.ImageData'
        output_format:
          type: string
        provider:
          description: >-
            Provider is a gateway addition, stamped like every other routed
            response,

            so clients can tell which provider served the request.
          type: string
        quality:
          type: string
        size:
          type: string
        usage:
          $ref: '#/components/schemas/core.ImageUsage'
    core.OpenAIErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/core.OpenAIErrorObject'
    core.ImageData:
      type: object
      properties:
        b64_json:
          type: string
        revised_prompt:
          type: string
        url:
          type: string
    core.ImageUsage:
      type: object
      properties:
        input_tokens:
          type: integer
        input_tokens_details:
          $ref: '#/components/schemas/core.ImageTokenDetails'
        output_tokens:
          type: integer
        total_tokens:
          type: integer
    core.OpenAIErrorObject:
      type: object
      required:
        - code
        - message
        - param
        - type
      properties:
        code:
          type: string
          nullable: true
        message:
          type: string
        param:
          type: string
          nullable: true
        provider:
          description: |-
            Provider names the upstream provider that produced the error. It is
            omitted for errors raised by the gateway itself.
          type: string
        type:
          $ref: '#/components/schemas/core.ErrorType'
    core.ImageTokenDetails:
      type: object
      properties:
        image_tokens:
          type: integer
        text_tokens:
          type: integer
    core.ErrorType:
      type: string
      enum:
        - provider_error
        - rate_limit_error
        - invalid_request_error
        - authentication_error
        - not_found_error
      x-enum-varnames:
        - ErrorTypeProvider
        - ErrorTypeRateLimit
        - ErrorTypeInvalidRequest
        - ErrorTypeAuthentication
        - ErrorTypeNotFound
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````