# List stream

URL: https://docs.hanzo.ai/docs/openapi/mq/get-mq-stream

> Returns the org's streams, name-ordered, with their live state.

`GET /v1/mq/stream`

> [MQ →](https://docs.hanzo.ai/docs/openapi/mq) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                        |
| ------------- | -------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/mq/stream`    |
| **Method**    | `GET`                                  |
| **Operation** | `get_mq_stream`                        |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY` |

Returns the org's streams, name-ordered, with their live state.

## Request

2 fields.

| Field    | In    | Type    | Required | Description                                            |
| -------- | ----- | ------- | -------- | ------------------------------------------------------ |
| `limit`  | query | integer | —        | Limit caps the streams returned (1–1000, default 100). |
| `offset` | query | integer | —        | Offset skips that many streams, name-ordered.          |

## Response

| Status    | Body            | Meaning |
| --------- | --------------- | ------- |
| `200`     | mq.Streams      | ok      |
| `default` | problem-details | refused |

`200` body — 24 fields.

| Field                            | In   | Type               | Always | Description                                                                          |
| -------------------------------- | ---- | ------------------ | ------ | ------------------------------------------------------------------------------------ |
| `streams`                        | body | mq.Stream\[]       | —      | Streams is the page, ordered by name.                                                |
| `streams[].config`               | body | mq.Config          | —      |                                                                                      |
| `streams[].config.max_age`       | body | string             | —      | MaxAge caps message age, e.g. "24h" or "7d"; "0" (default) is unlimited.             |
| `streams[].config.max_bytes`     | body | integer (int64)    | —      | MaxBytes caps the stream's total stored bytes; -1 (default) is unlimited.            |
| `streams[].config.max_msg_size`  | body | integer (int32)    | —      | MaxMsgSize caps one message's size in bytes; -1 (default) is the broker's limit.     |
| `streams[].config.max_msgs`      | body | integer (int64)    | —      | MaxMsgs caps the number of stored messages; -1 (default) is unlimited.               |
| `streams[].config.name`          | body | string             | —      | Name is the stream name, unique within the org (alphanumeric, hyphens, underscores). |
| `streams[].config.num_replicas`  | body | integer (int64)    | —      | Replicas is the number of stream replicas (1–5); this plane runs 1.                  |
| `streams[].config.retention`     | body | string             | —      | Retention is the retention policy: limits (default), interest, or workqueue.         |
| `streams[].config.storage`       | body | string             | —      | Storage is the storage backend: file (default) or memory.                            |
| `streams[].config.subjects`      | body | string\[]          | —      | Subjects are the org-relative subjects bound to this stream (wildcards supported).   |
| `streams[].created`              | body | string (date-time) | —      | Created is when the stream was created.                                              |
| `streams[].name`                 | body | string             | —      | Name is the stream name within the org.                                              |
| `streams[].state`                | body | mq.State           | —      |                                                                                      |
| `streams[].state.bytes`          | body | integer (uint64)   | —      | Bytes is the total stored size.                                                      |
| `streams[].state.consumer_count` | body | integer (int64)    | —      | Consumers is the number of consumers attached to this stream.                        |
| `streams[].state.first_seq`      | body | integer (uint64)   | —      | FirstSeq is the sequence of the first stored message.                                |
| `streams[].state.first_ts`       | body | string (date-time) | —      | FirstTS is the timestamp of the first stored message.                                |
| `streams[].state.last_seq`       | body | integer (uint64)   | —      | LastSeq is the sequence of the last stored message.                                  |
| `streams[].state.last_ts`        | body | string (date-time) | —      | LastTS is the timestamp of the last stored message.                                  |
| `streams[].state.messages`       | body | integer (uint64)   | —      | Messages is the number of messages currently stored.                                 |
| `streams[].state.num_deleted`    | body | integer (int64)    | —      | Deleted is the number of deleted messages (sequence gaps).                           |
| `streams[].state.num_subjects`   | body | integer (uint64)   | —      | Subjects is the number of distinct subjects stored.                                  |
| `total`                          | body | integer (int64)    | —      | Total is the org's stream count before paging.                                       |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo mq stream list
```

**SDK**

**.ts**

```ts
import { Configuration, MqApi } from 'hanzoai';

const api = new MqApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getMqStream();
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import MqApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = MqApi(client).get_mq_stream()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.MqAPI.GetMqStream(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, mq_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = mq_api::get_mq_stream(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.MqApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new MqApi(client).getMqStream();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/mq/stream \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

Tool `mq`, op `get_mq_stream` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "mq",
         "arguments": {
           "op": "get_mq_stream",
           "input": {}
         }
       }
     }'
```

---

[MQ API](https://docs.hanzo.ai/docs/openapi/mq) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
