Errors
Errors use OpenAI’s shape, with a message written for you to read:
Branch on the HTTP status, and show message to people. On the inference endpoints (/chat/completions, /embeddings, /images/* and POST /videos), code is the HTTP status as a string, such as "402". GET /v1/models, the video read endpoints, unknown paths and the per-address rate limit use the named codes in the table instead.
Retrying
Retry 429, 502 and 503 with exponential backoff. The OpenAI SDKs do this for you. Don’t retry 400 to 404 without changing something: they will fail the same way.
A refused request is never charged. A request that fails partway is charged for what the model already did.
Hosts
When a model’s host fails, HyperFlow HI retries on another host for the same model where there is one, before returning an error. A host’s own error is never passed on as is.