Skip to main content
POST
/
v1
/
images
/
edits
cURL
curl --request POST \
  --url https://proxy.innk.cc/v1/images/edits \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'image=<string>' \
  --form 'prompt=<string>' \
  --form mask='@example-file' \
  --form model=gpt-image-1 \
  --form quality=auto \
  --form response_format=url \
  --form size=1024x1024 \
  --form image.items='@example-file'
{
  "created": 123,
  "data": [
    {
      "url": "<string>",
      "b64_json": "<string>"
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123,
    "prompt_tokens_details": {
      "cached_tokens": 123,
      "audio_tokens": 123
    },
    "completion_tokens_details": {
      "reasoning_tokens": 123,
      "audio_tokens": 123,
      "accepted_prediction_tokens": 123,
      "rejected_prediction_tokens": 123
    }
  }
}
The parameter compatibility of different models may be different. If you have any questions, please contact customer service.

Authorizations

Authorization
string
header
required

The authentication header format is Bearer <API_KEY>, where <API_KEY> is your API token.

Body

multipart/form-data
image
file[]
required

The picture to be edited. Must be a supported image file or image array. For gpt-image-1, each image should be a png, webp, or jpg file smaller than 25MB. For dall-e-2, you can only provide one image, and it should be a square png file smaller than 4MB.

prompt
string
required

A text description of the desired image. The maximum length of dall-e-2 is 1000 characters and the maximum length of gpt-image-1 is 32000 characters.

mask
file

An additional image with fully transparent areas (for example, an alpha value of zero) indicating where the image should be edited. If multiple images are provided, the mask will be applied to the first image. Must be a valid PNG file, smaller than 4MB, and the same size as the image.

model
string
default:gpt-image-1

The model used to generate the image. Only dall-e-2 and gpt-image-1 are supported. Defaults to dall-e-2 unless parameters specific to gpt-image-1 are used.

quality
enum<string>
default:auto

The quality of the resulting image. Only gpt-image-1 supports high, medium and low quality. dall-e-2 only supports standard quality. The default is auto.

Available options:
auto,
high,
medium,
low,
standard
response_format
enum<string>
default:url

Returns the format of the generated image. Must be one of url or b64_json. The URL is valid for 60 minutes after the image is generated. This parameter only applies to dall-e-2 since gpt-image-1 always returns a base64 encoded image.

Available options:
url,
b64_json
size
enum<string>
default:1024x1024

The size of the generated image. Must be one of 1024x1024, 1536x1024 (landscape), 1024x1536 (portrait), or auto (default) for gpt-image-1; must be one of 256x256, 512x512, or 1024x1024 for dall-e-2.

Available options:
auto,
1024x1024,
1536x1024,
1024x1536,
256x256,
512x512

Response

200 - application/json

Image edit response

created
integer
required

Unix timestamp of image creation in seconds.

data
object[]
required

generated image list

usage
object

Dosage