API v1
Rate Limits & Errors
Request limits, expected status codes, and retry behavior.
This page is modeled after common API docs patterns: one place for limits, errors, and operational behavior.
Rate limits
Tokens API enforces per-key limits. If a key exceeds allowed throughput or quota, the API returns 429.
Practical guidance:
- Treat
429as retryable. - Use exponential backoff with jitter.
- Avoid unbounded parallel fan-out.
- Cache data where possible.
Quota behavior
Platform keys can also have monthly quotas. Exceeding quota also returns 429.
Error envelope
Platform endpoints use a stable error shape:
{
"error": {
"_tag": "BadRequestError",
"message": "Invalid mint",
"details": "..."
}
}details is optional.
Common status codes
400Bad request (invalid query/body/params)401Unauthorized (missing/invalid API key)403Forbidden (missing required scopes)404Not found (unknown resource or mapping)429Rate-limited or quota exceeded500Internal server error
Retry matrix
- Retry:
429, transient5xx - Do not retry without changes:
400,401,403,404
TypeScript retry example
export async function fetchWithRetry(url: string, init: RequestInit, maxRetries = 4): Promise<Response> {
let attempt = 0;
while (true) {
const res = await fetch(url, init);
if (res.ok) return res;
const retryable = res.status === 429 || (res.status >= 500 && res.status < 600);
if (!retryable || attempt >= maxRetries) return res;
const base = 250 * 2 ** attempt;
const jitter = Math.floor(Math.random() * 150);
await new Promise(resolve => setTimeout(resolve, base + jitter));
attempt += 1;
}
}