Console ↗

Retries

The downloadable client sends one request per call. Consider a bounded retry for a transient read on the models endpoint. Repeating inference may consume credits if the first response was lost.

Example

from urllib.error import HTTPError
from time import sleep

for attempt in range(3):
    try:
        models = client.models()
        break
    except HTTPError as error:
        if error.code not in (502, 503, 504) or attempt == 2:
            raise
        sleep(2 ** attempt)

System One endpoint · Request rules and errors