Skip to main content
POST
/
v1
/
generation
/
image
/
edit
curl -X POST "https://apolloai.lol/v1/generation/image/edit" \
  -H "x-api-key: <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A futuristic city skyline with flying cars",
    "image": "<base64_image_data>",
    "mask": "<base64_mask_data>",
    "size": "1024x1024",
    "n": 1
  }'
{
  "created": 1706859322,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
    }
  ]
}
Modify an image based on a text prompt. You can perform inpainting (if a mask is provided) or generate variations of the input image.

Headers

x-api-key
string
required
Your Apollo AI API key.

Body Parameters

prompt
string
required
The text description of the desired edit or variation.
image
string
required
Base64 encoded string of the source image.
mask
string
Base64 encoded string of the mask image (for inpainting). White pixels indicate areas to modify. If omitted, the request is treated as an image variation.
size
string
default:"1024x1024"
The dimensions of the generated image. Supported values: “1024x1024”, “512x512”.
n
integer
default:"1"
The number of variation images to generate.

Response

created
integer
Timestamp of generation.
data
array
Array of objects containing the image data.
curl -X POST "https://apolloai.lol/v1/generation/image/edit" \
  -H "x-api-key: <api_key>" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A futuristic city skyline with flying cars",
    "image": "<base64_image_data>",
    "mask": "<base64_mask_data>",
    "size": "1024x1024",
    "n": 1
  }'
{
  "created": 1706859322,
  "data": [
    {
      "b64_json": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
    }
  ]
}