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

# List streams

> List streams within a bucket with optional prefix filtering and pagination.

<ParamField path="bucket" type="string" required>
  Bucket ID. Must match `[a-z0-9_-]{4,64}`.
</ParamField>

<ParamField query="prefix" type="string" default="">
  Only return streams whose ID starts with this prefix.
</ParamField>

<ParamField query="after" type="string">
  Cursor for pagination. Return streams after this stream ID.
</ParamField>

<ParamField query="limit" type="number" default="1000">
  Maximum number of streams to return. Must be between 1 and 1000.
</ParamField>

## Response

| Status | Meaning                                  |
| ------ | ---------------------------------------- |
| `200`  | Streams listed.                          |
| `400`  | Invalid bucket ID or limit out of range. |
| `404`  | Bucket not found.                        |

<ResponseField name="bucket_id" type="string" required>
  The bucket identifier.
</ResponseField>

<ResponseField name="prefix" type="string" required>
  The prefix filter applied.
</ResponseField>

<ResponseField name="stream_count" type="number" required>
  Number of streams in this page.
</ResponseField>

<ResponseField name="streams" type="object[]" required>
  <Expandable title="properties">
    <ResponseField name="stream_id" type="string" required>
      Stream ID (local to the bucket).
    </ResponseField>

    <ResponseField name="status" type="string" required>
      Stream status: `open` or `closed`.
    </ResponseField>

    <ResponseField name="content_type" type="string" required>
      The stream's content type.
    </ResponseField>

    <ResponseField name="tail_offset" type="number" required>
      Current tail offset (next writable position).
    </ResponseField>

    <ResponseField name="created_at_ms" type="number" required>
      Creation timestamp in milliseconds since epoch.
    </ResponseField>

    <ResponseField name="last_write_at_ms" type="number" required>
      Last write timestamp in milliseconds since epoch.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="next_cursor" type="string">
  Cursor for the next page. Pass as `after` to fetch the next page.
</ResponseField>

<ResponseField name="has_more" type="boolean" required>
  Whether more streams exist beyond this page.
</ResponseField>

<RequestExample>
  ```bash All streams theme={null}
  curl 'https://stream.tonbo.dev/ds/demo/streams'
  ```

  ```bash With prefix and pagination theme={null}
  curl 'https://stream.tonbo.dev/ds/demo/streams?prefix=session-&limit=100'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "bucket_id": "demo",
    "prefix": "",
    "stream_count": 2,
    "streams": [
      {
        "stream_id": "hello",
        "status": "open",
        "content_type": "application/json",
        "tail_offset": 42,
        "created_at_ms": 1711234567890,
        "last_write_at_ms": 1711234599000
      }
    ],
    "next_cursor": "hello",
    "has_more": false
  }
  ```
</ResponseExample>
