Skip to main content
Whenever a fetchbean API call fails, the response body contains a unified error envelope with a matching HTTP status code. Every error — whether it originates from a bad request, an auth failure, or an upstream provider — uses the same structure, so you can write one error-handling path that works across all providers and endpoints.

Error envelope

Every non-2xx response from fetchbean looks like this:
Each field serves a distinct purpose:

Error types

Codes worth handling

A few code values inside those types come up often enough to branch on directly:

Handling errors

Branch on type for the main decision logic, and use code when you need to handle a specific failure scenario. Use the retryable flag to determine whether a retry is appropriate:
You are never charged for provider or timeout errors. Their billable field is false. normalization is the exception: the provider call succeeded and cost real money, but fetchbean could not map its result to the curated shape. Fall back to POST /v1/run to get the registered operation’s provider-specific result.
Read billable rather than inferring from the status code. Admission checks the call’s upfront hold against the available balance and monthly cap. A metered call’s final charge can exceed that hold, the remaining balance, or the cap after admission.