Error envelope
Every non-2xx response from fetchbean looks like this:Error types
Codes worth handling
A fewcode values inside those types come up often enough to branch on directly:
Handling errors
Branch ontype 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 — the provider never delivered, so billable is false. normalization is the exception: the provider call succeeded and cost real money, and only fetchbean’s mapping to a stable shape failed, so it is billable. Fall back to POST /v1/run to get that provider’s raw response.billable rather than inferring from the status code — it is authoritative for every error. Your spend can never exceed your balance regardless, because insufficient-credit calls are rejected before any provider request is made.
