Introduction

The Configuration Module in xpander.ai Python SDK handles authentication and environment setup. By default, the SDK automatically loads configuration from environment variables, requiring explicit configuration only when you need to override defaults or use multiple configurations in parallel.

Overview

The SDK uses automatic configuration by default:
  • Reads credentials from environment variables automatically
  • No explicit configuration needed for basic usage
  • Only use Configuration class when you need to override defaults or manage multiple environments

Examples

Set up your environment variables and use the SDK modules directly:
export XPANDER_API_KEY="your-api-key"
export XPANDER_ORGANIZATION_ID="your-org-id"
from xpander_sdk import Agents, Tasks, Events

# SDK automatically uses environment variables
agents = Agents()
tasks = Tasks()
events = Events()

Override Configuration

Override specific settings when needed:
from xpander_sdk import Configuration, Agents

# Override default configuration
config = Configuration(
    api_key="different-api-key",
    organization_id="different-org-id"
)

agents = Agents(configuration=config)

Multiple Configurations in Parallel

Use different configurations simultaneously for multiple environments:
from xpander_sdk import Configuration, Agents

# Development environment
dev_config = Configuration(
    api_key="dev-api-key",
    organization_id="dev-org-id",
    base_url="https://dev.xpander.ai"
)

# Production environment  
prod_config = Configuration(
    api_key="prod-api-key",
    organization_id="prod-org-id"
)

# Use different configurations simultaneously
dev_agents = Agents(configuration=dev_config)
prod_agents = Agents(configuration=prod_config)

Continue to the Configuration API Reference for detailed documentation on classes and methods.

Support

For additional help: