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

# Client

`Client` is the main class exposed by the CyborgDB Python SDK. It provides an interface to interact with the CyborgDB vector database service, allowing you to create and manage encrypted indexes.

## Constructor

```python theme={null}
Client(base_url, api_key=None, verify_ssl=None)
```

Initializes a new CyborgDB `Client` instance for connecting to a CyborgDB microservice.

### Parameters

| Parameter    | Type   | Default | Description                                                                                                                     |
| ------------ | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `base_url`   | `str`  | -       | Base URL of the CyborgDB microservice endpoint                                                                                  |
| `api_key`    | `str`  | `None`  | *(Optional)* Service authentication credential, sent as the `X-API-Key` header. Required only when the service has auth enabled |
| `verify_ssl` | `bool` | `None`  | *(Optional)* SSL verification. When `None`, automatically disabled for `localhost` and `http://` URLs                           |

<Note>`api_key` is the service **authentication** credential — the root key or a per-user `cdbk_` token, sent as `X-API-Key`. It is required only when the service runs with `CYBORGDB_SERVICE_ROOT_KEY` set; against an unauthenticated service (the default), you can omit it. This is distinct from the service's `CYBORGDB_API_KEY` license key. See [Managing Keys](../../guides/advanced/managing-keys).</Note>

### Example Usage

```python theme={null}
from cyborgdb import Client

# Create client with API key
client = Client(base_url='http://localhost:8000', api_key='your-api-key')
```

## Error Handling

The `Client` class includes comprehensive error handling that processes different types of API errors:

* **HTTP Errors**: Status codes and response details are logged and converted to meaningful error messages
* **Validation Errors**: Field validation failures are formatted with detailed information
* **Network Errors**: Connection and timeout issues are handled gracefully

All methods throw standard Python exceptions with descriptive messages for easier debugging and error handling in your application.

## Type Safety

The Python SDK provides type hints for better development experience:

* Type annotations for all method parameters and return values
* IDE support with autocomplete and type checking
* Runtime validation of critical parameters
