Skip to main content
POST
/
v1
/
images
/
edits
curl --request POST \
  --url 'https://api.elkapi.com/v1/images/edits' \
  --header 'Authorization: Bearer <token>' \
  --form 'image=@https://example.com/image.png' \
  --form 'mask=@file.bin' \
  --form 'prompt=A small kitten running through a sunny garden, cinematic, highly detailed' \
  --form 'n=1' \
  --form 'size=1024x1024' \
  --form 'response_format=json' \
  --form 'user=' \
  --form 'model=gpt-image-1.5'
{}

Documentation Index

Fetch the complete documentation index at: https://docs.elkapi.com/llms.txt

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

curl --request POST \
  --url 'https://api.elkapi.com/v1/images/edits' \
  --header 'Authorization: Bearer <token>' \
  --form 'image=@https://example.com/image.png' \
  --form 'mask=@file.bin' \
  --form 'prompt=A small kitten running through a sunny garden, cinematic, highly detailed' \
  --form 'n=1' \
  --form 'size=1024x1024' \
  --form 'response_format=json' \
  --form 'user=' \
  --form 'model=gpt-image-1.5'
{}

Authorizations

Authorization
string
required
All endpoints require Bearer Token authentication.Add it to the request headers:
Authorization: Bearer YOUR_API_KEY

Body

image
file
required
Image to edit. Must be a valid PNG file, under 4 MB, and square. If no mask is provided, the image must include transparency, which will be used as the mask.Example: cmMtdXBsb2FkLTE2ODc4MzMzNDc3NTEtMjA=/31225951_59371037e9_small.png
mask
file
Additional image whose fully transparent areas (for example, areas with alpha zero) indicate where the image should be edited. Must be a valid PNG file, under 4 MB, and the same dimensions as the original image.Example: “
prompt
string
required
Text description of the desired image. Maximum length: 1000 characters.Example: A cute baby sea otter wearing a beret.
n
string
Number of images to generate. Must be between 1 and 10.Example: 1
size
string
Size of the generated image. Must be one of 256x256, 512x512, or 1024x1024.Example: 1024x1024
response_format
string
Format returned for the generated image. Must be url or b64_json.Example: url
user
string
A unique identifier for your end user, which can help OpenAI monitor and detect abuse. Learn more.Example: “
model
string
default:"gpt-image-1.5"
Example: gpt-image-1.5

Response