/** * Non-fatal or fatal error notification. The wire payload always carries * `event`, `code`, `is_fatal`, and `message`, plus an optional * `status_code` on fatal rejections. * * **WebSocket close codes:** * - `1003`: Rate limit exceeded, quota exhausted, or invalid subscription key. * - `1008`: Inactivity timeout. * - `1011`: Internal server error. * - `4000`: Application rejection (beta denied, invalid model, unsupported `language_code` / query param, gRPC backend unavailable). The close reason string is capped at 123 bytes. * * **Known error codes:** * - `invalid_config` (non-fatal): A `config.update` value was rejected (e.g. changing `stream_type` to/from `simulated`). The session continues with the previous config. */ export interface RealtimeError { event: "error"; /** Machine-readable error code */ code: string; /** Whether the error is fatal (the connection will be closed) */ is_fatal: boolean; /** Human-readable error message */ message: string; /** * HTTP-equivalent status code, present on fatal rejections * (e.g. `401`, `403`, `503`, `400`, `408`, `413`, `500`). Useful * because the WebSocket close reason string is capped at 123 bytes. */ status_code?: number | undefined; }