---
title: "Live session stream"
url: https://hexelstudio.com/docs/api/titan-agent/agent/stream
---

# Live session stream

**GET** `/titan/agent/sessions/{id}/stream`

The caller is a leg of a durable session, with durable sessions on for its agent deployment; it reads every durable session of its organization, agent deployment and runtime principal acting for the same person as it (delegated_user, or no one for both; any other id is NOT_FOUND) and writes only its own (FORBIDDEN). Server-sent events: each event of the log after the cursor is one event named "event" whose id is its seq and whose data is its AgentSessionEvent JSON, in seq order; every subscriber sees the same events in the same order. The cursor is Last-Event-ID (a reconnect), else after_seq, else 0. The stream ends with an event named "end", data {"reason": ...}: reauthenticate (the runtime token expires), reconnect (after 5 minutes), session_held (the durable session is held or durable sessions are off) or unavailable; reconnect with the last id seen. Comment lines keep it open. Cache-Control from EventSource is accepted and ignored. Open streams are bounded per Gateway replica (32 per runtime principal, per person it acts for, 2048 in all); past either a new one is RATE_LIMITED.

## Path parameters

- `id: string`

  The durable session (dss_).

## Query parameters

- `after_seq: optional integer`

  Start after this seq when there is no Last-Event-ID; default 0.

## Headers

- `Authorization: string`

  `Bearer <token>`. Runtime identity token from the identity exchange. Through the public edge, device-bound callers (titand) and workloads of the deployment's attached customer Kubernetes clusters are served. A device-bound caller's requests also carry a Titan-Device-Proof over the path below /v1 (or below the cell prefix), i.e. the /titan/agent/... path; an attached cluster's carry none.

- `Accept: string`

  Exactly text/event-stream.

  One of: `"text/event-stream"`

- `Last-Event-ID: optional string`

  The id (seq) of the last event received: resume after it.

- `Cache-Control: optional string`

  Sent by EventSource; ignored.

- `Titan-Device-Proof: optional string`

  Per-request EdDSA device proof over method, received path, body digest, and token jti; required for a titan_device_key binding and rejected for a Kubernetes binding.

## Returns

`200` The event stream. (`string`)

## Errors

- `400` INVALID_REQUEST: a header outside the allowlist, a duplicate singleton or control character, framing, or a body/argument that fails strict JSON or the closed contract.
- `401` UNAUTHENTICATED: a missing or invalid runtime token, device proof, or mTLS peer, an ineligible session, or assurance below A2.
- `403` FORBIDDEN: a policy deny, a latched kill, or a restricted session; on the Session Store, a caller that is not a leg of a durable session, a write to another durable session, or summaries the session profile turns off; on swarm routes, a mission at its task or board key cap; no object detail.
- `404` NOT_FOUND: an unknown, hidden, or inaccessible capability or object, a query string, or a malformed id; on the Session Store also durable sessions off for the caller's agent deployment; on swarm routes also swarm coordination off for it, or another mission's task, key or session.
- `406` NOT_ACCEPTABLE: an Accept other than the exact media type(s).
- `413` PAYLOAD_TOO_LARGE: more than 32 counted headers, a header value over 4 KiB (Authorization 12 KiB), 24 KiB of headers, or an oversized body.
- `429` RATE_LIMITED: the per-runtime-principal rate or concurrency bound.
- `503` SERVICE_UNAVAILABLE: required local state, the store, the signer, audit capacity, or the executor path is unavailable before safe acceptance (on content access also: no Titan content store configured under full capture).

## Example

```bash
curl --request GET \
  --url 'https://api.hexelstudio.com/v1/titan/agent/sessions/{id}/stream' \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'Accept: ACCEPT'
```

### Response (200)

```json
"string"
```

### Response (400)

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "string",
    "request_id": "string",
    "retryable": false
  }
}
```

### Response (401)

```json
{
  "error": {
    "code": "UNAUTHENTICATED",
    "message": "string",
    "request_id": "string",
    "retryable": false
  }
}
```

### Response (403)

```json
{
  "error": {
    "code": "FORBIDDEN",
    "message": "string",
    "reason": "tool_permissions_organization",
    "request_id": "string",
    "retryable": false
  }
}
```

### Response (404)

```json
{
  "error": {
    "code": "NOT_FOUND",
    "message": "string",
    "request_id": "string",
    "retryable": false
  }
}
```

### Response (406)

```json
{
  "error": {
    "code": "NOT_ACCEPTABLE",
    "message": "string",
    "request_id": "string",
    "retryable": false
  }
}
```

### Response (413)

```json
{
  "error": {
    "code": "PAYLOAD_TOO_LARGE",
    "message": "string",
    "request_id": "string",
    "retryable": false
  }
}
```

### Response (429)

```json
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "string",
    "request_id": "string",
    "retryable": true
  }
}
```

### Response (503)

```json
{
  "error": {
    "code": "SERVICE_UNAVAILABLE",
    "message": "string",
    "request_id": "string",
    "retryable": true
  }
}
```
