Skip to main content
provider_malformed_response means the model answered, but its output could not be decoded into a valid result. Read this page when a run fails with this code, and note that unlike most 503s, this one is billed.

What happened

Route: POST /v1/runs. The model service returned a response OpenType could not decode into an answer. For a decision run, that includes a probability or confidence that is not a finite number between 0 and 1. Every provider_* code has the same message, “the provider call failed”. Branch on code, never on the message. The message never contains model output. The call is billed. The model served it, so the run is settled as failed at the cost it consumed, and its cost appears in GET /v1/usage/ledger. A replay with the same Idempotency-Key returns 200 with "state": "failed"; it does not run again and is not charged again.

How to fix

  1. Log the request_id, and report it: this code points to a problem on the service side.
  2. Retry with a new Idempotency-Key. The old key replays the failed run. The new run is billed like any other.
  3. Do not retry in a loop. If the same request fails this way twice, stop and report both request_id values, so you are not billed for repeated failures.

Example

A retry with a new key, capped at two attempts, since each failed attempt is billed:
  • Usage reporting - find the billed attempt in the ledger.
  • Idempotency - when to reuse an Idempotency-Key and when to send a new one.
  • Error handling - a status-to-action table and a retry helper for every error.
  • Request ids - send your own x-request-id and quote it when you report a problem.
  • Problem codes - every code, its status, and whether a retry can help.