Response shape
All error responses share the same JSON envelope:
error — Human-readable message, or (for Zod validation failures) an array of issue objects ({ path, message, code, ... }).
request_id — Server-side correlation id. Include this when reporting issues to support.
details — Optional. Present on typed errors (e.g. schema validation or invalid output) — see the table below.
Always check request_id first when triaging — it’s the fastest way to pull the full server-side log for the failed call.
Status codes
400 — FAILED status payload
When a request reaches a terminal FAILED state, GET /{owner}/{model}/requests/{id}/status returns HTTP 400 with the same createRequestResponse shape you’d get on success, including an error field:
Treat the 400 + status: "FAILED" combination as a terminal failure — do not retry the same request id.
422 — schema validation failure
When the upstream provider returns output that doesn’t match the model’s declared response schema, you get HTTP 422 with the regular getResultResponse body plus details.code === "INVALID_OUTPUT":
This typically signals a provider regression. Surface the message to the user and report the request_id — the call has already been billed-normalized as failed and you will not be charged.
Handling errors in client code
Never retry on 400 (validation), 401, 402, 403, 404, or 422 — these are deterministic failures. Retry only on 429 (with backoff) and transient 5xx.