Documentation Index
Fetch the complete documentation index at: https://docs.xhipai.com/llms.txt
Use this file to discover all available pages before exploring further.
Transport Overview
The Agentium transport layer exposes agents, teams, and workflows over HTTP (Express) and WebSockets (Socket.IO). It is optional—install@agentium/transport only when you need to serve agents via REST or real-time connections.
Architecture
Express Router
createAgentRouter() returns an Express router with REST endpoints for agents, teams, and workflows.Socket.IO Gateway
createAgentGateway() attaches real-time handlers to a Socket.IO server for streaming agent responses.Optional Install
The transport package is separate from the core. Install it when you need HTTP or WebSocket exposure:Quick Start
Agents auto-register into a globalregistry on construction. The transport layer discovers them dynamically — no need to wire agents into router or gateway options manually.
REST Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /agents/:name/run | Run agent, return full response |
| POST | /agents/:name/stream | Stream agent via SSE |
| POST | /teams/:name/run | Run team |
| POST | /teams/:name/stream | Stream team via SSE |
| POST | /workflows/:name/run | Run workflow |
| GET | /agents | List registered agents with metadata |
| GET | /teams | List registered teams |
| GET | /workflows | List registered workflows |
| GET | /registry | List all registered entity names |
| GET | /tools | List available tools (when toolkits configured) |
| GET | /tools/:name | Get single tool detail |
| GET | /docs | Swagger UI (if enabled) |
| GET | /docs/spec.json | OpenAPI spec (if enabled) |
Socket.IO Events
| Event | Direction | Description |
|---|---|---|
agent.run | Client → Server | Trigger agent run with { name, input, sessionId?, apiKey? } |
team.run | Client → Server | Trigger team run |
agents.list | Client → Server | List agents with metadata (acknowledgement callback) |
teams.list | Client → Server | List teams (acknowledgement callback) |
workflows.list | Client → Server | List workflows (acknowledgement callback) |
registry.list | Client → Server | List all registered names (acknowledgement callback) |
tools.list | Client → Server | List available tools (acknowledgement callback) |
tools.get | Client → Server | Get single tool detail (acknowledgement callback) |
agent.chunk | Server → Client | Streamed text chunk |
agent.tool.call | Server → Client | Tool call started |
agent.tool.done | Server → Client | Tool call finished |
agent.done | Server → Client | Run complete with output |
agent.error | Server → Client | Error occurred |
Features
Auto-Discovery
Auto-Discovery
Agents, teams, and workflows auto-register into a global
Registry when created. Transport layers discover them at request time — entities created after server start are immediately available. Set registry: false to disable and only serve explicitly passed entities.File Upload
File Upload
Enable
fileUpload in router options to accept multipart form data. Files are converted to multi-modal content parts (images, audio, documents) and passed to agents.Per-Request API Keys
Per-Request API Keys
Clients can pass API keys via headers (
x-openai-api-key, x-google-api-key, x-anthropic-api-key, x-api-key) or in the request body.Swagger UI
Swagger UI
Enable
swagger.enabled to serve interactive API docs at /docs and the OpenAPI spec at /docs/spec.json.Tool Discovery
Tool Discovery
Pass
toolkits or toolLibrary in router/gateway options to expose GET /tools and tools.list endpoints. The UI can discover available tools before creating agents.Next Steps
- Express Router —
createAgentRouter, endpoints, middleware - Swagger — OpenAPI spec and Swagger UI
- File Upload — Multi-modal inputs via HTTP
- Socket.IO Gateway — Real-time streaming
- API Keys — Per-request key overrides
- Voice Gateway — Real-time voice streaming via Socket.IO (
createVoiceGateway)