Getting started
Rate limits
Each key can make 120 requests a minute, and every response says how many are left.
Limits
A key can make 120 requests a minute, on every endpoint together. Over it, the API answers 429 with the code rate_limit_exceeded and a Retry-After header.
Rate limit headers
Every response carries the state of the key's minute.
| Header | Meaning |
|---|---|
RateLimit-Limit | Requests allowed in a minute, 120. |
RateLimit-Remaining | Requests left in the current minute. |
RateLimit-Reset | Seconds until the count starts again. |
Retry-After | On a 429 only, seconds to wait before trying again. |
Headers
HTTP/1.1 429 Too Many Requests
Content-Type: application/json
RateLimit-Limit: 120
RateLimit-Remaining: 0
RateLimit-Reset: 17
Retry-After: 17
Request-Id: req_3Vb8YzC1dF6hJ0sWuA7kQ2mXResponse429
{
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Too many requests. This key can make 120 requests a minute.",
"request_id": "req_3Vb8YzC1dF6hJ0sWuA7kQ2mX",
"doc_url": "https://okaymate.ai/docs/errors#rate_limit_exceeded"
}
}Handle a 429
Wait for Retry-After seconds, then send the same request again.
- Spread big jobs over time instead of sending them in bursts.
- Read
RateLimit-Remainingto slow down before you reach zero. - Webhooks push events to you, so you never spend requests polling for new messages.
# curl waits for Retry-After, then tries again
curl --retry 5 https://okaymate.ai/api/v1/leads \
-H "Authorization: Bearer $OKAYMATE_API_KEY"