API reference

One upload endpoint, with binary images on success and JSON on failure.

Remove a background

POST /api/v1/remove-background

Send a multipart/form-data body. No API key is required. Let your HTTP client generate the multipart boundary.

FieldTypeRequiredDescription
imageFileYesJPEG, PNG, or WebP image
formatStringNopng by default, or webp

Only these fields are accepted. Duplicate fields are rejected. Remote image URLs and base64 payloads are not supported. This is a nobg API, not a remove.bg compatibility endpoint.

The default input limit is 10 MiB and the pixel limit is 25 megapixels. File signatures must match the declared MIME type. When an animated input is accepted by Images, the output is a still image using anim: false.

Default quotas are 5 requests per UTC calendar minute and 20 validated image attempts per UTC day per IP. The service also has a shared 10,000-attempt monthly cap. Processing failures count. People sharing an IP share quotas, including callers behind one backend. See counting rules.

Success

Status 200 with Content-Type: image/png or image/webp and Content-Disposition: attachment; filename="nobg.png" or nobg.webp. The response body contains image bytes, not JSON or a URL. Download it directly.

Responses include Cache-Control: no-store and an X-Request-Id header. nobg adds no storage or shared cache for image results.

Errors

{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests from this IP. Try again later.",
    "requestId": "a-request-uuid"
  }
}
StatusCodeMeaning
400invalid_requestMissing fields, invalid multipart body, or duplicate/unknown fields
400invalid_imageImages could not inspect or decode the file
404not_foundUnknown route or unsupported method
413payload_too_largeFile, request body, or pixel count exceeds the limit
415unsupported_formatUnsupported file signature, MIME mismatch, or output format
429rate_limitedIP minute allowance exhausted; honor Retry-After
429daily_limit_reachedIP daily image allowance exhausted
429monthly_limit_reachedShared monthly image budget exhausted
502processing_failedCloudflare Images could not produce the result
503not_configuredQuota or upload limit is not configured correctly
500internal_errorUnexpected service failure

Do not automatically retry validation errors. Respect the Retry-After header on a 429. A retry after a processing failure can repeat processing work.

Health

GET /api/health requires no authentication and returns:

{ "status": "ok", "service": "nobg", "version": "0.1.0" }

This is a liveness check. It does not call Images or verify paid-service access.

OpenAPI

GET /api/openapi.json on your API host returns the OpenAPI 3.1 description. It is public and contains no secrets. The documentation website does not run the API.