TOKI
Guides

Rate Limits

Understand TOKI's rate limiting policies and how to handle them.

Overview

TOKI may apply request limits based on account, API key, model, package, and current system load to keep the service stable. Exact limits can change by package, model, and operations policy, so use the console and API responses as the source of truth.

How To Confirm Limits

Use the following sources to confirm current capabilities:

  • Check the product center or package description for usage rules.
  • Check whether the API key has a quota limit or expiration.
  • Read error.message when an API call fails.
  • Contact TOKI business or operations support for higher concurrency or enterprise quota.

Handling Limit Responses

When requests are too frequent or quota is insufficient, the API may return an error response. A typical rate-limit style response looks like:

{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "You have exceeded your rate limit. Please retry after 30 seconds."
  }
}

Whether rate-limit headers are returned, their exact names, and detailed error codes depend on the current server implementation. Clients should primarily handle the HTTP status code and JSON error body.

Implement exponential backoff with jitter:

async function requestWithRetry(fn: () => Promise<Response>, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    const response = await fn();

    if (response.status !== 429) return response;

    const baseDelay = Math.pow(2, i) * 1000;
    const jitter = Math.random() * 1000;
    await new Promise((r) => setTimeout(r, baseDelay + jitter));
  }

  throw new Error('Max retries exceeded');
}

For higher limits, contact TOKI business or operations support.

On this page