Integrating a Background Removal API: A Developer Guide
If you are building a product that needs background removal, you have two options: run the models yourself or call an API. This guide covers the API integration path in detail.
If you are building a product that needs background removal, you have two options: run the models yourself or call an API. This guide covers the API integration path in detail.
Every background removal API follows roughly the same pattern. You send a multipart POST with the image file. You receive a binary image back or a JSON payload with a URL.
The Remova API accepts the file in a field named file. You pass options as query parameters. The transparent parameter controls whether the output has an alpha channel or a solid background. The max_size parameter controls the AI processing resolution.
The response is the image bytes directly. There is no wrapper JSON. If you are using fetch, response.blob() gives you the image.
The API returns standard HTTP status codes. 2xx is success. 4xx is a problem with your request. 5xx is a problem with the backend. 429 is a rate limit.
On 4xx, the request body contains a JSON object with an error field explaining what went wrong. Common causes are an unsupported file type, a file that is too large, or a missing file.
On 5xx, retry with exponential backoff. The backend may be starting up or momentarily overloaded. A retry after a short delay usually succeeds.
On 429, respect the Retry-After header if present. Otherwise wait a few seconds and retry.
The public tier allows thirty requests per minute per IP. This is enough for most applications. If you are processing a large batch, the batch endpoint counts as one request regardless of how many files are in it.
For applications that need higher limits, the feedback button on the site is the contact point. There is no self-serve way to increase the limit because there is no account system.
If you are behind a shared IP (corporate NAT, VPN, cloud function with a shared egress IP), the rate limit applies to everyone behind that IP. This can cause unexpected 429s in development.
The API returns several headers that tell you what happened. X-Model-Used is the human-readable model name. X-Model-Id is the internal identifier. X-Processing-Time is the number of seconds the operation took.
X-Quality-Label is a categorical assessment of the result. Excellent, Good, Fair, or Poor. X-Hair-Refined tells you whether the hair preservation pass ran.
These headers are useful for logging and for building quality dashboards. If you are processing a large batch, tracking the distribution of X-Quality-Label tells you whether your source photos are consistent enough.
For production systems, add a timeout on the client side. The API has its own timeout but network issues can cause requests to hang. AbortSignal.timeout is the standard way to handle this in JavaScript.
Cache aggressively. If the same image is uploaded twice, return the cached result rather than calling the API again. Hash the file contents and store the result keyed by hash.
Monitor error rates. A sudden spike in 5xx responses means the backend is having trouble. A sudden spike in 429 means you are hitting the rate limit. Both are actionable.
No. The public tier does not require authentication. The rate limit is per IP address.
30MB for images, 100MB for video. Larger files should be compressed before uploading.
Yes. The endpoint is standard HTTP. The only consideration is the timeout. Serverless platforms often have short execution limits. If your function needs more than a few seconds, use a longer timeout configuration.
Video uses a different pipeline. The frames endpoint accepts batches of frames and returns processed frames. The client-side processor handles the extraction and reassembly. If you are building your own pipeline, the frames endpoint is the integration point.