type— the category (see the table below).code— a stable, specific code you can branch on.message— a human-readable description.retryable— whether retrying the same request might succeed.billable— whether the call consumed credits. Provider failures and timeouts arefalse(billed at zero).
Error types
| Type | HTTP | Meaning |
|---|---|---|
validation | 400 | The request body is missing or malformed. |
auth | 401 | Missing, invalid, or unauthorized API key. |
insufficient_credits | 402 | Your balance can’t cover the call’s reserved maximum. Top up. |
rate_limited | 429 | Too many requests. Back off and retry. |
provider | 502 | The upstream provider failed. Billed at zero. |
timeout | 504 | The provider didn’t respond in time. Billed at zero. |
normalization | 502 | A curated tool couldn’t map the provider response. Billed at zero. |
Handling errors
Branch ontype (and code when you need specifics), and use retryable to decide whether to retry:
You are never charged for
provider, timeout, or normalization errors. Spend can never exceed your balance.
