Remove objects from any photo with 1 API call
Integrate object removal into your app or workflow. POST an image and a mask, get the inpainted result back — metered by credits, a fraction of the price of the big names.
Get API KeyNot a developer? Use the web app instead — no code required.
Easy to integrate
A simple HTTP interface with sensible options:
- Source images
- Direct upload (
image_file+mask_file), URLs (image_url+mask_url), or base64 strings (image_base64+mask_base64). - Result images
- Binary image file by default, or JSON-encoded data (base64 + dimensions) with
Accept: application/json. - Output resolution
- Up to 32 megapixels. The result always comes back at the exact dimensions of the input photo.
Get started
Create an API key in your dashboard, top up credits, then send your first request. One credit per successful full-resolution edit — failed calls are never charged. Authenticate with X-Api-Key: or_live_… (or Authorization: Bearer or_live_…).
How masks work
The mask tells the model what to remove: white pixels = remove and fill, black (or transparent) pixels = keep. Grayscale masks are hard-thresholded at 50%. The mask is automatically resized to the photo's dimensions, so you can generate it at any resolution with the same aspect ratio.
- Cover the whole object, including its shadow and reflection, for the cleanest fill.
- A slightly generous mask beats a pixel-perfect one — the model blends edges.
- An all-black (empty) mask is rejected with
invalid_input— nothing to remove, nothing charged.
Removed areas are reconstructed by AI. Generated content may not reflect reality — disclose this to your end users where it matters.
Sample code
The only request you need:
curl -H "X-Api-Key: or_live_..." \
-F "image_file=@/path/to/photo.jpg" \
-F "mask_file=@/path/to/mask.png" \
-f https://usely.tools/api/v1/remove-object \
-o cleaned.pngAPI Reference
POST /api/v1/remove-object
Removes the masked objects from a JPG / PNG / WebP image via AI inpainting. File size up to 12 MB each; input resolution up to 32 megapixels. Requires an API key in the X-Api-Key header (or a Bearer token in Authorization).
Request body — multipart/form-data or application/json
| Parameter | Type | Description |
|---|---|---|
image_file | binary | Source photo (binary). If present, the other image source parameters must be empty. |
mask_file | binary | Mask image (binary). White = remove, black/transparent = keep. Auto-resized to the photo. |
image_base64 / mask_base64 | string | Base64-encoded alternatives for JSON requests. Mutually exclusive with the other sources. |
image_url / mask_url | string | Publicly reachable URLs to fetch instead. Mutually exclusive with the other sources. |
size | string | Output resolution: preview (≤0.25 MP), full (original size up to 32 MP), or auto (default, same as full). |
format | string | Result format: png (default) or jpg. |
Request headers
| Header | Description |
|---|---|
X-Api-Key | Your API key (or_live_…). Also accepted as Authorization: Bearer …. |
Accept | application/json to receive base64 + dimensions instead of binary. |
Idempotency-Key | Optional. Retries with the same key return the original response and are never double-charged. |
Responses
| Code | Description |
|---|---|
200 | Objects removed. Binary image (or JSON when Accept: application/json). Response headers include X-Credits-Charged, X-Credits-Remaining, and rate-limit headers. |
400 | Invalid parameters, unreadable image, or an empty mask (no credits charged). Envelope: { "error": { "code", "message" } }. |
401 | Authentication failed — missing or invalid API key (no credits charged). |
402 | Insufficient credits (no credits charged). |
429 | Rate limit exceeded (no credits charged). Includes a Retry-After header. |
Response headers
| Header | Description |
|---|---|
X-Width / X-Height | Dimensions of the result image. |
X-Credits-Charged | Credits charged for this call. |
X-Credits-Remaining | Remaining wallet balance after the call. |
X-RateLimit-Remaining | Requests remaining in the current window. |
Account endpoint
GET /api/v1/account
Fetch the current credit balance for the authenticated key. Balance changes may lag a few seconds; to track locally, read this once and then adjust using the X-Credits-Charged header returned by each edit.
{
"data": {
"credits": { "balance": 200 }
}
}