Handle Rate Limits
Respect FreightCake API request limits and retry 429 responses safely.
FreightCake applies a one-minute sliding-window limit per API key. The limit depends on the organization's plan.
| Plan | Requests per minute |
|---|---|
| Free | 100 |
| Pro | 1,000 |
| Enterprise | 10,000 |
Rate-Limited Response
A limited request returns 429 Too Many Requests with a rate_limit_error envelope and a
Retry-After header.
{
"error": {
"type": "rate_limit_error",
"message": "Too many requests"
}
}Retry Strategy
- Read
Retry-After. - Wait at least that many seconds.
- Retry idempotent requests with exponential backoff and jitter.
- Reuse the same
Idempotency-Keywhen retrying a mutation.
The TypeScript SDK retries 429 and 5xx responses up to maxRetries times by default.
const freightcake = new FreightCake({
apiKey: process.env.FREIGHTCAKE_API_KEY!,
maxRetries: 3,
})