Test mode: payments go through Stripe test mode and are not real. Use test cards only.

Limits and Errors

The limits the relay applies and the answers a client sees when it hits one, for the REST API and for /wss.

Error shape

Most REST errors have this shape:

{"detail": "<text>"}
  • A validation error is 422 with detail as a list of {loc, msg, type} items.
  • Some errors from the application layer use {"error": "<text>"}.

Read the status code first and the text second: the text is for people.

Status codes

StatusMeaning
400The request is wrong for this state: a missing or wrong current_password or totp_code, an agent over the plan limit (Agent limit reached …)
401No token (API token required), an unknown or expired token (API token has expired.), a wrong password, or a missing 2FA code (2FA code required with X-2FA-Required: true)
403Allowed in principle, refused now: Account is disabled, a token type that cannot use the account API, Telegram not linked, an admin action that needs a fresh step-up (admin_reauth_required)
404No such object, or it is not yours
409A conflict: Agent with this ID already registered, a taken username, seats_full or quarter_budget_used on the beta, or secret_unreadable
413A preferences blob over 8 KiB
422The body does not validate
426GET /wss without a WebSocket upgrade
429A rate limit or a lockout; see below
502, 503, 504From the site's proxy: the relay answered badly, is down, or timed out

secret_unreadable (409) means the relay cannot decrypt a stored secret, usually because its encryption key changed. Ask an administrator to reset your 2FA, or reissue the agent's key ( Tokens ).

Rate limits

The limits are per client IP, as a token bucket (requests per second, burst). A refused request gets 429 and this body:

{"detail": "Rate limit exceeded"}

The headers of the answer:

  • X-RateLimit-Remaining
  • X-RateLimit-Reset
  • Retry-After
PresetRateBurstUsed by
Auth3 per second5Login, registration, password reset, 2FA and re-authentication endpoints, account deletion
Default10 per second50Agents, targets, profile, preferences, admin lists
Relaxed100 per second500Light read endpoints

Endpoints with no limit in the generated list (docs/api/rest-api.md of the relay) are not limited by IP. When Redis is down the limits fail open and the relay logs rate_limiter_fail_open.

Behind a reverse proxy the relay trusts X-Forwarded-For and X-Real-IP only from the peers named in these settings:

  • WAKELINK_FORWARDED_ALLOW_IPS
  • TRUSTED_PROXY_IPS
Warning
Set them, or every user shares the proxy's IP.

Lockouts

WhatRule
Wrong passwordThe fifth wrong password locks the account for 30 minutes, then 60, 90 and so on up to 24 hours
Wrong 2FA codeMore than five in 15 minutes: 429 until the window passes
Unknown tokenFive per hour from one IP: 429
/wss authenticationFive failures from one IP in 300 seconds: locked for 600 seconds

Plan limits

LimitWhere it shows
Agents per plan400 on POST /agents and POST /agents/virtual
Wakes per day on FreeWAKE_LIMIT on /wss

Numbers are on Plans .

WebSocket errors

Messages of this form on /wss:

{"type": "error", "code": "…", "error": "…"}
Code or textWhen
INVALID_BINARY_ENVELOPEThe binary message does not start with 0x02, a length and a route ID
INVALID_BINARY_FRAMEThe frame is not 0xAE 0x01, is shorter than 21 bytes or longer than 4096
INVALID_ROUTENo agent ID, or the connection is not signed in
ACCESS_DENIEDThe agent is not on your account
RATE_LIMITEDMore than 10 commands per minute for that agent; retry_after is 30
WAKE_LIMITThe Free daily wake limit; retry_after is the seconds until midnight UTC
AGENT_NOT_CONNECTEDThe agent has no relay connection; check Troubleshooting (agent offline)
Agent timeoutThe agent did not answer within 30 seconds
LIMIT_EXCEEDEDThe session passed 10000 requests; the connection closes with 1008
MESSAGE_TOO_LARGEThe message could not be read; the connection closes with 1009
Payload too largeA JSON relay payload over 4096 bytes

Authentication failures use auth_response with status: "failed" ( WebSocket ). For an offline agent see Troubleshooting .

Aegis errors

An agent drops a packet it cannot accept:

  • a bad authentication tag;
  • a replayed or too old sequence number;
  • an unknown session;
  • a sequence jump over 1000.

The Aegis library defines the codes E001 to E008, in this order:

  1. INVALID_PACKET
  2. AUTH_FAILED
  3. SEQ_OUT_OF_ORDER
  4. AEAD_AUTH_FAILED
  5. KEY_EXCHANGE_FAILED
  6. REPLAY_DETECTED
  7. TIMEOUT
  8. DEVICE_BUSY

A client that sees repeated failures should open a new session ( Aegis Wire Format ).

Continue reading