diff --git a/src/openai/_base_client.py b/src/openai/_base_client.py index a0f9cce7d8..305313bd0c 100644 --- a/src/openai/_base_client.py +++ b/src/openai/_base_client.py @@ -732,7 +732,7 @@ def _calculate_retry_timeout( # Apply exponential backoff, but not more than the max. sleep_seconds = min(INITIAL_RETRY_DELAY * pow(2.0, nb_retries), MAX_RETRY_DELAY) - # Apply some jitter, plus-or-minus half a second. + # Reduce the calculated timeout by a random range between 0-25% jitter = 1 - 0.25 * random() timeout = sleep_seconds * jitter return timeout if timeout >= 0 else 0