Limits and quotas

Canonical AI Transport, mutable-message, history, presence-history, push, and capability-token limits.

4 min read
View .mdEdit on GitHub

This is the canonical server-side limit table for AI Transport and the features it builds on. Every row lists the config key (or a fixed constant), the default, and what a client sees when it hits the limit. Use it when you size a deployment, pick retention windows, or decode a rejection.

Limits fall into three groups:

  • Hard rejections stop a publish, mutation, or connection with an error code. The client must change what it sends.
  • Clamps silently reduce a request, such as a page size, to the allowed maximum.
  • Retention windows decide how far back history, versions, and recovery can reach. Exceeding them shows up later as a recovery or history gap, not as an immediate error.

AI Transport

LimitKey or constantDefaultWhen exceeded
Accumulated content per output messageai_transport.max_accumulated_message_bytes1048576 (1 MiB)Append rejected with 40009 payload_too_large. Start a new message.
Appends per messageai_transport.max_appends_per_message4096Append rejected with 40009.
Open streaming messages per channelai_transport.max_open_streaming_messages_per_channel1024New streaming create rejected with 40009.
Keys per transport or codec tierconstant32Publish rejected with 104001 ai_header_too_large.
Header key lengthconstant64 bytesPublish rejected with 104001.
Transport value lengthai_transport.max_transport_value_bytes256 bytesPublish rejected with 104001. Can only be raised.
steer-codec-message-ids value lengthai_transport.max_steer_codec_message_ids_bytes2048 bytesPublish rejected with 104001. Can only be raised.
Ordinary codec value lengthconstant256 bytesPublish rejected with 104001.
extras.ai.codec.providerMetadata lengthconstant8 KiBPublish rejected with 104001.
message_id on AI channelsconstant64 bytesHTTP publish rejected with 104001; an empty value is rejected with 104000.
Rollup windowsappend_rollup_window0, 20, 40, 100, 500Any other value fails the V2 WebSocket upgrade with HTTP 400.
Rollup defaultai_transport.rollup.default_window_ms40Node-local egress coalescing window.
Rollup orphan TTLai_transport.rollup.orphan_ttl_ms60000Stale stream claim/cancel threshold. The stream is closed with status=cancelled and error-code=orphan_timeout.

The three stream caps are checked inside the same version-store transaction as the mutation, so they hold across nodes and cannot be bypassed by racing appends.

Events, history, and versions

LimitKeyDefaultWhen exceeded
HTTP request bodyhttp_api.request_limit_in_mb10Whole request cap; the request is rejected.
Event payloadevent_limits.max_payload_in_kb100Publish rejected. App policy can lower the effective limit.
Event batchevent_limits.max_batch_size10Batch publish rejected.
Version history pageversioned_messages.max_page_size100Clamped; the server caps version pages.
Version retentionversioned_messages.retention_window_seconds00 means no expiry. Purged chains fall back to the raw history payload.
Version purge batchversioned_messages.purge_batch_size1000SQL/memory purge worker bound.
History pagehistory.max_page_size100Clamped. Client history over the WebSocket is additionally capped at 1000.
History retentionhistory.retention_window_seconds86400Older positions fail recovery with position_expired. Per-app/namespace policy can override.
History writer queuehistory.writer_queue_capacity4096Bounded writer queue.
Presence history pagepresence_history.max_page_size100Presence transition history, not current members.
Presence history retentionpresence_history.retention_window_seconds86400Durable or memory retention.

Presence

LimitKey or constantDefaultWhen exceeded
sockudo:presence_update member dataconstant1024 bytesUpdate rejected with 40009.
Presence updates per memberpresence.update_rate_limit_per_member_per_second10Update rejected by the client-event rate limiter.
V2 disconnect gracepresence.v2_ungraceful_timeout_seconds15After the grace window, the member is removed.
V1 disconnect gracepresence.ungraceful_timeout_seconds0Legacy immediate removal.

Capability tokens

LimitKey or constantDefaultWhen exceeded
Capability token sizeconstant8192 bytesAuthentication fails. HS256 JWT only.
Capability patterns per tokenconstant100Authentication fails.
Capability token lifetimeconstant24hiat to exp; longer tokens fail authentication.
Capability client_idconstant128 bytesRequired; authentication fails outside 1..=128.
Capability jticonstant128 bytesRequired; authentication fails outside 1..=128.
Clock skewconstant30 secondsTolerance applied to exp, nbf, and iat.
Expiry graceconstant30 secondsAfter sockudo:token_expired, the connection closes with 4009 unless refreshed.
Revocation memoryttl_seconds or expires_at on the request24hRevoked identities stay blocked for this long.

Push

LimitKeyDefaultNotes
Push fanout fast pathpush.fanout_fast_threshold10000Planning threshold.
Push shard sizepush.fanout_shard_size100000Channel fanout shard size.
Push acceptance quotapush.default_quotas.acceptance_rps100Per-app default quota.
Push inflight quotapush.default_quotas.inflight_max1000Per-app default.
Push status retentionpush.publish_status_ttl_days30Support/audit retention.
Push rule event filterpush_rules.event_filtermax 32 namesEach event name at most 200 bytes. Violations fail startup validation.
Push rule ratepush_rules.rate_limit_per_second100Per rule.

The machine-checked default block is in Configuration reference.

Next steps