When to use the API
Use the Unified API when you want to:- Embed agent capabilities directly into your product
- Trigger agents from backend services or serverless functions
- Build custom interfaces beyond Slack, MCP, or the Web UI
- Orchestrate agents as part of a larger workflow
Basic usage
Multimodal inputs
All API requests support multimodal inputs. You can pass text, files, and images in the same request:Sync vs async
The API supports both synchronous and asynchronous invocation:- Sync (
/invoke): Waits for the agent to complete and returns the result. Best for quick tasks. - Async (
/invoke/async): Returns immediately with a task ID. Poll for results or use webhooks. Best for long-running tasks.
Authentication
Every request requires an API key in thex-api-key header. Generate keys in the xpander dashboard under Settings > API Keys.

