Checking your current quota
Callclient.getRateLimitInfo() at any point to read the current quota state. It returns null until at least one API request has been made in the current session.
getRateLimitInfo() always reflects the most recent response.
Listening for quota updates
Useclient.onRateLimitUpdate(callback) to register a callback that fires after every API call. This lets you react to quota changes — for example, logging a warning when you’re running low or pausing work when the limit is nearly exhausted.
{ remaining, limit, resetTime } object as getRateLimitInfo().
How the SDK handles rate limit responses
When the API returns a429 Too Many Requests response, the SDK:
Reads the Retry-After header
The API includes a
Retry-After header specifying how many seconds to wait before retrying.Waits the specified duration
The SDK pauses for the full
Retry-After duration, overriding the configured retryDelay.The number of retry attempts is controlled by
maxRetries in your ClientConfig (default: 3). If you expect to frequently hit rate limits, increase maxRetries or add delays between calls.Querying per-endpoint rate limits
The API exposes detailed per-endpoint rate limit information through a dedicated endpoint. Useclient.api.rateLimits() to fetch it:
Slowing down auto-pagination
When you paginate through large datasets withfor await...of, the SDK makes one API request per page. For a dataset of 5,000 items with a page size of 50, that’s 100 requests — almost a sixth of your hourly quota in a single loop.
Use the pageDelay option on any list() call to add a wait between page fetches:
Rate limit reference
| Property | Value |
|---|---|
| Requests per hour | 600 |
| Reset window | Rolling 1-hour window |
| Retry behavior | Automatic, respects Retry-After header |
| Error type when exhausted | SWCError with retryable: true |
| SDK method to check quota | client.getRateLimitInfo() |
| SDK method to listen for updates | client.onRateLimitUpdate(callback) |
| Per-endpoint limits | client.api.rateLimits() |
Next steps
Pagination
Control page size and add delays between auto-pagination fetches.
Error handling
Understand how the SDK retries rate limit errors and when it gives up.
Client modes
Configure
maxRetries and retryDelay at client construction time.Quickstart
See pagination and rate limit awareness in a complete example.