Skip to main content
Version: Next

Rate Limiting

API requests made with API Keys are rate-limited to protect system stability and ensure fair usage across all integrations.

Rate limiting uses a token bucket algorithm. Each API Key has its own bucket that starts full and refills at a constant rate. Every request consumes one or more tokens depending on the endpoint. When the bucket is empty or does not have enough tokens for the requested operation, the request is rejected until enough tokens refill.


Default Limits​

ParameterValue
Bucket size60 tokens
Refill rate5 tokens per second
Full refill time12 seconds

These values apply per API Key. Each key has its own independent bucket - one key exhausting its limit does not affect others.


Token Cost per Request​

Each request consumes tokens from the bucket based on the HTTP method:

MethodDefault cost
GET1 token
POST2 tokens
PUT2 tokens
PATCH2 tokens
DELETE2 tokens

Some endpoints have a higher cost to reflect their resource intensity. For example, creating a tenant costs 30 tokens while creating a DID costs 2 tokens. Every endpoint in the API Reference shows its token cost with an intensity label:

LabelToken cost
Low0–2
Medium3–10
High11+

Response Headers​

Every rate-limited response includes these headers:

HeaderDescriptionExample
RateLimit-LimitMaximum bucket size60
RateLimit-PolicyLimit and window in seconds60;w=12
RateLimit-RemainingTokens remaining after this request42

When a request is rejected, the response also includes:

HeaderDescriptionExample
Retry-AfterMinimum seconds to wait before retrying1

Rejected Requests​

When the bucket does not have enough tokens, the API returns:

HTTP/1.1 429 Too Many Requests
Retry-After: 1
RateLimit-Limit: 60
RateLimit-Policy: 60;w=12
RateLimit-Remaining: 0
Content-Type: application/json
{
"code": 40029,
"description": "Too many requests."
}
  • Retry-After — the minimum number of seconds to wait before the bucket has enough tokens for your request. Retrying before this time will always fail.
  • RateLimit-Limit — the maximum number of tokens your bucket can hold (the bucket size).
  • RateLimit-Policy — the bucket size and the full refill window in seconds. 60;w=12 means 60 tokens with a 12-second window to refill from empty to full.
  • RateLimit-Remaining — how many tokens are left in your bucket. When this reaches 0, subsequent requests will be rejected until tokens refill.

Best Practices​

  • Check RateLimit-Remaining before making requests in tight loops. If remaining tokens are low, slow down proactively instead of waiting for a 429.
  • Respect Retry-After on rejected requests. Retrying immediately will keep failing and waste time.
  • Spread requests over time instead of sending large bursts. The bucket refills continuously, so steady request patterns are more efficient than periodic spikes.
  • Batch where supported. A single batch endpoint call is more token-efficient than multiple individual calls, even if the batch endpoint has a higher per-request cost.