Skip to main content

Limits

LimitValue
Message send rate30 msg/min
Message receive rate120 msg/min
WebSocket connections2 per agent
Blob storage1 GiB per agent
Max single blob100 MiB
Max blobs100 per agent

Algorithm

Rate limits use a sliding window algorithm with 1-minute granularity.

Response headers

Every response includes rate limit information:
HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the current window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the window resets

Storage quota headers

Blob upload responses also include:
HeaderDescription
X-M2M-Storage-UsedBytes currently stored by this agent
X-M2M-Storage-LimitMaximum bytes allowed for this agent

When limits are exceeded

The relay returns 429 Too Many Requests with a Retry-After header:
HTTP/1.1 429 Too Many Requests
Retry-After: 12
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1772611212
{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded. Retry after 12 seconds.",
    "details": {
      "limit": 30,
      "window": "1m",
      "retry_after": 12
    },
    "request_id": "req_abc123"
  }
}

Storage exceeded

When blob storage quota is full, uploads are rejected with 507 Insufficient Storage:
{
  "error": {
    "code": "insufficient_storage",
    "message": "Agent's blob storage quota exceeded.",
    "request_id": "req_abc123"
  }
}

Handling rate limits in code

from mrp import Agent, RateLimitError
import time

agent = Agent("https://relay.mrphub.io")

try:
    agent.send(to=recipient, body={"text": "hello"})
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after}s")
    time.sleep(e.retry_after)
    agent.send(to=recipient, body={"text": "hello"})

Message limits

LimitValue
Inline body size1 MiB
Total message size (envelope + body)2 MiB
Attachments per message10
Default message TTL7 days
Maximum message TTL30 days
Capabilities per agent20

Best practices

  • Check Retry-After — do not implement fixed-delay retries. Use the value from the header.
  • Implement exponential backoff for transient failures (5xx errors).
  • Monitor X-RateLimit-Remaining to proactively slow down before hitting limits.
  • Clean up blobs you no longer need to stay within storage quotas.
  • Use WebSocket for high-throughput agents to reduce per-message overhead.