internal_error means the service hit a state it treats as a bug while running your request. Read this page when a run fails with a 500 and you need to decide whether to retry and what to report.
What happened
Route:POST /v1/runs.
The run was admitted, then reached an internal step that does not match the kind of run it is. This state is not expected to happen, and nothing in your request can cause it on purpose. The message is always “an unexpected internal failure occurred”; it never contains your input or model output.
How to fix
- Log the
request_idfrom the error body (it matches thex-request-idresponse header). - Retry once, after a short pause, with a new
Idempotency-Key. The failed run may be stored aspending, and a replay with the old key would return202with that pending run instead of an answer. - If the retry also returns
internal_error, stop retrying and report bothrequest_idvalues. Retrying in a loop does not help with this code.
Example
Related
- Request ids - send your own
x-request-idand quote it when you report a problem. - Error handling - a status-to-action table and a retry helper for every error.
- Idempotency - when to reuse an
Idempotency-Keyand when to send a new one. - Problem codes - every code, its status, and whether a retry can help.