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

# Images Edits (Beta)

> Apply edits to an existing image using the specified model and prompt.



## OpenAPI

````yaml POST /images/edits
openapi: 3.0.3
info:
  title: AI Stats Gateway API
  description: >-
    A gateway API for accessing various AI models with OpenAI-compatible
    endpoints.
  version: 1.0.0
  contact:
    name: AI Stats
    url: https://docs.ai-stats.phaseo.app
    email: danielbutler500@gmail.com
servers:
  - url: https://api.phaseo.app/v1
security:
  - BearerAuth: []
tags:
  - name: Gateway
    description: Core AI Stats Gateway operations.
paths:
  /images/edits:
    post:
      tags:
        - Gateway
      summary: Create image edit
      description: >-
        Creates an edited or extended image given an original image and a
        prompt.
      operationId: createImageEdit
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/ImagesEditRequest'
      responses:
        '200':
          description: Image edit response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImagesEditResponse'
components:
  schemas:
    ImagesEditRequest:
      type: object
      required:
        - model
        - image
        - prompt
      properties:
        model:
          type: string
        image:
          type: string
        mask:
          type: string
        prompt:
          type: string
        size:
          type: string
        'n':
          type: integer
          minimum: 1
          maximum: 10
        user:
          type: string
        meta:
          type: boolean
        usage:
          type: boolean
        provider:
          $ref: '#/components/schemas/ProviderRoutingOptions'
    ImagesEditResponse:
      type: object
      properties:
        created:
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/Image'
    ProviderRoutingOptions:
      type: object
      description: Provider routing preferences for gateway selection.
      properties:
        order:
          type: array
          items:
            type: string
        only:
          type: array
          items:
            type: string
        ignore:
          type: array
          items:
            type: string
        include_alpha:
          type: boolean
          description: Include alpha providers in routing (off by default).
    Image:
      type: object
      properties:
        url:
          type: string
        b64_json:
          type: string
        revised_prompt:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication

````