class documentation

class HubAIClient:

Constructor: HubAIClient(api_key)

View In Hierarchy

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.

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.

Method __init__ Initialize a HubAI SDK client.
Instance Variable convert Hosted model conversion functions.
Instance Variable instances Functions for model artifacts and their files.
Instance Variable models Functions for model resources.
Instance Variable variants Functions for versioned model variants.
Method _verify_api_key Check whether the configured API key is accepted by HubAI.
def __init__(self, api_key: str | None = None):

Initialize a HubAI SDK client.

Parameters
api_key:str | NoneHubAI 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
ValueErrorIf no API key is available or the provided key is invalid.
convert =

Hosted model conversion functions.

instances =

Functions for model artifacts and their files.

models =

Functions for model resources.

variants =

Functions for versioned model variants.

def _verify_api_key(self) -> bool:

Check whether the configured API key is accepted by HubAI.

Returns
boolTrue if the API key is valid, otherwise False for authentication failures.