Rate Limits
Understanding API rate limits and how to handle them
The Verity API uses rate limiting to ensure fair usage and maintain service quality for all users.
Rate Limit Tiers
| Plan | Requests/Minute | Monthly API Calls |
|---|---|---|
| Free | 10 | 500 |
| Starter | 100 | 5,000 |
| Professional | 300 | 25,000 |
| Enterprise | 1,000 | 100,000 |
Rate Limit Headers
Every API response includes headers to help you track your rate limit status:
| Header | Description |
|---|---|
X-RateLimit-Limit | Your rate limit per minute |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the limit resets |
Example headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1701878400Handling Rate Limits
When you exceed your rate limit, the API returns a 429 Too Many Requests response:
{
"success": false,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded. Try again in 30 seconds.",
"hint": "Consider upgrading to a higher plan for increased limits."
}
}The response includes a Retry-After header indicating how many seconds to wait:
Retry-After: 30Best Practices
Implement Exponential Backoff
When rate limited, wait and retry with increasing delays:
async function fetchWithRetry(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
const response = await fetch(url, options);
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After') || Math.pow(2, i);
await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
continue;
}
return response;
}
throw new Error('Max retries exceeded');
}Cache Responses
Many API responses can be cached to reduce the number of requests:
- Policy details change infrequently - cache for 1 hour
- Code lookup results - cache for 24 hours
- Use the
/policies/changesendpoint to check for updates
Use Batch Endpoints
Use the batch code lookup endpoint to look up multiple codes in a single request (up to 50):
# Instead of multiple requests...
curl /v1/codes/lookup?code=76942
curl /v1/codes/lookup?code=76943
curl /v1/codes/lookup?code=76944
# Use a single batch request
curl -X POST /v1/codes/batch \
-d '{"codes": ["76942", "76943", "76944"], "include": "rvu,policies"}'Expensive Operations
Some endpoints have higher rate limit costs:
| Endpoint | Cost Multiplier |
|---|---|
GET /v1/codes/lookup | 1x |
POST /v1/codes/batch | 1x per code |
GET /v1/policies | 1x |
GET /v1/policies/:id | 2x |
POST /v1/coverage/evaluate | 2x |
POST /v1/prior-auth/check | 3x |
POST /v1/policies/compare | 5x |
GET /v1/policies?mode=semantic | 10x |
For example, if your rate limit is 60 requests/minute and you make a policies/compare request (5x cost), it counts as 5 requests against your limit.
Upgrading Your Plan
If you consistently hit rate limits, consider upgrading your plan:
- Starter ($149/mo): 100 req/min, 5,000 calls/month
- Professional ($499/mo): 300 req/min, 25,000 calls/month, FHIR output, semantic search
- Enterprise ($3,000+/mo): 1,000 req/min, 100,000 calls/month, webhooks, SSO
Visit the Usage & Billing page in the Developer Console to upgrade.