<!-- https://zerolog.ch/news/terminal-api-honest-errors -->
# Terminal API: calls without streaming reach their model again

2026-09-25 · Product

> Requests to a prefixed model without streaming ended in a bare 502. They now reach their provider, errors keep their real status, and a header switches rerouting off.

## What was broken

A request to `/api/cli/v1/chat/completions` with a model such as `openrouter/z-ai/glm-5.2:free` or `groq/openai/gpt-oss-120b` and `stream` set to false never reached OpenRouter or Groq. The model id went to our main pool, which does not know it, and the client got a 502 in under a second. Cloudflare replaces the body of a 502, so the reason never arrived. Streaming requests were fine. ZeroLog Code always streams, which is why this stayed hidden until a client sent requests without streaming.

The same path booked zero tokens for every `zerolog:free` request without streaming, and none of these errors showed up in our error telemetry.

## What changed

Requests without streaming now take the same route as streaming ones. A 404 from the provider stays a 404, a 429 stays a 429. When a provider fails, you get a 503 instead of a 502, and the header `X-ZeroLog-Upstream-Status` carries the status the provider really sent. Each of these errors is now counted in the telemetry. `zerolog:free` books the tokens the provider reported.

One more request of the same interface, the one that wakes a paired terminal session, stopped with an internal error because a function was not imported. It works again.

## Rerouting only if you want it

When a provider refuses, ZeroLog still answers with another model by default and names it in `X-ZeroLog-Served-Model`. If you want only the model you asked for, send `X-ZeroLog-Reroute: off`. You then get the provider's error, and for a 429 also its `Retry-After`.
