Failure handling
Errors
Omixa returns JSON errors for API calls and keeps sensitive provider diagnostics out of user-facing messages.
Error envelope
Handle status codes and the `error` object. Retry only idempotent operations and use your own backoff.
{
"error": {
"message": "Insufficient wallet balance.",
"type": "billing_error",
"code": "insufficient_balance"
}
}
Common status codes
Authentication, authorization, validation, balance, routing, and upstream failures are reported with explicit HTTP status codes.
| Code | Meaning |
|---|---|
| 401 | Missing or invalid API key. |
| 403 | Key is not allowed to use the requested model. |
| 422 | Payload validation failed. |
| 402 | Wallet balance is too low. |
| 503 | No healthy route is currently available. |