Introduction
Object Eraser removes things you do not want from a photo and fills the space they leave with background that matches the rest of the scene. You point at the object in one of two ways, by describing it in a few words or by painting it white on a black mask, and you get the same photo back at its original size without the object.
Key features & highlights
Point with words or with a mask
The quickest way in is a short description: "the wooden bench on the left", "the sign above the door", "the second person from the right". It works best on distinct objects with some clear space around them; thin objects and things at the edge of the frame are often missed, and a photo that comes back unchanged is the sign. A mask marks the pixels precisely, so it is the reliable route in those cases, as it is for one of two similar cups or only part of a fence. Both can be sent in the same request.
Fills that follow the scene
The removed area is not blurred or smeared. It is rebuilt from its surroundings, so floorboards continue, walls keep their texture and light keeps falling the same way, which is what makes the result read as an untouched photograph.
The rest of the photo stays as it was
Only the selected object is replaced. The framing, the resolution and everything outside the selection come back as sent, so the edited photo can go straight back into a layout, a listing or a series.
Request parameters
| Parameter | Required | Description |
|---|---|---|
image_url | Yes | The photo to clean up, as JPEG, PNG or WebP. at least 1 characters |
prompt | No | What to remove, in a few plain words with a position when there is more than one: "the red car on the left". at least 1 characters · at most 1000 characters |
mask_url | No | Optional black-and-white image the same size as the photo: white marks what to remove, black what to keep. Use it when a description could point at the wrong object. at least 1 characters |
output_format | No | PNG keeps every edge lossless and is the default; JPEG and WebP give smaller files. |
Pricing
$0.03 / image
Charged per output image; the number of objects you remove in one request does not change the price.
Use cases
Clean product and property photos
Remove cables, price tags, stray packaging or a passer-by from shots that are otherwise ready, instead of booking a reshoot. It is the quickest fix for listing photos, interiors and real-estate galleries where one distracting object spoils the frame.
Tidy travel and event pictures
Take tourists, bins, scaffolding or other photographers out of the background of a portrait or a landmark, so the subject finally has the frame to itself.
Prepare plates for further edits
Clear a space first, then widen the whole scene afterwards with Image Expander.
Prompt guide & pro tips
Describe what is visible, and where
Write the object the way you would point it out to a colleague: a noun, a colour or material, and a position. "Bench" works; "the wooden bench on the left" works better when the scene holds more than one. Naming something that is not in the picture does not raise an error. The photo simply comes back unchanged, so a result identical to the input usually means the description missed.
Paint masks generously
When you use mask_url, make it the same size as the photo, white over the object and black everywhere else. Extend the white a little past the object's edge so its outline and shadow disappear too; a mask that hugs the silhouette tends to leave a faint ghost behind.
Remove big things one pass at a time
Several small objects can go in one request, but for large or overlapping removals run separate passes and check each result. Every pass returns a complete photo, so the output of one request can be fed straight into the next.
API quick start
# Generate the idempotency key once; reuse it when retrying after a lost response.
export SPICY_IDEMPOTENCY_KEY="${SPICY_IDEMPOTENCY_KEY:-$(uuidgen)}"
curl -X POST https://api.spicyapi.ai/api/v1/jobs/createTask \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $SPICY_IDEMPOTENCY_KEY" \
-d '{
"model": "spicyapi/object-eraser-v1/edit",
"input": {
"image_url": "https://example.com/reference.png",
"output_format": "png",
"prompt": "A ceramic teapot on a linen cloth, soft window light, muted palette"
}
}'
# Copy data.taskId from the response into TASK_ID, then poll the status.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.spicyapi.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
-H "Authorization: Bearer $SPICY_API_KEY"
See the API reference for authentication, the complete schema, polling, and error handling.








