> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors & Enums

> Python API reference for Errors & Enums.

Shared configuration and state types: session and user state enums, speech and VAD
event types, and the config objects for end-of-utterance, interruption, and
realtime behavior.

## ZeroRuntimeError

Base for everything this SDK raises on its own behalf.

Catch it to handle any ZeroRuntime failure without naming each one. Errors
the standard library raises -- `ValueError` for a bad argument,
`TimeoutError` for a request that went unanswered -- are left as
themselves rather than wrapped.

***

## SessionRejected

The ZeroRuntime refused to create the session.

### Constructor

```python theme={null}
SessionRejected(message: 'str' = '', *, code: 'str' = '', current_sessions: 'int' = 0, max_sessions: 'int' = 0) -> 'None'
```

<ParamField path="message" type="str" default="">
  The ZeroRuntime's explanation.
</ParamField>

<ParamField path="code" type="str" default="">
  Machine-readable reason, `at_capacity` | `invalid_config` | `internal`. `at_capacity` is worth retrying elsewhere; `invalid_config` never is.
</ParamField>

<ParamField path="current_sessions" type="int" default="0">
  Sessions the ZeroRuntime is already running.
</ParamField>

<ParamField path="max_sessions" type="int" default="0">
  The ZeroRuntime's ceiling, when it reported one.
</ParamField>

***

## ProviderUnavailable

A provider in the pipeline could not be reached or would not serve.

Usually a missing or rejected vendor key, or a model the account is not
entitled to. A fallback on the same slot is what keeps this from ending the
call.

***

## ZeroRuntimeUnreachable

The runtime could not be reached, or did not answer in time.

A transport failure rather than a refusal: nothing was decided about the
session, so retrying is reasonable.

***

## ToolTimeout

A `@function_tool` did not return before its deadline.

The turn continues without the tool's answer. A tool that calls out to a
slow API wants its own timeout, so it can say something useful instead of
being cut off.

***

## AgentState

Where the agent is in a turn -- listening, thinking, speaking, or on its
way in or out of the call.

```python theme={null}
class AgentState(Enum):
    STARTING = 'starting'
    IDLE = 'idle'
    SPEAKING = 'speaking'
    LISTENING = 'listening'
    THINKING = 'thinking'
    CLOSING = 'closing'
```

***

## UserState

What the caller is doing, as the runtime reports it.

```python theme={null}
class UserState(Enum):
    IDLE = 'idle'
    SPEAKING = 'speaking'
    LISTENING = 'listening'
```

***

## ChatRole

Who a message in the conversation came from.

A plain string works anywhere one of these is accepted -- it subclasses
`str` -- so `"user"` and `ChatRole.USER` are interchangeable.

```python theme={null}
class ChatRole(Enum):
    SYSTEM = 'system'
    USER = 'user'
    ASSISTANT = 'assistant'
    DEVELOPER = 'developer'
    TOOL = 'tool'
```
