Skip to main content
Handle rate limits by controlling concurrency before requests leave your app. When CometAPI returns 429, retry with exponential backoff and jitter, then lower burst traffic if repeated retries occur.

Limit concurrency

The following Python example caps concurrent chat requests with an async semaphore:
The result is an array of model outputs:

Retry rate limits

The following JavaScript example retries 429 responses with jitter:
The successful response contains a normal chat completion:

Common errors

Last modified on June 23, 2026