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

# Edit images

> Edit up to three input images with a text prompt and receive one 512x512 JPEG. Without input images, the prompt is drawn on a blank white canvas. Image Edit has its own per-minute limit, separate from your RPM limit.



## OpenAPI

````yaml /openapi.json post /private/image_edit
openapi: 3.1.0
info:
  title: Scrapist AI API
  version: 1.0.0
  description: >-
    Independent HTTPS endpoints for AI naming, past-coin search, image crops,
    OCR, and image editing.
servers:
  - url: https://inference.scrapist.bot
    description: Production
security:
  - BearerAuth: []
  - ApiKeyAuth: []
tags:
  - name: Inference
    description: Run one inference workload and receive its results.
paths:
  /private/image_edit:
    post:
      tags:
        - Inference
      summary: Edit images
      description: >-
        Edit up to three input images with a text prompt and receive one 512x512
        JPEG. Without input images, the prompt is drawn on a blank white canvas.
        Image Edit has its own per-minute limit, separate from your RPM limit.
      operationId: editImage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImageEditRequest'
            example:
              requestId: req_image_edit_01
              prompt: >-
                Change the red jacket to a blue hoodie. Keep the face and
                background unchanged.
              images:
                - https://assets.example.com/posts/terminal-1.png
      responses:
        '200':
          description: The edited image.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageEditResponse'
        '400':
          $ref: '#/components/responses/ImageEditBadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ImageEditForbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          $ref: '#/components/responses/ImageEditFailed'
        '503':
          $ref: '#/components/responses/ImageEditUnavailable'
components:
  schemas:
    ImageEditRequest:
      type: object
      required:
        - prompt
      additionalProperties: false
      properties:
        requestId:
          type: string
          minLength: 1
          description: Optional correlation ID. Scrapist generates one when omitted.
        prompt:
          type: string
          minLength: 1
          maxLength: 2000
          description: Edit instructions. Leading and trailing whitespace is trimmed.
        images:
          type: array
          maxItems: 3
          items:
            type: string
            minLength: 1
          default: []
          description: >-
            Up to three input images, each a public http(s) URL or a base64
            `data:image/...;base64,` URL. Each image is fitted onto a 512x512
            canvas. Omit to draw on a blank white canvas.
    ImageEditResponse:
      type: object
      required:
        - requestId
        - images
      additionalProperties: false
      properties:
        requestId:
          type: string
        images:
          type: array
          minItems: 1
          maxItems: 1
          items:
            type: string
            description: The edited 512x512 image as a `data:image/jpeg;base64,` URL.
    ErrorResponse:
      type: object
      required:
        - requestId
        - error
      additionalProperties: false
      properties:
        requestId:
          type: string
        error:
          type: object
          required:
            - code
            - message
          additionalProperties: false
          properties:
            code:
              type: string
              enum:
                - invalid_message
                - invalid_image
                - unauthorized
                - image_edit_not_enabled
                - rate_limit
                - internal_error
                - past_coin_search_failed
                - image_edit_failed
                - image_edit_busy
                - image_edit_unavailable
            message:
              type: string
  responses:
    ImageEditBadRequest:
      description: >-
        The JSON body does not match the Image Edit request shape
        (`invalid_message`), or an input image could not be loaded
        (`invalid_image`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            requestId: req_image_edit_01
            error:
              code: invalid_image
              message: >-
                an input image could not be loaded; send a public http(s) image
                URL or a base64 image data URL
    Unauthorized:
      description: The API key is missing, invalid, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ImageEditForbidden:
      description: Image editing is not enabled for this API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            requestId: req_image_edit_01
            error:
              code: image_edit_not_enabled
              message: image edits are not enabled for this API key
    RateLimited:
      description: This operation's independent per-user RPM bucket is exhausted.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ImageEditFailed:
      description: The image edit failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ImageEditUnavailable:
      description: >-
        Image editing is busy (`image_edit_busy`) or temporarily unavailable
        (`image_edit_unavailable`). Retry with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            requestId: req_image_edit_01
            error:
              code: image_edit_busy
              message: image editing is busy, retry shortly
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Your server-side Scrapist API key.
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: Alternative header for your server-side Scrapist API key.

````

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