> For the complete documentation index, see [llms.txt](https://docs.nexus.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexus.xyz/api-reference/websocket/connect-stream.md).

# GET /stream

Public WebSocket stream (legacy).

`operationId`: `connectStream`

**Authentication:** none declared, and the contract declares no document-level default — this operation carries its own signature in the request body. See the description above.

Legacy public-only WebSocket endpoint. Prefer GET /ws which also supports per-account channels. **No token is required.** Token auth was removed from this endpoint in ENG-3128 — the token store was per-instance, so a token minted on one instance was unknown to another during a rolling deploy and the upgrade failed with a spurious 401. The upgrade is served unauthenticated on purpose: this channel carries only public market data (trades, book, stats) and never per-account data. `security` being absent above is therefore accurate, and this sentence used to contradict it. Unlike /ws, the protocol is a single untagged subscribe message listing channels:

```json
{"subscribe": ["trades:*", "book:BTC-USDX-PERP", "stats"]}
```

Channels: `trades:*` / `trades:{market_id}`, `book:*` / `book:{market_id}`, `stats`.

## Parameters

| Name    | In    | Type     | Required | Description                            |
| ------- | ----- | -------- | -------- | -------------------------------------- |
| `token` | query | `string` | Yes      | Short-lived token from POST /ws-tokens |

## Responses

| Status | Body                     | Meaning                                  |
| ------ | ------------------------ | ---------------------------------------- |
| `101`  | — *(no schema declared)* | Switching Protocols — WebSocket upgrade. |

## Example

```bash
curl -X GET 'https://exchange.nexus.xyz/api/exchange/stream'
```

***

<sub>Generated from</sub> <sub></sub><sub>`eng/apps/exchange/api/openapi.json`</sub> <sub></sub><sub>(spec</sub> <sub></sub><sub>`0.9.27`</sub><sub>). Do not edit by hand — regenerate with</sub> <sub></sub><sub>`python3 product/docs/tools/api-reference/generate.py`</sub><sub>. Hand-authored context lives in the Guides pages.</sub>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nexus.xyz/api-reference/websocket/connect-stream.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
