# hubai_client

Python API: `hubai_sdk.hubai_client`

Authenticated entry point for the HubAI Python API.

## Classes

### HubAIClient

Authenticate with HubAI and expose its high-level service modules.

A client does not hold a separate HTTP session. Its service attributes are modules whose functions use the API key stored in the
SDK environment. Consequently, creating another client replaces the process-wide key used by subsequent service calls.

> **Example**
> The constructor finds `HUBAI_API_KEY` automatically.

```python
from hubai_sdk import HubAIClient

client = HubAIClient()
models = client.models.list_models(is_public=True)
```

> **Note**
> Installed `hubai.plugins` entry points can add more attributes. A plugin cannot replace one of the built-in service attributes.

#### Methods

##### init

```python
def __init__(api_key: str | None = None):
```

Initialize a HubAI SDK client.

Parameters

 * `api_key` (`str | None`): HubAI API key. If omitted, the client falls back to the `HUBAI_API_KEY` environment variable and then
   to the key loaded from secure credential storage.

Raises

 * `ValueError`: If no API key is available or the provided key is invalid.

#### Attributes

##### convert

Hosted model conversion functions.

##### instances

Functions for model artifacts and their files.

##### models

Functions for model resources.

##### variants

Functions for versioned model variants.
