Skip to main content

Overview

When using a self-hosted xpander.ai deployment, you need to configure the SDK to point to your Agent Controller endpoint instead of the default xpander.ai cloud service.
Important: Self-hosted deployments use the Agent Controller API key generated during Helm installation, not your xpander.ai cloud API key.

Configuration Methods

Set the XPANDER_BASE_URL environment variable to your Agent Controller endpoint:
Then initialize the SDK without parameters:

Explicit Configuration

Pass the base_url parameter directly when creating the Configuration object:

Using .env Files

Create a .env file in your project root:
.env
Load it using python-dotenv:

Usage Examples

Basic SDK Usage

Using with Agno Framework

Important Notes

Endpoint URL: Make sure your base_url points to the Agent Controller endpoint (e.g., https://agent-controller.{your-domain}), not the root domain or other services.
API Key: Use the Agent Controller API key generated during your Helm installation, not your xpander.ai cloud API key. This key is specific to your self-hosted deployment.
  • Self-Hosted Deployment Guide - Complete guide for deploying xpander.ai on your infrastructure
  • [Configuration Module](/API reference/configuration) - Full Configuration class reference
  • [Agents Module](/API reference/agents) - Working with agents
  • [Tasks Module](/API reference/tasks) - Task management and execution