string
A human-readable description of the problem. Safe to log and surface to
developers, but do not parse it programmatically; parse
type and code
instead.string
The high-level error category. One of
invalid_request_error,
insufficient_quota, or upstream_error.string
The specific machine-readable error. One of
invalid_api_key,
insufficient_balance, model_not_found, dedicated_endpoint_not_found, or
unknown_provider. Branch on this value in your error handling.Status codes
Error codes
Thetype and code fields pinpoint the exact failure. Use the table to map a
code to its category, HTTP status, and remedy.
invalid_api_key (401)
invalid_api_key (401)
The key is missing, malformed, or revoked. Keys are sent as
Authorization: Bearer <key>. Confirm the header is present and the key is
active in your workspace. Rotating a key immediately invalidates the old
one, so deployments still holding a stale key will see this error.insufficient_balance (402)
insufficient_balance (402)
Before a request runs, Omnia places a hold on your wallet for the request’s
worst-case cost, enough to cover the maximum tokens it could produce. If
the wallet can’t cover that hold, the request is rejected with
402 before
any provider is called. You’re never charged for a request that returns
402. Add funds or turn on auto-reload to avoid
interruptions. Capping max_tokens also lowers the hold, since the
worst case shrinks.model_not_found (404)
model_not_found (404)
The model you requested isn’t in the priced catalog: either the id is
misspelled or the model isn’t offered. This is a deliberate
404: Omnia
refuses to run a model it can’t price so you’re never billed for an unpriced
model. Call /v1/models to list valid ids.dedicated_endpoint_not_found (404)
dedicated_endpoint_not_found (404)
You addressed a dedicated endpoint as
dedicated/<routing-key>, but that
routing key either isn’t owned by your workspace or has been deleted. Check
the routing key on the endpoint’s page in the dashboard, and confirm the
endpoint still exists. See Dedicated endpoints.unknown_provider (400)
unknown_provider (400)
You used a provider prefix that has no configured key. Verify the provider
prefix is spelled correctly and that a key for that provider is configured
for your workspace.
upstream_error (502)
upstream_error (502)
A transient error reaching the model provider. Retry with exponential
backoff. The message includes a request id reference; quote it if you
contact support.
Retrying safely
Retry429, 408, and 502 responses with exponential backoff and jitter.
For a 502, the message includes a request id reference. Quote that reference
if you contact support so the request can be traced.
Python
This helper retries only the transient statuses and backs off exponentially with jitter:curl
curl --retry with backoff covers the transient cases for simple scripts: