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

Base URL

Authentication

Include your Requesty API key in the request headers:

Example Request

The endpoint accepts both multipart/form-data (the OpenAI SDK default for file uploads) and application/json. In JSON, each entry of image is an object whose image_url is a base64 data URL (data:image/png;base64,...).

multipart/form-data

For multiple input images, repeat the same form field once per file:

application/json

image_url must be a base64 data URL. The router does not download images from http:// or https:// URLs, so a remote URL fails with an error. Encode the file yourself (for example base64 -w0 photo.png) or send the file with the multipart form instead.

Supported Models

  • openai/gpt-image-2 OpenAI’s GPT Image 2 model
  • azure/openai/gpt-image-2 OpenAI’s GPT Image 2 model via Azure
  • azure/openai/gpt-image-1.5 OpenAI’s GPT Image 1.5 model via Azure
  • azure/openai/gpt-image-1 OpenAI’s GPT Image 1 model via Azure
  • vertex/google/gemini-3.1-flash-image Google’s Gemini 3.1 Flash Image model via Vertex AI
  • vertex/google/gemini-2.5-flash-image Google’s Gemini 2.5 Flash Image model via Vertex AI
Gemini image models use size for the output aspect ratio and ignore the GPT Image specific parameters such as quality, background and output_format. Browse the Model Library for the full list of image models.

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.

Transparent Backgrounds

Use the background parameter together with output_format=png (or webp) to produce edits with transparent backgrounds:

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 October 12, 2026