API documentation

Last updated: 7 November 2026

On the $7.99 plan you can remove backgrounds straight from your own tool or script. Each call sends one photo and returns a PNG with a transparent background. Calls count against the same 3,000 photos a month as the browser.

1. Create an API key

  1. Sign in on the home page and subscribe to the $7.99 plan.
  2. In the "API access" section near the bottom of the page, give the key a name and press "Create key". The key is a 44-character string starting with snk_ and is shown only once, right after it is created. Keep it somewhere safe.
  3. An account can hold up to 5 keys. Revoke a key you no longer use with "Revoke"; a revoked key never works again.

Keys are personal. Do not lend, transfer or sell them. Calling the API from inside your own service or tool, or processing your clients' photos as a listing agency, is fine (just never hand over the key string itself). If you think a key has leaked, revoke it at once and create a new one.

If you cancel or move to the $4.99 plan, the keys stop working (403). You can still list and revoke them. When you return to the $7.99 plan, keys you did not revoke work again.

2. Send a photo

EndpointPOST https://shironuki.com/v1/cutout
AuthenticationAuthorization: Bearer snk_…
Request bodyThe image file itself (JPEG, PNG, WebP, HEIC and so on). Content-Type is the image type, such as image/jpeg, or application/octet-stream. Up to 20 MB per photo.
Processing timeUsually a few seconds; large images can take about 30 seconds. Set your client timeout to 120 seconds.
OptionAdd ?trim=1 to crop the transparent margin away.
On success200 with an image/png body (the photo with a transparent background). Headers: x-counted (1 when this call counted a photo, 0 when it did not), x-used (photos used this month), x-remaining (photos left).

Photos resized to about 2,000 px on the long side process faster and more reliably; the browser version applies the same resize before uploading.

3. How photos are counted

4. Limits

5. Errors

Error bodies are JSON with the reason in error. Errors returned by the network edge (Cloudflare) may be HTML, so handle a body that is not JSON.

400 networkThe body was cut off. Send it again.
401 keyNo key, a malformed key, an unknown key, or a revoked one.
403 planThe key's owner is not on the $7.99 plan (cancelled or expired included).
413 sizeOver 20 MB.
413 pixelsOver 100 megapixels.
415 type / decodeNot an image, or a format that cannot be read.
429 quotaThe month's 3,000 photos are used up. Retry-After is the number of seconds until the next month.
429 rateOver 10 requests per second or 10 in flight. Send again after Retry-After seconds.
502 engineA fault in the processing engine. Tell us if it repeats.
503 busyThe service is busy. Send again after Retry-After seconds.

6. Photos left this month

GET https://shironuki.com/v1/usage with the same Authorization header returns {"used":…,"limit":3000,"remaining":…,"month":"202611","resets_at":"…"}. Nothing is counted.

7. Examples

curl:

curl -X POST https://shironuki.com/v1/cutout \
  -H "Authorization: Bearer snk_…" \
  -H "Content-Type: image/jpeg" \
  --data-binary @photo.jpg \
  -o photo.png

Python (requests):

import requests

KEY = "snk_…"
with open("photo.jpg", "rb") as f:
    r = requests.post(
        "https://shironuki.com/v1/cutout",
        headers={"Authorization": f"Bearer {KEY}", "Content-Type": "image/jpeg"},
        data=f.read(),
        timeout=120,
    )
if r.status_code == 200:
    open("photo.png", "wb").write(r.content)
    print(r.headers["x-remaining"], "photos left")
else:
    print(r.status_code, r.text[:200])

8. If you need a white-background JPEG

The API returns the transparent PNG only. For a white-background JPEG, place the PNG over a white canvas and save it (the browser version does this composite on your device).

The terms of use apply to the API. What we store is listed in section 1 of the privacy policy.