Mq
Package mq is queue and stream admin for your org: create them, watch them drain, ack what you pulled.
Package mq is queue and stream admin for your org: create them, watch them drain, ack what you pulled.
| Base URL | https://api.hanzo.ai |
| Operations | 15 |
| Auth | Authorization: Bearer $HANZO_API_KEY |
mq
GET /v1/mq/health
Reports whether the message plane behind this surface answers.
GET /v1/mq/info
Returns the broker's identity and the org's stream count.
DELETE /v1/mq/streams/{name}/messages/{seq}
Erases one message by sequence; the sequence gap remains.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | yes | Name is the stream name, from the path. |
seq | path | integer | yes | Seq is the message's stream sequence, from the path. |
GET /v1/mq/streams/{name}/messages
Reads stored messages without a consumer: by sequence, by newest on a subject, or walking a subject forward from a sequence.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | yes | Name is the stream name, from the path. |
seq | query | integer | — | Seq reads the message at this sequence (with next_by_subject: the walk's start). |
last_by_subject | query | string | — | LastBySubject reads the newest message on this org-relative subject. |
next_by_subject | query | string | — | NextBySubject walks forward from seq collecting messages on this org-relative subject (wildcards supported). |
limit | query | integer | — | Limit caps a next_by_subject walk (1–1000, default 100). |
POST /v1/mq/streams/{name}/purge
Removes messages from a stream, leaving its consumers in place.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | yes | Name is the stream name, from the path. |
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
filter | string | — | Filter purges only messages on this org-relative subject (wildcards supported). |
keep | integer | — | Keep retains that many newest messages. |
name | string | — | Name is the stream name, from the path. |
GET /v1/mq/streams/{name}
Returns one stream's configuration and live state.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | yes | Name is the stream name, from the path. |
PUT /v1/mq/streams/{name}
Reconfigures an existing stream; the path names the stream, and the immutable fields (storage, retention) must restate what they are.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | yes | Name is the stream name, unique within the org (alphanumeric, hyphens, underscores). |
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
max_age | string | — | MaxAge caps message age, e.g. |
max_bytes | integer | — | MaxBytes caps the stream's total stored bytes; -1 (default) is unlimited. |
max_msg_size | integer | — | MaxMsgSize caps one message's size in bytes; -1 (default) is the broker's limit. |
max_msgs | integer | — | MaxMsgs caps the number of stored messages; -1 (default) is unlimited. |
name | string | — | Name is the stream name, unique within the org (alphanumeric, hyphens, underscores). |
num_replicas | integer | — | Replicas is the number of stream replicas (1–5); this plane runs 1. |
retention | string | — | Retention is the retention policy: limits (default), interest, or workqueue. |
storage | string | — | Storage is the storage backend: file (default) or memory. |
subjects | string[] | — | Subjects are the org-relative subjects bound to this stream (wildcards supported). |
DELETE /v1/mq/streams/{name}
Removes a stream with all its messages and consumers. Irreversible.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | yes | Name is the stream name, from the path. |
POST /v1/mq/streams/{stream}/consumers/{name}/next
Pulls the consumer's next batch. Delivered messages are acknowledged on delivery — the broker will not redeliver what this call returns; an empty wait answers 408.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
stream | path | string | yes | Stream is the stream name, from the path. |
name | path | string | yes | Name is the consumer name, from the path. |
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
batch | integer | — | Batch is how many messages to pull (1–1000, default 1). |
expires | string | — | Expires is how long to wait for messages, e.g. |
name | string | — | Name is the consumer name, from the path. |
no_wait | boolean | — | NoWait answers immediately with whatever is available instead of waiting. |
stream | string | — | Stream is the stream name, from the path. |
GET /v1/mq/streams/{stream}/consumers/{name}
Returns one consumer's configuration and delivery state.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
stream | path | string | yes | Stream is the stream name, from the path. |
name | path | string | yes | Name is the consumer name, from the path. |
DELETE /v1/mq/streams/{stream}/consumers/{name}
Removes a consumer and its delivery state; unacknowledged messages stay in the stream.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
stream | path | string | yes | Stream is the stream name, from the path. |
name | path | string | yes | Name is the consumer name, from the path. |
GET /v1/mq/streams/{stream}/consumers
Returns a stream's consumers, name-ordered, with delivery state.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
stream | path | string | yes | Stream is the stream name, from the path. |
limit | query | integer | — | Limit caps the consumers returned (1–1000, default 100). |
offset | query | integer | — | Offset skips that many consumers, name-ordered. |
POST /v1/mq/streams/{stream}/consumers
Creates a durable pull consumer on a stream and returns it.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
stream | path | string | yes | Stream is the stream name, from the path. |
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
ack_policy | string | — | |
ack_wait | string | — | |
deliver_policy | string | — | |
description | string | — | |
durable_name | string | — | |
filter_subject | string | — | |
max_ack_pending | integer | — | |
max_deliver | integer | — | |
opt_start_seq | integer | — | |
opt_start_time | string | — | |
replay_policy | string | — | |
stream | string | — | Stream is the stream name, from the path. |
GET /v1/mq/streams
Returns the org's streams, name-ordered, with their live state.
| Parameter | 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. |
POST /v1/mq/streams
Creates a durable stream in the org's namespace and returns it.
Request body — application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
max_age | string | — | MaxAge caps message age, e.g. |
max_bytes | integer | — | MaxBytes caps the stream's total stored bytes; -1 (default) is unlimited. |
max_msg_size | integer | — | MaxMsgSize caps one message's size in bytes; -1 (default) is the broker's limit. |
max_msgs | integer | — | MaxMsgs caps the number of stored messages; -1 (default) is unlimited. |
name | string | — | Name is the stream name, unique within the org (alphanumeric, hyphens, underscores). |
num_replicas | integer | — | Replicas is the number of stream replicas (1–5); this plane runs 1. |
retention | string | — | Retention is the retention policy: limits (default), interest, or workqueue. |
storage | string | — | Storage is the storage backend: file (default) or memory. |
subjects | string[] | — | Subjects are the org-relative subjects bound to this stream (wildcards supported). |
How is this guide?
Models
Package ai is Hanzo AI — the model API on /v1 (/v1/chat/completions, /v1/messages, /v1/models and the rest of hanzoai/ai's surface) — mounted into a cloud binary with the money, ingest and telemetry…
Networks
Package zt mounts the Hanzo Cloud NETWORKING surface: the tenant's Hanzo Zero Trust footprint — overlay networks, their routers and mesh services — served as clean, org-scoped REST off the unified…