xpander-sdk
XpanderClient
XpanderClient API Reference for the xpander SDK
The XpanderClient
is the main entry point for the xpander SDK. It provides methods for managing agents and utility functions for working with LLM responses.
Initialization
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
api_key / apiKey | string | Yes | Your xpander API key |
base_url / baseUrl | string | No | API endpoint URL, defaults to production URL (https://inbound.xpander.ai). Set to http://localhost:9991 for local runs |
organization_id / organizationId | string | No | Organization ID, needed for multi-organization and local run |
should_reset_cache / shouldResetCache | boolean | No | Whether to reset the cache when creating the client |
Properties
agents
The agents property provides access to agent management methods.
Agent Management Methods
agents.get()
Retrieves an agent by ID.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
agent_id / agentId | string | Yes | ID of the agent to retrieve |
Returns
Returns an Agent
object.
agents.list()
Lists all available agents.
Returns
Returns an array of Agent
objects.
agents.create()
Creates a new agent.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
name | string | Yes | Name of the agent |
description | string | No | Description of the agent |
agent_type / agentType | string | Yes | Type of agent: “regular” or “agentic_interface” |
instructions | string | No | Instructions for the agent |
Returns
Returns the newly created Agent
object.
Enums
LLMProvider
Enumeration of supported LLM providers: