API Rate Limits
Understanding and working with API quotas.
To ensure the stability and performance of our platform, Open Ledger implements rate limits on API requests. This guide explains how our rate limiting works, how to monitor your usage, and best practices for optimizing your integration.
Rate Limit Structure
Open Ledger uses a tiered rate limiting system based on your plan type and specific endpoints:
Rate limits vary by environment to accommodate different testing and production needs:
Rate Limit Categories
Rate limits are applied in three primary categories:
Total API requests across all endpoints. This is the broadest limit.
Requests that create, update, or delete resources (POST, PUT, PATCH, DELETE).
Requests that read resources without modifying them (GET).
Additionally, some specific endpoints have their own dedicated rate limits:
Rate Limit Headers
To help you monitor your rate limit usage, Open Ledger includes special headers in all API responses:
Example Headers
We recommend monitoring these headers in your API integration to track your usage and avoid hitting rate limits.
Rate Limit Errors
When you exceed a rate limit, the API will respond with a 429 Too Many Requests
HTTP status code and the following error response:
The response includes a retry_after
value (in seconds) indicating how long you should wait before retrying the request. The API also includes a Retry-After
header with the same value.
Monitoring Your Rate Limit Usage
You can monitor your rate limit usage in several ways:
The Open Ledger Developer Dashboard provides real-time and historical views of your API usage and rate limit status.
Track the rate limit headers in your API responses to monitor usage in real-time from your application.
Use the /v1/rate_limits
endpoint to get comprehensive information about
your current rate limits and usage.
Download monthly usage reports from the Developer Dashboard to analyze your API consumption patterns.
Using the Rate Limit API
You can query your current rate limit status using the Rate Limit API:
Example: Implementing a Robust Rate Limit Handler
Here’s a complete example of a robust rate limit handler using our JavaScript SDK:
Concurrency Limits
In addition to rate limits, Open Ledger also enforces concurrency limits on certain operations. These limit how many simultaneous requests of a certain type can be processed:
When you exceed a concurrency limit, the API will respond with the same 429 Too Many Requests
status code, but with a different error code: