Skip to main content
POST
/
v1
/
images
/
edits
Edit Image
curl --request POST \
  --url https://www.anyfast.ai/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form image='@example-file' \
  --form model=gpt-image-2 \
  --form 'prompt=Generate a cartoon-style avatar of this character with a humorous tone, on a rectangular background colored RGB(153, 162, 212)' \
  --form mask='@example-file' \
  --form n=1 \
  --form size=1024x1024 \
  --form response_format=url
{
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>",
      "revised_prompt": "<string>"
    }
  ]
}

Documentation Index

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

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

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
image
file
required

Source image file to edit. Common formats (png, jpeg, webp) are accepted.

model
enum<string>
required

Model ID. Use gpt-image-2 for the official model, or gpt-image-2-c for the reverse-engineered variant (supports response_format).

Available options:
gpt-image-2,
gpt-image-2-c
Example:

"gpt-image-2"

prompt
string
required

Text description of the edit you want to apply.

Example:

"Generate a cartoon-style avatar of this character with a humorous tone, on a rectangular background colored RGB(153, 162, 212)"

mask
file

Mask image file with an alpha channel. Indicates which areas of the source image to edit. Must be the same format and same size as the source image (< 50MB). Requires selecting the Direct group.

n
integer
default:1

Number of images to return. Supports 1–10. Default: 1. Requires selecting the Direct group in the console.

Required range: 1 <= x <= 10
Example:

1

size
string
default:1024x1024

Output image size in {width}x{height} format. Same flexible-resolution constraints as image generation.

Example:

"1024x1024"

response_format
enum<string>
default:url

Response format. Only supported by gpt-image-2-c (reverse-engineered variant). Currently only url is supported.

Available options:
url
Example:

"url"

Response

Image edited successfully.

data
object[]

Array of edited images.