Errors
Every error response is JSON with a stable, machine-readable shape:
{
"error": "Unsupported format: gif",
"code": "UNSUPPORTED_FORMAT"
}Responses are sent with Cache-Control: no-cache, no-store, must-revalidate so intermediaries never cache a failure.
Error codes
| Code | HTTP status | Meaning |
|---|---|---|
| EMPTY_URL | 400 | No source URL was provided after /img/. |
| UNSUPPORTED_FORMAT | 400 | f/format was not one of auto, webp, avif. |
| UNSUPPORTED_CONTENT_TYPE | 400 | The origin responded with a non-image Content-Type. |
| IMAGE_NOT_FOUND | 404 | The origin returned 404 for the source URL. |
| SIZE_EXCEEDED | 413 | The source image exceeds the configured size limit. |
| CIRCUIT_BREAKER_OPEN | 503 | Too many recent failures fetching this origin; requests are temporarily short-circuited. |
| UPSTREAM_TIMEOUT | 504 | The origin did not respond in time. |
| INVALID_FIT_MODE | 400 | fit was not one of the supported values. |
| INVALID_POSITION | 400 | position/pos was not one of the supported values. |
| INVALID_BLUR | 400 | blur was outside the 1–100 range. |
| INVALID_ROTATION | 400 | rotate/rot was not 0, 90, 180, or 270. |