API
POST /v1/erase
Create an erase job with a prompt or an exact mask. Multipart is best for direct uploads; JSON is best when your storage already has the image.
Request
POST https://api.erasa.app/v1/erase
Authorization: Bearer $ERASA_KEY
Idempotency-Key: 7c1e...
Content-Type: multipart/form-dataParameters
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| image | file | Multipart image. PNG, JPEG, WebP, HEIC. Up to 15 MB today. |
| image_url | string | HTTPS image URL for JSON requests. |
| mask | file | Optional mask. White pixels are removed. |
| mask_url | string | Optional HTTPS mask URL. |
| prompt | string | Object description. Required if no mask. |
| target | string | `all` (default) or `largest`. |
| model | string | `fast` (default) or `quality`. |
| output_format | string | `png`, `jpeg`, or `webp`. |
| retention | string | `standard` or `zero`. |
| width / height | integer | Optional dimensions for credit estimation. |
| webhook_url | string | Optional per-job webhook target. |
| metadata | object | Up to 4 KB of your own metadata. |
Prompt or mask
A prompt uses text detection to find every match. A mask gives exact control and takes precedence when both are supplied. Use a mask for logos, text, or a single region where detection could pick up extra objects.
Multipart example
cURL
curl https://api.erasa.app/v1/erase \
-H "Authorization: Bearer $ERASA_KEY" \
-H "Idempotency-Key: 7c1e..." \
-F image=@street.jpg \
-F prompt="power lines" \
-F model=fastJSON example
JSON
{
"image_url": "https://example.com/street.jpg",
"mask_url": "https://example.com/mask.png",
"model": "fast",
"output_format": "png",
"retention": "zero",
"metadata": { "order_id": "123" }
}Response
200 OK
{
"id": "job_01J...",
"status": "succeeded",
"mode": "fast",
"model": "mock-fast",
"input": { "width": 4032, "height": 3024, "megapixels": 12.19 },
"output": {
"url": "https://api.erasa.app/api/files/...",
"expires_at": "2026-12-06T06:18:27.349Z",
"format": "png",
"width": 4032,
"height": 3024
},
"credits": { "reserved": 2, "charged": 2 },
"latency_ms": 1840,
"request_id": "req_01J..."
}Credits
One credit covers an image up to 12 MP on the fast model. Larger images consume multiples of 12 MP. Quality mode is 2× credits. A failed job charges 0 credits.
`output.url` is a signed, short-lived link. Re-fetch the job to get a fresh URL. Zero retention removes inputs immediately and outputs after the signed URL window.