Rate limits

How Postkub admits API key requests - per-key request windows, verification gates, and fair-use publication caps.

Updated

Open in ClaudeOpen in ChatGPT
On this page

Rate limits in this page are Postkub's own admission controls for API keys. They are not social platform quotas: provider-side limits are handled inside Postkub, and provider backoff signals always win over fixed retry intervals.

Per-key request rate

Every authenticated key request passes a fixed one-minute window counted per key. The window key includes the key's revision, so rotating a key immediately starts a fresh window. The limit comes from the workspace's rateLimitRpm system setting; when an operator has not changed it, the default is 120 requests per minute per key.

Exceeding the window returns a retryable 429:

{
  "error": {
    "code": "RATE_LIMITED",
    "message": "API key request rate exceeded; retry after the indicated delay",
    "details": { "retryAfterMs": 23000 },
    "retryable": true
  },
  "requestId": "0e5c3a1b-8d2f-4b6a-9c3e-5f1a7b2d4c6e"
}

details.retryAfterMs is the time left until the current window resets, in milliseconds. Wait that long, then repeat the identical request with the same Idempotency-Key - see Idempotency and recovery.

If the rate-limiting service itself is unavailable, key requests fail closed with 503 RATE_LIMIT_UNAVAILABLE (retryable: true) rather than running unbounded. Read your key's configured limit and recent usage from the owner dashboard's API key usage view, or the owner-session endpoint GET /api/v1/owner/api-keys/usage.

The key verification gate

Before Postkub can authenticate you, it has to verify your key's secret. To bound that work per source, unauthenticated attempts are counted per peer IP (30 per minute) and per key prefix (10 per minute). Exceeding either returns:

{
  "error": {
    "code": "KEY_ADMISSION_LIMITED",
    "message": "Too many API key verification attempts from this address or key prefix; retry after the indicated delay",
    "details": { "retryAfterMs": 41000 },
    "retryable": true
  },
  "requestId": null
}

Practical consequences:

  • Successful requests release their slot, so a healthy client with one valid key does not lock itself out.
  • Repeated requests with invalid or fabricated tokens burn your address's window. Never guess keys.
  • If you run many clients behind one proxy, they share one IP window - keep the request rate per key modest.

Fair-use publication caps

Publishing and scheduling add per-account caps enforced at acceptance, on top of the request rate. Hitting one returns 429 with a code that names the cap:

CodeCap
PUBLICATION_CAPACITY_EXCEEDEDDaily publication capacity for the selected UTC day is exhausted
ACCOUNT_QUEUE_LIMIT_EXCEEDEDActive publications per account - 10 on the free plan, 2,000 on paid plans
PLATFORM_DAILY_LIMIT_EXCEEDEDPer-account daily publishing ceiling per platform (UTC day)

The per-platform daily ceilings are anti-spam defaults, enforced per account per UTC day: facebook 35, instagram 50, x 50, linkedin 50, threads 250, tiktok 25, youtube 6; platforms without a dedicated value use 50. These are acceptance caps on the Postkub side, not platform guarantees, and they can be tuned by the operator.

These caps are not errors you can retry around: PUBLICATION_CAPACITY_EXCEEDED and PLATFORM_DAILY_LIMIT_EXCEEDED clear on the next UTC day, and ACCOUNT_QUEUE_LIMIT_EXCEEDED clears as the account's queue drains.

Reading headroom

The 429 responses are today's headroom signal: details.retryAfterMs tells you exactly when the window resets. There is no other in-band headroom API for keys yet.

Warning

The standard RateLimit and RateLimit-Policy response headers are not returned by the API yet. The CLI and this documentation reserve the behavior below for when those headers arrive, so treat it as planned rather than available.

Reporting in the CLI

The Postkub CLI surfaces rate-limit information in two places:

  • postkub doctor --verbose includes an admission-rate-limit check and prints the RateLimit and RateLimit-Policy values when the API returns them.
  • Any command run with --verbose prints a rate-limit: line to stderr with the same headers.

Run postkub context rate-limits to print this guidance inside your agent's context. The CLI itself is preview and not yet published; see CLI for how to run it from the repository. Avoid parallel bursts when headroom is low, and let the CLI's --wait style polling rather than tight retry loops absorb delays.