# Error and retry policy

Correct and retry with a new quote after invalid JSON, invalid model, invalid output ceiling, or expiry. Treat HTTP 402 as the normal authorization step.

Stop on `wallet_request_cap_exceeded`, `wallet_hour_cap_exceeded`, or `wallet_day_cap_exceeded`; reduce the request only for a per-request limit, otherwise wait for reset or operator review. These controls apply automatically to every verified payer and run before provider execution.

Retry `empty_provider_response` only after increasing `max_tokens`; the known unusable inference is not customer-settled. Treat `finish_reason: "length"` as a paid, valid, truncated response rather than an error.

Never create a new paid request after `provider_outcome_unknown`, `settlement_unknown`, a post-authorization timeout, or a lost connection. Retry the identical request with the same idempotency identity to recover durable state, then wait for receipt/reconciliation or operator resolution.

HTTP 409 means an idempotency key was reused with a different effective request. Do not override it.
