> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rydhm.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rydhm.ai/_mcp/server.

# Stream the reply

GET https://api.rydhm.ai/v1/chat/conversations/{id}/stream

Server-sent events: `sources`, `delta` (text), `tool_call`, `tool_result`, `message` (the whole reply), `done`, `error`. Each reply is a model call, metered as chat tokens.

Needs the chat:write scope. A key without it gets 403 insufficient_scope. Routes not in this reference cannot be called with a key at all (403 not_available_to_api_keys).

Reference: https://docs.rydhm.ai/api-reference/conversations/stream

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `id` (string, required) — The conversation id.

## Response

### 200

A server-sent event stream of reply frames; it ends after `done` or `error`.

- Streaming response of `ChatFrame`.
- `type`: `sources` (sources)
  - `count` (integer, required)
  - `items` (list of ChatFrameSourcesItemsItems, optional) — Absent when the reply uses no knowledge.
- `type`: `delta` (delta)
  - `content` (string, required)
- `type`: `tool_call` (tool_call)
  - `args` (map from string to any, required)
  - `id` (string, required)
  - `label` (string, required)
- `type`: `tool_result` (tool_result)
  - `id` (string, required)
  - `ms` (integer, required) — How long the call took.
  - `ok` (boolean, required)
  - `preview` (string, required) — The start of the result (up to 400 characters).
- `type`: `message` (message)
  - `content` (string, required)
  - `id` (string, required)
  - `role` ("agent", required)
- `type`: `done` (done)
- `type`: `error` (error)
  - `message` (string, required)

## Errors

### 401 Unauthorized Error

The key is missing, not valid, disabled or expired (error: invalid_api_key, api_key_disabled, api_key_expired).

- `statusCode` (integer, required)
- `message` (string, required)
- `error` (string, optional) — A stable code such as insufficient_scope, expert_not_allowed, rate_limited, plan_limit, payment_required.
- `code` (string, optional) — The stable code on the refusals that carry it here instead of in `error`: stale_edit (409 on an expert save).
- `requestId` (string, optional) — The X-Request-Id of the call, to quote to support.
- `upgradeHint` (ErrorUpgradeHint, optional) — On 402 payment_required and 403 plan_limit: what fixes it.
- `requiredScopes` (list of string, optional) — On 403 insufficient_scope: what the route needs.
- `missingScopes` (list of string, optional)
- `retryAfterSeconds` (integer, optional) — On 429: how long to wait.

### 403 Forbidden Error

The key lacks a scope (insufficient_scope), may not use this expert (expert_not_allowed), or the route is session-only (not_available_to_api_keys).

- `statusCode` (integer, required)
- `message` (string, required)
- `error` (string, optional) — A stable code such as insufficient_scope, expert_not_allowed, rate_limited, plan_limit, payment_required.
- `code` (string, optional) — The stable code on the refusals that carry it here instead of in `error`: stale_edit (409 on an expert save).
- `requestId` (string, optional) — The X-Request-Id of the call, to quote to support.
- `upgradeHint` (ErrorUpgradeHint, optional) — On 402 payment_required and 403 plan_limit: what fixes it.
- `requiredScopes` (list of string, optional) — On 403 insufficient_scope: what the route needs.
- `missingScopes` (list of string, optional)
- `retryAfterSeconds` (integer, optional) — On 429: how long to wait.

### 429 Too Many Requests Error

Rate limited; wait Retry-After seconds.

- `statusCode` (integer, required)
- `message` (string, required)
- `error` (string, optional) — A stable code such as insufficient_scope, expert_not_allowed, rate_limited, plan_limit, payment_required.
- `code` (string, optional) — The stable code on the refusals that carry it here instead of in `error`: stale_edit (409 on an expert save).
- `requestId` (string, optional) — The X-Request-Id of the call, to quote to support.
- `upgradeHint` (ErrorUpgradeHint, optional) — On 402 payment_required and 403 plan_limit: what fixes it.
- `requiredScopes` (list of string, optional) — On 403 insufficient_scope: what the route needs.
- `missingScopes` (list of string, optional)
- `retryAfterSeconds` (integer, optional) — On 429: how long to wait.

## Types

### ChatFrameSourcesItemsItems

- `documentId` (string, required)
- `filename` (string, required) — A filename, an FAQ title or a page title.
- `kind` (enum, required)
  - Allowed values: `text`, `faq`, `page`
- `ord` (integer, required) — Position of the passage within its document (0-based).
- `sourceUrl` (string, optional, nullable) — The page address, for page documents.
- `question` (string, optional, nullable) — The matched question, for FAQ documents.

### ErrorUpgradeHint

On 402 payment_required and 403 plan_limit: what fixes it.

- `action` (enum, optional)
  - Allowed values: `top_up`, `upgrade`, `contact`
- `planCode` (string, optional) — The smallest plan that allows it, when action is upgrade.
- `href` (string, optional) — Where to go in the app.

## Examples

**SDK Code**

```python
import requests

url = "https://api.rydhm.ai/v1/chat/conversations/id/stream"

headers = {"Authorization": "Bearer <apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.rydhm.ai/v1/chat/conversations/id/stream';
const options = {method: 'GET', headers: {Authorization: 'Bearer <apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```