API reference

Edit images

POST/v1/images/edits

Edit one or more images with an editing model. Multipart requests support image or repeated image[] fields; mask is unsupported and n must be 1. Idempotency-Key is required. A persistent task is created, and created/data is returned after settlement. If the task is still incomplete after approximately 55 seconds, the response is 504 with error.task_id: query that original task and never automatically resend with a different idempotency key. X-Image-Task-ID identifies the original task. With response_format=url, the result URL is relative to the site root and requires Bearer authentication with the original API Key. Prompt enhancement is unsupported. Input storage capacity and expiry follow file-service limits. Output is limited to 64 MiB.

Authentication and permissions

Use your current GloopAPI key. Available models, capabilities and permissions depend on its catalog and the endpoint documentation.

Authorization: Bearer $GLOOP_API_KEY

Authentication schemes: BearerAuth

Request

Request headers

Request body · multipart/form-data

Type
object
Required fields
modelprompt
Additional properties
false

Request body required

  • modelstringRequired

    Public model ID from the current key's catalog.

    Maximum length
    191
  • promptstringRequired

    Nonempty, at most 32000 UTF-8 bytes. OpenAPI maxLength counts characters, so no artificial character limit is specified.

  • resolutionstringOptional

    Select values from the model's operation_options. When tiers are available, resolution/quality must be specified explicitly. Configurations without prices cannot be used.

  • qualitystringOptional

    Select values from the model's operation_options. When tiers are available, resolution/quality must be specified explicitly. Configurations without prices cannot be used.

  • aspect_ratiostringOptional

    Select values from the model's operation_options. When tiers are available, resolution/quality must be specified explicitly. Configurations without prices cannot be used.

  • output_formatstringOptional

    Editing only; defaults to png.

    Enum
    ["png","jpeg","jpg","webp"]
  • imagestringOptional

    Use either image or image[], not both. Each image must be at most 10 MiB and remain within the asset size limit after normalization. The entire multipart request is limited to 128 MiB.

    Format
    "binary"
  • nintegerOptional
    Enum
    [1]
  • response_formatstringOptional
    Default value
    "b64_json"
    Enum
    ["b64_json","url"]
  • image[]arrayOptional

    Repeated file field. Input order is preserved; model capabilities may further limit the count.

    Maximum items
    14
    image[] child fields (1)
    • []stringOptional
      Format
      "binary"

Responses and errors

HTTP 200

Completed and settled

application/json

Type
object
  • createdintegerOptional
  • dataarrayOptional
    data child fields (1)
    • []objectOptional
      [] child fields (2)

HTTP 400

Invalid parameters or file

application/json

Type
object

HTTP 409

Idempotency key conflict

application/json

Type
object

HTTP 502

Execution failed or the outcome is unknown; error.task_id identifies the original task.

application/json

Type
object

HTTP 504

Wait timed out; error.task_id identifies the original task that is still processing.

application/json

Type
object