Inference

Model availability

Handle temporary model availability errors from the Inference API.

Updated


Every POST /v1/chat/completions request must use a public model ID returned by GET /v1/models. If the selected model is temporarily unavailable, the API returns an OpenAI-compatible error. Treat availability errors as temporary: retry with exponential backoff and avoid sending duplicate requests in parallel.

For a reproducible workload, persist the public model ID used for each request and validate the response against the normal OpenAI-compatible response shape. Choose a different public model only when your application explicitly permits that change and the replacement advertises every capability your request needs.

Error handling

Inspect the HTTP status and structured error object. A 502 server error can indicate temporary model unavailability; a 429 response indicates that the request should be retried later. Honor Retry-After when present and otherwise use bounded exponential backoff.

Model selection

Before sending images, tools, structured output, logprobs, or reasoning controls, choose a model that advertises the matching capability in /v1/models?metadata=true.