{"openapi":"3.1.0","info":{"title":"STERILIZER API","version":"1.0.0","summary":"Zero-retention photo sanitation: crop, grayscale, pixelate faces, strip metadata.","description":"Sanitize photos over HTTP: crop, convert to black and white, pixelate faces and\narbitrary regions, and strip every metadata block (EXIF, GPS, IPTC, XMP, ICC).\n\nRetention: images are processed in memory and never written to disk, never logged,\nand never used for training. Nothing about a request survives the response except\na counter incremented for billing.\n\nRate limits: 1 request per minute is free and needs no API key.\nBeyond that, send an API key; calls above one per minute are billed per call.","contact":{"url":"https://api.imagesterilizer.com/docs"},"license":{"name":"Commercial","url":"https://api.imagesterilizer.com/docs#pricing"}},"servers":[{"url":"https://api.imagesterilizer.com"}],"security":[{"bearerAuth":[]},{}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Send `Authorization: Bearer <api-key>`. Omit for the free tier."}},"schemas":{"Ops":{"type":"object","description":"Operations applied in order: crop → grayscale → resize → pixelate → re-encode.","properties":{"crop":{"type":"object","required":["x","y","width","height"],"description":"Rectangle in source pixels, applied after EXIF auto-rotation.","properties":{"x":{"type":"number","minimum":0},"y":{"type":"number","minimum":0},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0}}},"grayscale":{"type":"boolean","default":false,"description":"Convert to black and white."},"pixelate":{"type":"object","properties":{"faces":{"type":"boolean","default":true,"description":"Detect faces on-server and pixelate each one."},"regions":{"type":"array","maxItems":200,"items":{"type":"object","required":["x","y","w","h"],"properties":{"x":{"type":"number","minimum":0,"description":"Left edge in pixels."},"y":{"type":"number","minimum":0,"description":"Top edge in pixels."},"w":{"type":"number","exclusiveMinimum":0,"description":"Width in pixels."},"h":{"type":"number","exclusiveMinimum":0,"description":"Height in pixels."}}},"description":"Extra rectangles to pixelate — plates, badges, documents, screens."},"strength":{"type":"integer","minimum":1,"maximum":12,"default":3,"description":"Block size as a percentage of the shortest edge. Higher = coarser."},"confidence":{"type":"number","minimum":0.05,"maximum":0.99,"default":0.6,"description":"Minimum face-detector confidence."},"padding":{"type":"number","minimum":1,"maximum":3,"default":1.5,"description":"Expansion factor around each detected face."}}},"output":{"type":"object","properties":{"format":{"type":"string","enum":["jpeg","png","webp"],"default":"jpeg"},"quality":{"type":"integer","minimum":30,"maximum":100,"default":92},"maxWidth":{"type":"integer","minimum":16,"maximum":12000,"description":"Downscale cap."}}},"response":{"type":"string","enum":["binary","json"],"default":"binary","description":"binary returns image bytes; json returns base64 plus a purge report."}}},"Region":{"type":"object","required":["x","y","w","h"],"properties":{"x":{"type":"number","minimum":0,"description":"Left edge in pixels."},"y":{"type":"number","minimum":0,"description":"Top edge in pixels."},"w":{"type":"number","exclusiveMinimum":0,"description":"Width in pixels."},"h":{"type":"number","exclusiveMinimum":0,"description":"Height in pixels."}}},"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"docs":{"type":"string"}}}}},"paths":{"/v1/sanitize":{"post":{"operationId":"sanitizeImage","summary":"Sanitize an image","description":"Crops, optionally converts to black and white, pixelates faces plus any supplied regions, and re-encodes the result so no metadata survives.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["image"],"properties":{"image":{"type":"string","description":"Base64-encoded image bytes. Data URLs are accepted."},"ops":{"$ref":"#/components/schemas/Ops"}}}},"multipart/form-data":{"schema":{"type":"object","required":["image"],"properties":{"image":{"type":"string","format":"binary"},"ops":{"type":"string","description":"JSON-encoded Ops object."}}}}}},"responses":{"200":{"description":"Sanitized image.","headers":{"X-Sterilizer-Faces-Detected":{"schema":{"type":"integer"}},"X-Sterilizer-Regions-Pixelated":{"schema":{"type":"integer"}},"X-Sterilizer-Billable":{"schema":{"type":"string"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}}},"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string","description":"Base64 image bytes."},"content_type":{"type":"string"},"report":{"type":"object","properties":{"width":{"type":"integer"},"height":{"type":"integer"},"bytes":{"type":"integer"},"facesDetected":{"type":"integer"},"regionsPixelated":{"type":"integer"},"grayscale":{"type":"boolean"},"metadataStripped":{"type":"boolean"},"sourceMetadataFound":{"type":"array","items":{"type":"string"}},"durationMs":{"type":"integer"}}}}}}}},"400":{"description":"Malformed request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"docs":{"type":"string"}}}}}},"401":{"description":"Unknown API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"docs":{"type":"string"}}}}}},"402":{"description":"Plan quota exhausted.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"docs":{"type":"string"}}}}}},"422":{"description":"Undecodable image.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"docs":{"type":"string"}}}}}},"429":{"description":"Rate limit exceeded — free tier allows 1 request/minute.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"docs":{"type":"string"}}}}}}}}},"/v1/detect":{"post":{"operationId":"detectFaces","summary":"Detect faces without altering the image","description":"Returns face bounding boxes so a client can preview or adjust them before calling sanitize. No image is returned.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["image"],"properties":{"image":{"type":"string"},"ops":{"type":"object","properties":{"confidence":{"type":"number","default":0.6},"padding":{"type":"number","default":1.5}}}}}}}},"responses":{"200":{"description":"Detected faces.","content":{"application/json":{"schema":{"type":"object","properties":{"width":{"type":"integer"},"height":{"type":"integer"},"count":{"type":"integer"},"faces":{"type":"array","items":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"},"w":{"type":"number"},"h":{"type":"number"},"confidence":{"type":"number"}}}}}}}}},"429":{"description":"Rate limit exceeded.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"docs":{"type":"string"}}}}}}}}},"/v1/inspect":{"post":{"operationId":"inspectImage","summary":"Report the metadata an image is carrying","description":"Read-only. Lists the metadata blocks present in the supplied image — exactly what sanitize would destroy.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["image"],"properties":{"image":{"type":"string"}}}}}},"responses":{"200":{"description":"Metadata report.","content":{"application/json":{"schema":{"type":"object","properties":{"format":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"bytes":{"type":"integer"},"metadata_blocks_present":{"type":"array","items":{"type":"string"}},"has_gps":{"type":"boolean"}}}}}}}}},"/v1/usage":{"get":{"operationId":"getUsage","summary":"Current billing period usage for your key","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Usage totals.","content":{"application/json":{"schema":{"type":"object","properties":{"key_id":{"type":"string"},"plan":{"type":"string"},"period":{"type":"string"},"calls":{"type":"integer"},"billable_calls":{"type":"integer"},"cost_cents":{"type":"number"},"cost_usd":{"type":"number"}}}}}}}}},"/v1/health":{"get":{"operationId":"health","summary":"Liveness probe","security":[{}],"responses":{"200":{"description":"Service is up."}}}}}}