Skip to main content
Every error uses one envelope, whether a request is refused or a run or one of its outputs fails:
A failed run reports the envelope’s inner object as its error, and each failed output reports one as its own error.

Retry errors

Retry a request only when retryable is true. Back off between attempts, and for a 429, wait at least the number of seconds in the Retry-After header. Send the same Idempotency-Key on each retry of a POST, so that a retry never starts a second run. For details, see Idempotency.

Request errors

Validation details

A validation_failed or invalid_request error from schema validation names the first problem in message and param. When the request has more than one problem, details.issues lists up to 10 of them, each with a message and, when it applies, a param:

Run and output errors

A run’s error and each output’s error use one of the following codes. retryable says whether creating the same run again can succeed. details.reason gives a more specific cause, and details.providerMessage sometimes carries the provider’s own message. Both are for diagnosis: their values can change, so don’t branch on them. For what a failed or cancelled run is charged, see Billing.