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

# Exceptions

# fishaudio.exceptions

Custom exceptions for the Fish Audio SDK.

## FishAudioError Objects

```python theme={null}
class FishAudioError(Exception)
```

Base exception for all Fish Audio SDK errors.

## APIError Objects

```python theme={null}
class APIError(FishAudioError)
```

Raised when the API returns an error response.

## AuthenticationError Objects

```python theme={null}
class AuthenticationError(APIError)
```

Raised when authentication fails (401).

## PermissionError Objects

```python theme={null}
class PermissionError(APIError)
```

Raised when permission is denied (403).

## NotFoundError Objects

```python theme={null}
class NotFoundError(APIError)
```

Raised when a resource is not found (404).

## RateLimitError Objects

```python theme={null}
class RateLimitError(APIError)
```

Raised when rate limit is exceeded (429).

## ServerError Objects

```python theme={null}
class ServerError(APIError)
```

Raised when the server encounters an error (5xx).

## WebSocketError Objects

```python theme={null}
class WebSocketError(FishAudioError)
```

Raised when WebSocket connection or streaming fails.

## ASRRealtimeError Objects

```python theme={null}
class ASRRealtimeError(WebSocketError)
```

Raised when a realtime speech-to-text session ends with an error.

**Attributes**:

* `message` - A short English description, for humans
* `error_type` - Machine-readable error type from the server's error event
  (e.g., "invalid\_config", "idle\_timeout"). None if the connection closed
  without one
* `code` - HTTP-style status from the server's error event. None if not sent
* `request_id` - Identifier of the request; quote it when reporting a problem
* `close_code` - WebSocket close code (e.g., 4400, 4408, 1012). None if the error
  was raised before the connection closed

## ValidationError Objects

```python theme={null}
class ValidationError(FishAudioError)
```

Raised when request validation fails.

## DependencyError Objects

```python theme={null}
class DependencyError(FishAudioError)
```

Raised when a required dependency is missing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.