Skip to main content

Client

Pass these parameters when creating ToncenterRestClient:
Without an API key the SDK auto-limits to 1 RPS / 1.2 s on the client side to match the server-side throttle. With a key, client-side limiting is off unless set explicitly.

Session

Retries

Rate-limited (429) and server-error responses are retried automatically with exponential backoff. Custom policy:
The defaults above apply when creating a custom RetryRule. The SDK’s built-in policy uses tuned values shown in the table above.
Pass retry_policy=None to disable retries entirely.

Key Rotation

Pass a list of ApiKey objects to rotate between keys on rate-limit errors (429). Each key carries its own client-side rate limit.
A single ApiKey also works — rate limit is taken from the object instead of the constructor rps_limit parameter:
On 429, the SDK exhausts all retry attempts for the current key (with backoff), then rotates to the next key and retries with a fresh cycle. Each key uses its own RateLimiter.