Error shape
| Field | Meaning |
|---|---|
message | Human-readable explanation of what failed. |
type | Error class, e.g. invalid_request_error, authentication_error, rate_limit_error, server_error. |
param | The request parameter at fault, when one can be identified. |
code | Stable machine-readable code, e.g. model_not_found. |
AuthenticationError, RateLimitError, and friends) work unchanged against Huzz.
Status codes
| Status | Type | What it means | What to do |
|---|---|---|---|
400 | invalid_request_error | The request body or parameters are malformed. | Fix the request. Do not retry as-is. |
401 | authentication_error | Missing, malformed, expired, or revoked API key. | Check HUZZ_API_KEY and the Authorization header. See Authentication. |
404 | invalid_request_error | Unknown route, model, or prediction id. | Verify the model id against the catalog and the URL path. |
429 | rate_limit_error | You hit your requests-per-minute limit or budget cap. | Back off and retry. Honor Retry-After when present. |
500 | server_error | Something failed inside Huzz or an upstream provider. | Retry with backoff; contact support if it persists. |
503 | server_error | The model or gateway is temporarily overloaded. | Retry with backoff. |
Retry guidance
- Retry
429and5xxonly. Other4xxerrors are deterministic — the same request will fail the same way until you change it. - Use exponential backoff with jitter. Start around 1 second, double each attempt, add random jitter, and cap total attempts (3–5 is typical).
- Honor
Retry-After. When a429response includes the header, wait at least that long before the next attempt. - Keep retries idempotent. For async predictions, retry the poll, not the submit, unless the submit itself failed — otherwise you may pay for duplicate generations.
Minimal backoff loop
data: [DONE], treat the output as incomplete and retry the request.