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
| Variable | Description | Default |
|---|---|---|
CUSTODIAN_SDK_API_KEY | Your CustodianAI API key | — |
CUSTODIAN_SDK_BASE_URL | Assistant API base URL | http://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
- Authentication — constructor options and multi-key setups
- Core Concepts — understand how assistants, apps, and sessions fit together
- Quickstart — end-to-end walkthrough