{"openapi":"3.0.3","info":{"title":"snipmat API","version":"1.0","description":"AI background removal API. One POST request returns a full-resolution transparent PNG; drop-in compatible with the remove.bg parameter set. Flat pricing: 1 credit = 1 image at any resolution. Free accounts include 50 credits/month.","termsOfService":"https://snipmat.com/terms","contact":{"name":"snipmat support","url":"https://snipmat.com/contact"}},"externalDocs":{"description":"Human-readable API docs","url":"https://snipmat.com/api"},"servers":[{"url":"https://snipmat.com"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Api-Key","description":"API key from snipmat.com/settings/api-keys (sm_live_...)"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"code":{"type":"string"}},"required":["title","code"]}}},"required":["errors"]},"RemoveBgRequest":{"type":"object","properties":{"image_file":{"type":"string","description":"Image file (png/jpeg/webp, ≤25MB, ≤32MP)","format":"binary"},"image_url":{"type":"string","format":"uri","description":"Fetch the image from a public URL instead of uploading"},"image_file_b64":{"type":"string","description":"Base64-encoded image as an alternative to image_file"},"model":{"type":"string","enum":["general","lite","dis"],"default":"general","description":"general = best all-round incl. people/hair, opens enclosed holes automatically (default); dis = alternative BiRefNet-DIS model — try it only if general misses something on a product, not for people; lite = faster, smaller model"},"size":{"type":"string","enum":["auto","preview","full"],"default":"auto","description":"auto/full = full resolution (free!), preview = ≤0.25MP"},"format":{"type":"string","enum":["auto","png","jpg","webp","zip"],"default":"auto","description":"auto = png. zip = color.jpg + alpha.png (remove.bg-compatible)"},"channels":{"type":"string","enum":["rgba","alpha"],"default":"rgba","description":"alpha returns only the mask as a grayscale PNG"},"bg_color":{"type":"string","description":"Hex background color, e.g. 81d4fa or #81d4faee"},"bg_image_url":{"type":"string","format":"uri","description":"Public URL of an image to place behind the subject"},"crop":{"type":"boolean","default":false,"description":"Crop the canvas to the subject"},"scale":{"type":"string","description":"Subject scale, e.g. \"80%\" (10–100)"},"position":{"type":"string","enum":["original","center"],"default":"original"},"keep_largest":{"type":"boolean","default":false,"description":"Keep only the largest connected component (drop stray blobs)"}},"required":["image_file"]},"AccountResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"attributes":{"type":"object","properties":{"credits":{"type":"object","properties":{"total":{"type":"number","description":"Monthly remaining + purchased pack balance"},"subscription":{"type":"number","description":"Remaining monthly included credits"},"payg":{"type":"number","description":"Purchased pack credits (never expire)"},"enterprise":{"type":"number"}},"required":["total","subscription","payg","enterprise"]},"api":{"type":"object","properties":{"free_calls":{"type":"number"},"sizes":{"type":"string"}},"required":["free_calls","sizes"]}},"required":["credits","api"]}},"required":["attributes"]}},"required":["data"]}},"parameters":{}},"paths":{"/api/v1.0/removebg":{"post":{"summary":"Remove the background from an image","description":"Synchronous removal — the response body is the result image. Costs 1 credit at any resolution. Compatible with the remove.bg API: point an existing remove.bg integration at this URL and swap the key.","security":[{"ApiKeyAuth":[]}],"requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/RemoveBgRequest"}},"application/json":{"schema":{"type":"object","properties":{"image_url":{"type":"string","format":"uri","description":"Fetch the image from a public URL instead of uploading"},"image_file_b64":{"type":"string","description":"Base64-encoded image as an alternative to image_file"},"model":{"type":"string","enum":["general","lite","dis"],"default":"general","description":"general = best all-round incl. people/hair, opens enclosed holes automatically (default); dis = alternative BiRefNet-DIS model — try it only if general misses something on a product, not for people; lite = faster, smaller model"},"size":{"type":"string","enum":["auto","preview","full"],"default":"auto","description":"auto/full = full resolution (free!), preview = ≤0.25MP"},"format":{"type":"string","enum":["auto","png","jpg","webp","zip"],"default":"auto","description":"auto = png. zip = color.jpg + alpha.png (remove.bg-compatible)"},"channels":{"type":"string","enum":["rgba","alpha"],"default":"rgba","description":"alpha returns only the mask as a grayscale PNG"},"bg_color":{"type":"string","description":"Hex background color, e.g. 81d4fa or #81d4faee"},"bg_image_url":{"type":"string","format":"uri","description":"Public URL of an image to place behind the subject"},"crop":{"type":"boolean","default":false,"description":"Crop the canvas to the subject"},"scale":{"type":"string","description":"Subject scale, e.g. \"80%\" (10–100)"},"position":{"type":"string","enum":["original","center"],"default":"original"},"keep_largest":{"type":"boolean","default":false,"description":"Keep only the largest connected component (drop stray blobs)"}}}}}},"responses":{"200":{"description":"The processed image (or ZIP). Headers: X-Credits-Charged, X-Width, X-Height, X-Job-Id, X-RateLimit-Limit/-Remaining/-Reset.","content":{"image/png":{"schema":{"type":"string","format":"binary"}},"application/zip":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid parameters or image","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"402":{"description":"Insufficient credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Saturated — retry after Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1.0/account":{"get":{"summary":"Credit balance and plan for the authenticated key","security":[{"ApiKeyAuth":[]}],"responses":{"200":{"description":"Account state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}},"403":{"description":"Invalid or revoked API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}