To ensure fair usage and maintain API performance, the One Codex API enforces a rate limit of 10 requests per second per client.

Limit Scope

The rate limit is shared across all API routes. For example, requests to both https://app.onecodex.com/api/v1/samples and https://app.onecodex.com/api/v1/analyses count toward the same 10 requests/second limit.

Exceeding the Limit

If your application exceeds the allowed request rate, the API will respond with an HTTP 429 Too Many Requests status code. No further requests will be processed until the rate falls back within the allowed threshold. EXAMPLE RESPONSE
HTTP/1.1 429 Too Many Requests
Content-Type: application/json

{
    "msg": "Rate limited.",
    "status": 429
}

Handling 429 Responses

Clients should implement a retry strategy, such as exponential backoff, to gracefully handle 429 responses and avoid overwhelming the API. We recommend monitoring your request rate and implementing safeguards in your integration to stay within the defined limits.
Our Python client library and command line client automatically retry requests when they receive a 429 (rate limit) response.