> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fiveninelabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# model_unavailable

> Stream-terminal code — the engine's model call failed in transport. Retryable once the upstream recovers.

**Stream terminal · not an HTTP error.** This code arrives in the typed terminal
`error` event on the run's stream, when a run that started dies because the engine's
own model call failed in transport — auth, quota, an upstream outage. The run ends
with status `error`; only signed receipts settle and the rest of the reservation is
released.

## The shape

```json theme={null}
{ "phase": "error", "message": "model stream error: Forbidden", "code": "model_unavailable" }
```

`message` is prose for humans and may change; program against `code`. The same event
is the last entry of the durable log (`GET …/events`), so a missed stream still shows
the typed ending. Stream codes are an [open enum](/errors#stream-terminal-codes) —
handle an unknown code like [`internal`](/errors/internal).

## How to fix

* **Retry the run once the upstream recovers** — this is a transient transport
  failure on our side of the model seam, not a problem with your query.
* The money contract held: check the run's `spend_usd` — everything beyond signed
  receipts was released.
* If it persists, save the run id and contact support.

## Reproduce it

Rehearse the run-level `error` ending (typed terminal, reservation released) with
the [`FN_TEST_ERROR` sentinel](/guides/test-mode) — deterministic, \$0.
