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

# Streaming quotes

> A first price in tens of milliseconds, better ones as the search runs, then live updates as pools change.

Robinhood Chain, partner keys. Add `stream` to any [`/quote`](https://docs.route.fun/api-reference/quote) request and the response is a stream of
server-sent events instead of one JSON body.

| Parameter | Values | Meaning |
| - | - | - |
| `stream` | `1` | Progressive: the best plan so far at once, better ones as they are found, then a final event. The response ends. |
| `stream` | `live` | Progressive, then the stream stays open and sends `update` events when pools the quote depends on change. |
| `visible` | `0`, `1` | With `stream=live`: `0` makes it progressive only (for example a hidden browser tab). |
| `streamTx` | `changed` (default), `always` | With `stream=live` and `recipient`: whether every update carries a rebuilt transaction. |

All other `/quote` parameters work as usual, except `prefer`, `gasless` and vault zaps.

```bash theme={null}
curl -N -G "https://partners.route.fun/quote" \
  -H "Authorization: Bearer $ROUTE_API_KEY" \
  --data-urlencode "in=0x0000000000000000000000000000000000000000" \
  --data-urlencode "out=0x5fc5360d0400a0fd4f2af552add042d716f1d168" \
  --data-urlencode "amount=10000000000000000" \
  --data-urlencode "recipient=0xYourUserAddress" \
  --data-urlencode "stream=live"
```

## Events

Each event's `data` is a complete `/quote` response body plus a few fields.

| Event | When | Extra fields |
| - | - | - |
| `quote` | First plan, better plans, then the final one | `seq`, `stage` (`fast`, `shared`, `search`, `final`), `final` (`true` on the last), `elapsedMs` |
| `update` | `stream=live` only, after the final `quote` | `kind: "update"`, `stage` (`block`, `refresh`, `tx`), `block`, `seq` |
| `end` | The server closes the stream | `reason`, for example `idle` (no update for 60 s) or `lifetime` (1 hour) |

Lines starting with `:` are heartbeats; ignore them.

* Each `quote` event is strictly better than the previous one. Every stream has its final event within about 2 seconds.
* `update` events carry the current price and can be worse than the previous event: the market moved.
* With `recipient`, the first event can arrive priced but without a transaction (`txPending: true`). Its transaction follows in
  the next event, typically 10 to 30 ms later.
* With `streamTx=changed`, an update rebuilds the transaction only when the plan changed or the output moved more than 2 bps, at
  most once a second. Other updates are price-only: no `tx`, plus `txStale: true`, `txNetOut` and `txDeadline` for the
  transaction you already have.

**Sign the `tx` of the most recent event that has one.** For a transaction at the very latest price, use `streamTx=always` or
make a normal `/quote` request.

Errors found before the stream starts (bad parameters, limits, pool state not fresh) are ordinary JSON responses with their
usual status. A live stream counts against your key's [live stream cap](https://docs.route.fun/swaps/errors-and-limits.md#rate-limits).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.