Documentation Index
Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
Use this file to discover all available pages before exploring further.
Configuration is the credentials object every SDK module accepts. By default each module instantiates its own Configuration from environment variables, so most code never touches it directly. Construct one explicitly when you need to override credentials or point at a self-hosted controller.
Constructor
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
api_key | str | None | XPANDER_API_KEY env var | API key for authentication. Required for any cloud call. |
organization_id | str | None | XPANDER_ORGANIZATION_ID env var | Organization identifier. Required for self-hosted controllers; optional but recommended for cloud. |
base_url | str | None | Auto-detected from env | API endpoint. Defaults to https://inbound.xpander.ai for cloud. Set to your Agent Controller URL for self-hosted. |
agent_id | str | None | None | Optional default agent ID. When set, methods that take agent_id can be called without arguments. Falls back to XPANDER_AGENT_ID. |
Environment variables
The SDK reads these on import. Setting them once via.env or your shell removes the need to construct Configuration manually.
| Variable | Purpose |
|---|---|
XPANDER_API_KEY | API key. Required. |
XPANDER_ORGANIZATION_ID | Organization ID. Required for self-hosted; recommended for cloud. |
XPANDER_BASE_URL | Override the API base URL. |
XPANDER_AGENT_ID | Default agent ID. Lets Backend(), Events(), and Agents().aget() work without an explicit ID. |
Methods
get_full_url() -> str
Returns the API URL, with the organization ID appended when the controller requires it.
base_url contains agent-controller or port 9016. You don’t need to do this yourself.
Self-hosted
Use the Agent Controller API key generated during your Helm install (not your cloud API key) and pointbase_url at the controller:
Sharing config across modules
Pass the sameConfiguration to every module so they hit the same endpoint and use the same credentials:
Agent, Task, KnowledgeBase) carry the Configuration they were loaded with, so subsequent method calls on them reuse it automatically.
