Images

Edit Image

Edit an image you generated earlier, guided by a prompt.

Every image_url must be an image your own account generated. Uploads and external URLs are rejected before you are charged.

POST/v1/images/editsTry it

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your SpicyAPI key (sk-spicy-…). Create one in the dashboard under API Keys.

Body

application/json
modelstringrequired

An image-edit model id, e.g. spicy-image-edit-1.

promptstringrequired

The change to make.

image_urlstring

A single source image. Use this or image_urls.

image_urlsstring[]

Up to 3 source images, all owned by your account.

negative_promptstring

What to avoid.

sizestring

Output size as width*height.

seedinteger

Reproducibility seed.

Response

200application/json

Successful Response

idstringrequired

Request id.

objectstringrequired

Always image.edit.

dataImage · object[]required

The edited image.

cost_usdnumberrequired

What this request cost, in US dollars, already debited from your balance.

Was this page helpful?

Edit Image
cURL
curl --request POST \
  --url https://api.spicyapi.com/v1/images/edits \
  --header 'Authorization: Bearer $SPICYAPI_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "spicy-image-edit-1",
    "prompt": "change the background to a hotel suite",
    "image_url": "https://cdn.spicyapi.com/outputs/a1b2/req_8f2a91c4-0.png"
  }'
200
JSON
{
  "id": "req_31c7de05",
  "object": "image.edit",
  "data": [
    { "url": "https://cdn.spicyapi.com/outputs/a1b2/req_31c7de05-0.png" }
  ],
  "cost_usd": 0.15
}