# Apertis Changelog: 2.2.152 — Feature Added

Canonical page: https://apertis.ai/changelog/2.2.152
Markdown mirror: https://apertis.ai/changelog/2.2.152.md
Version: 2.2.152
Title: Feature Added
Published: 2026-12-06
Category: feature

A streamed request whose first route answered empty used to hand your caller an empty stream; now it is retried on another route before any output reaches you, and only the attempt that answers is billed.

## Details

We built a retry for a streamed request whose first route answers 200, then has nothing to say. Until now your caller read an empty stream. Now an empty or broken first answer is retried on another route before any output reaches your caller, and your caller reads the stream of the route that answers. Apertis does this on Chat Completions, Messages and Responses, and only the attempt that answers is billed.

![A streamed chat completion whose first route answered 200 with an empty stream, answered in full by the next route](/changelog-media/2.2.149/empty-stream-retry-chat.jpg "demo:empty-stream-retry")

## Nothing to change in your request

Send the same streamed request as before. The retry happens before any of the first route's stream reaches you, so the stream you read is the answering route's:

```bash
curl -N https://api.apertis.ai/v1/chat/completions \
  -H "Authorization: Bearer $APERTIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-5.5","stream":true,"messages":[{"role":"user","content":"Say hello."}]}'
```

```text
data: {"id":"\<id\>","object":"chat.completion.chunk","created":\<ts\>,"model":"claude-sonnet-5.5","choices":[{"index":0,"delta":{"role":"assistant","content":"Hello"}}]}
data: {"id":"\<id\>","object":"chat.completion.chunk","created":\<ts\>,"model":"claude-sonnet-5.5","choices":[{"index":0,"delta":{"content":"!"},"finish_reason":"stop"}]}
data: [DONE]
```

`/v1/messages` and `/v1/responses` behave the same way with their own stream events.

![A streamed Messages request whose first route answered 200 with an empty stream, answered in full by the next route](/changelog-media/2.2.149/empty-stream-retry-messages.jpg)

## What counts as empty or broken

A route's first answer is retried when, before any output reaches you, it does one of these:

- The stream ends with no output.
- It sends an event that cannot be parsed.
- It closes without a terminal event.
- It sends an error event that is not about your request itself.

## When it applies

| Your request | What you get |
| --- | --- |
| A stream on `/v1/chat/completions`, `/v1/messages` or `/v1/responses` whose first answer is empty or broken before any output | The request is retried on another route, and you get that route's answer |
| A stream whose first answer carries output | Delivered byte for byte, as before |
| A stream that has already sent you any output | Never retried and never spliced: it reaches you as it is |
| A request that no other route can serve | Delivered as before, with no retry |
| A stream from a route the retry does not cover yet | Delivered as before, with no retry |
| A first answer that runs long before its first output | Delivered as before, with no retry |
| A request that names a stop sequence | Delivered as before, with no retry |
| A request that ends with a tool result | Delivered as before, with no retry |
| A web-search stream that has already shown that it is searching | Delivered as before, with no retry |

Only the attempt that answers is billed. Non-streaming Chat Completions requests got the same treatment earlier.
