Skip to main content
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

  1. Log the request_id from the error body (it matches the x-request-id response header).
  2. Retry once, after a short pause, with a new Idempotency-Key. The failed run may be stored as pending, and a replay with the old key would return 202 with that pending run instead of an answer.
  3. If the retry also returns internal_error, stop retrying and report both request_id values. Retrying in a loop does not help with this code.

Example

Log the request id, retry once with a new key, and surface the failure if it repeats (two attempts in total):
  • Request ids - send your own x-request-id and 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-Key and when to send a new one.
  • Problem codes - every code, its status, and whether a retry can help.