API Reference
Trinity exposes a comprehensive REST API across 40+ routers. The full interactive documentation is available at http://localhost:8000/docs when running locally.
Authentication
# Get a JWT token
curl -s -X POST http://localhost:8000/api/token \
-d 'username=admin&password=${ADMIN_PASSWORD}'
# Use in requests
curl -s -H "Authorization: Bearer <token>" \
http://localhost:8000/api/agents01
Authentication
JWT tokens, API keys, and auth flows
02
Agents API
Agent lifecycle, configuration, credentials, and sharing
03
Chat API
Chat, voice, streaming, public and paid chat endpoints
04
Skills API
Skills library and agent skill assignments
05
Schedules & Triggers API
Cron schedules, webhook triggers, and event-driven execution
06
Webhook Triggers
Internal triggers, event webhooks, and external integrations
Key Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/token | Authenticate and get JWT token |
| POST | /api/mcp/keys | Create MCP API key |
| GET | /api/agents | List all agents |
| POST | /api/agents | Create a new agent |
| POST | /api/agents/:name/start | Start an agent container |
| DELETE | /api/agents/:name | Delete an agent and all resources |
| POST | /api/agents/:name/chat | Send message to agent (streaming) |
| POST | /api/agents/:name/task | Submit async task to agent |
| GET | /api/skills/library | List all skills in the library |
| PUT | /api/agents/:name/skills | Bulk update agent skill assignments |
| POST | /api/agents/:name/schedules | Create a cron schedule for an agent |
| POST | /api/agents/:name/schedules/:id/trigger | Manually trigger a schedule execution |
| POST | /api/events | Emit event (triggers subscriptions) |
| POST | /api/agents/:name/credentials/inject | Inject credentials into a running agent |