Skip to main content
POST
/
v1
/
images
/
edits
Edit image
curl --request POST \
  --url https://router.requesty.ai/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form model=azure/openai/gpt-image-1 \
  --form 'prompt=<string>' \
  --form 'image[]=<string>' \
  --form size=auto \
  --form quality=auto \
  --form mask='@example-file' \
  --form image[].items='@example-file'
{
  "created": 1719000000,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.requesty.ai/llms.txt

Use this file to discover all available pages before exploring further.

Edit or extend an existing image from a text prompt using OpenAI compatible image editing models through Requesty’s routing.

Base URL

https://router.requesty.ai/v1/images/edits

Authentication

Include your Requesty API key in the request headers:
Authorization: Bearer YOUR_REQUESTY_API_KEY

Example Request

The endpoint accepts both multipart/form-data (the OpenAI SDK default for file uploads) and application/json (with image references as base64 data URLs or file IDs).

multipart/form-data

curl https://router.requesty.ai/v1/images/edits \
  -H "Authorization: Bearer YOUR_REQUESTY_API_KEY" \
  -F "model=azure/openai/gpt-image-1" \
  -F "prompt=Make the sky a dramatic sunset" \
  -F "image[]=@./photo.png" \
  -F "size=1024x1024" \
  -F "quality=auto"

application/json

curl https://router.requesty.ai/v1/images/edits \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_REQUESTY_API_KEY" \
  -d '{
    "model": "azure/openai/gpt-image-1",
    "prompt": "Make the sky a dramatic sunset",
    "images": [
      { "image_url": "data:image/png;base64,iVBORw0KGgo..." }
    ],
    "size": "1024x1024",
    "quality": "auto"
  }'

Supported Models

  • azure/openai/gpt-image-1 OpenAI’s GPT Image 1 model via Azure
  • azure/openai/gpt-image-1.5 OpenAI’s GPT Image 1.5 model via Azure

Masked Edits

Provide a mask image to restrict edits to a specific region. Transparent pixels in the mask are the area that will be regenerated.
curl https://router.requesty.ai/v1/images/edits \
  -H "Authorization: Bearer YOUR_REQUESTY_API_KEY" \
  -F "model=azure/openai/gpt-image-1" \
  -F "prompt=Replace the background with a forest" \
  -F "image[]=@./portrait.png" \
  -F "mask=@./mask.png" \
  -F "size=1024x1024"

Transparent Backgrounds

Use the background parameter together with output_format=png (or webp) to produce edits with transparent backgrounds:
curl https://router.requesty.ai/v1/images/edits \
  -H "Authorization: Bearer YOUR_REQUESTY_API_KEY" \
  -F "model=azure/openai/gpt-image-1" \
  -F "prompt=Isolate the product on a transparent background" \
  -F "image[]=@./product.png" \
  -F "background=transparent" \
  -F "output_format=png"

Error Handling

The API returns standard HTTP status codes:
  • 200 Success
  • 400 Bad Request (invalid parameters)
  • 401 Unauthorized (invalid API key)
  • 413 Payload Too Large (uploaded images exceed the size limit)
  • 429 Rate Limited
  • 500 Internal Server Error
This endpoint is fully compatible with the OpenAI Images API. You can use the OpenAI SDK’s client.images.edit() method directly.
To generate a new image from scratch rather than edit an existing one, use the Create Image endpoint. See the Image Generation feature guide for a full comparison.

Authorizations

Authorization
string
header
required

API key for authentication

Body

model
string
required

The model to use for image editing

Example:

"azure/openai/gpt-image-1"

prompt
string
required

A text description of the desired edit

image[]
file[]
required

One or more image files to edit. Repeat the image[] field to upload multiple images (up to 16 for GPT image models).

size
enum<string>

Output size. Defaults to auto.

Available options:
auto,
1024x1024,
1536x1024,
1024x1536
quality
enum<string>

Image quality. Defaults to auto.

Available options:
auto,
high,
medium,
low
mask
file

Optional mask image file. Transparent pixels mark the area that will be regenerated.

Response

Image edit response

created
integer
required

The Unix timestamp of when the image was created

Example:

1719000000

data
object[]
required

The list of generated images

Last modified on April 29, 2026