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-data

Parameters

NAMETYPEDESCRIPTION
imagefileMultipart image. PNG, JPEG, WebP, HEIC. Up to 15 MB today.
image_urlstringHTTPS image URL for JSON requests.
maskfileOptional mask. White pixels are removed.
mask_urlstringOptional HTTPS mask URL.
promptstringObject description. Required if no mask.
targetstring`all` (default) or `largest`.
modelstring`fast` (default) or `quality`.
output_formatstring`png`, `jpeg`, or `webp`.
retentionstring`standard` or `zero`.
width / heightintegerOptional dimensions for credit estimation.
webhook_urlstringOptional per-job webhook target.
metadataobjectUp 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=fast

JSON 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.