The endpoint and task state matter together
A 401 on a content GET differs from uncertainty after a creation POST. The first can be a delivery authentication problem; the second can represent already accepted paid work. Preserve any returned job ID and the original request identifier before deciding whether another network operation is safe.
What to do next
- 01
Parse safe error information
Inspect HTTP status and the documented error object without dumping provider bodies or Authorization headers. Keep the route, UTC time and internal correlation ID for diagnosis.
- 02
Choose the smallest remedy
Correct validation locally, refresh intended configuration or wait under Retry-After as appropriate. Do not automatically raise caps, substitute a model or recreate a completed job to repair a failed download.
- 03
Retain recoverable work
For lost creation responses, retry the unchanged approved task with its saved identifier. For unknown jobs, keep the record and follow reconciliation instead of erasing it as a generic failure.
A concrete example
Illustrative policy: a 400 prompt error returns to input correction, a 429 waits, and an unknown job remains visible for recovery. None automatically produces a fresh idempotency value and another billable task.
Before you call it ready
- Errors are classified by route and meaning.
- Safe identifiers survive failure.
- The remedy does not silently expand spending approval.
When to stop or choose another method
If the response is unrecognized, fail closed for new spending and retain evidence. A generic retry loop can turn an integration defect into a customer billing problem.
