Client
Without an API key the SDK auto-limits to ~1 request per 4 seconds on the client side to match the server-side throttle. With a key, client-side limiting is off unless set explicitly. Get a key at tonconsole.com.
Session
- Context manager
- Manual
- External
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 ofApiKey objects to rotate between keys on rate-limit errors (429). Each key carries its own client-side rate limit.
ApiKey also works — rate limit is taken from the object instead of the constructor rps_limit parameter:
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.