Skip to main content

Installation

Requirements

  • Python 3.10 or higher
  • An active CustodianAI API key (get one here)

Install the package

pip install custodian-labs

The SDK has a single runtime dependency: httpx.

Set your API key

The SDK reads your API key from the CUSTODIAN_SDK_API_KEY environment variable:

export CUSTODIAN_SDK_API_KEY=cai_your_key_here

Or pass it directly when constructing any client object:

from custodian_labs import create_assistant

app = create_assistant(
model="gpt-4o",
prompt="You are a helpful assistant.",
api_key="cai_your_key_here",
)

Environment variables

VariableDescriptionDefault
CUSTODIAN_SDK_API_KEYYour CustodianAI API key
CUSTODIAN_SDK_BASE_URLAssistant API base URLhttp://127.0.0.1:8000/v1
tip

Always use environment variables for API keys in production. Never hard-code them in source files.

Minimal example

from custodian_labs import create_assistant

app = create_assistant(
model="gpt-4o",
prompt="You are a helpful customer support assistant.",
)

response = app.chat("How do I reset my password?")
print(response.response)

Next steps