API reference
Responses & errors
Headers and status codes you can expect.
Success headers
| Header | Value |
|---|---|
Content-Type | image/avif · image/webp · image/jpeg · image/png · image/svg+xml |
Cache-Control | public, max-age=31536000, immutable |
Vary | Accept (for CDNs that cache per-format under fmt=auto) |
Status codes
| Status | Meaning |
|---|---|
200 | Optimized image returned |
400 | Missing project or source URL |
403 | Source host is not on the allowlist, or resolves to a private/SSRF target |
404 | Unknown project |
413 | Origin image exceeds the size cap (KEENPIX_MAX_ORIGIN_BYTES) |
502 | Origin fetch failed |
503 | Transform concurrency limit reached — retry shortly |
504 | Origin request timed out (KEENPIX_ORIGIN_TIMEOUT_MS) |
A 403 almost always means the source host isn't on the project's allowlist. Add it
under Settings → Security → Allowed hosts.