> ## 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 entry point of the CyborgDB Python SDK. It connects to a running CyborgDB service and creates, loads, and lists encrypted indexes.

## Constructor

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

### Parameters

| Parameter | Type | Default | Description |
| - | - | - | - |
| `base_url` | `str` | - | Base URL of the CyborgDB service, e.g. `"http://localhost:8000"`. |
| `api_key` | `str` | `None` | *(Optional)* Service authentication credential, sent as the `X-API-Key` header. Required only when the service has authentication enabled. |
| `verify_ssl` | `bool` | `None` | *(Optional)* TLS certificate verification. `None` auto-detects; see [TLS verification](#tls-verification). |

<Note>`api_key` is the service **authentication** credential: the root key or a per-user `cdbk_` token. It is required only when the service runs with `CYBORGDB_SERVICE_ROOT_KEY` set; against an unauthenticated service (the default), 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

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

## TLS verification

`verify_ssl` decides whether the SDK checks the service's TLS certificate:

| `base_url` | `verify_ssl=None` (default) | `verify_ssl=True` | `verify_ssl=False` |
| - | - | - | - |
| `http://…` | No TLS | No TLS (logs that the setting is ignored) | No TLS |
| `https://` with host `localhost`, `127.0.0.1`, or `::1` | Verification **off** (logs a warning) | Verification on | Verification off (logs a warning) |
| Any other `https://` URL | Verification on | Verification on | Verification off (logs a warning) |

## Errors

Failed requests raise a subclass of `cyborgdb.CyborgDBError` chosen by HTTP status, such as `NotFoundError` for `404` or `AuthenticationError` for `401`. Arguments rejected inside the SDK, before a request is sent, raise `cyborgdb.ValidationError`. See [Errors](../errors) for the full list.

```python theme={null}
import cyborgdb

try:
    Client(base_url='http://localhost:8000', api_key='wrong-key').list_indexes()
except cyborgdb.AuthenticationError as e:
    print(e.status_code)
# Output: 401
```


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