4102) under the /api prefix. Responses are JSON with Content-Type: application/json. CORS headers are applied at the server level.
Base URL: http://<host>:4102/api
When the
AGTOS_API_KEY environment variable is set, all /api/* endpoints require a Bearer token. See Authentication below.Health
GET /api/health
GET /api/health
Comprehensive health status from all registered service checkers (Redis, STT, TTS, Ollama, Claude, MCP).503 Service Unavailable — One or more services degraded.
Response
200 OK — All services healthy.Sessions
GET /api/sessions
GET /api/sessions
List active voice sessions with connection metadata.503 Service Unavailable — Voice pipeline not initialized.
Response
200 OKVoice Status
GET /api/voice/status
GET /api/voice/status
Voice pipeline availability and active session count. Always returns 200, even when the pipeline is unavailable, so the dashboard can degrade gracefully.200 OK — Pipeline not wired up.
Response
200 OK — Pipeline available.Memory
GET /api/memory/episodes
GET /api/memory/episodes
GET /api/memory/search
GET /api/memory/search
Scheduler
GET /api/scheduler/tasks
GET /api/scheduler/tasks
List all scheduled tasks.503 Service Unavailable — Scheduler not available (Redis down or not configured).
Response
200 OKPOST /api/scheduler/tasks
POST /api/scheduler/tasks
Create a new scheduled task.400 Bad Request — Validation errors.503 Service Unavailable — Scheduler not available.
Request Body
Human-readable task name.
One of:
cron, once, interval.Cron expression. Required when
scheduleType is cron.Unix ms timestamp. Required when
scheduleType is once.Interval in milliseconds. Required when
scheduleType is interval.Event bus topic published when the task fires.
Optional payload included in the fired event.
Schedule Type Examples
Response
201 CreatedDELETE /api/scheduler/tasks/:id
DELETE /api/scheduler/tasks/:id
Workflows
GET /api/workflows
GET /api/workflows
List all registered workflow definitions.503 Service Unavailable — Workflow engine not available.
Response
200 OKPOST /api/workflows/:id/execute
POST /api/workflows/:id/execute
Trigger execution of a registered workflow.400 Bad Request — Invalid workflow ID or execution failure.404 Not Found — Workflow not registered.503 Service Unavailable — Workflow engine not available.
Path Parameters
The workflow ID to execute.
Request Body (optional)
Optional input payload for the workflow.
Response
200 OKSystem Info
GET /api/system/info
GET /api/system/info
System information including uptime, runtime versions, memory usage, and port configuration.
Response
200 OKChat
POST /api/chat
POST /api/chat
Text-based chat endpoint. Routes user text through the agent reasoning loop (model router with tool execution) and returns the response.400 Bad Request — Missing or empty text.500 Internal Server Error — Chat processing failed.503 Service Unavailable — Voice pipeline not available.
Request Body
The user’s message text (must be non-empty).
Session ID for conversation continuity. Omit for stateless.
Response
200 OKTasks
POST /api/tasks
POST /api/tasks
Submit a background agent task. Accepts a topic string, routes it through the agent reasoning loop, and returns the result with a generated task ID.400 Bad Request — Missing or empty topic.500 Internal Server Error — Task processing failed.503 Service Unavailable — Voice pipeline not available.
Request Body
The task topic/prompt (must be non-empty).
Response
200 OKCommon Error Responses
All endpoints may return the following error shapes:400 Bad Request
Returned when the request is malformed or missing required fields. Theerror field contains a human-readable description.
404 Not Found
Returned when a requested resource (task, workflow) does not exist.500 Internal Server Error
Returned when an unexpected exception occurs during request processing.503 Service Unavailable
Returned when a required dependency (Redis, voice pipeline, memory system, scheduler, workflow engine) is not initialized or has failed.Notes
Body size limit: Request bodies are capped at 1 MB. Requests exceeding this limit receive no response (connection closed).
- ID validation: Path parameter IDs (task IDs, workflow IDs) must match
^[a-zA-Z0-9\-_]+$and be 1—128 characters. Invalid IDs return 400. - CORS: Configurable via
CORS_ORIGINenvironment variable (default:*). PreflightOPTIONSrequests return 204. - Metrics: All API requests are tracked in the internal metrics system. Latency is recorded per route.
- Authentication: See Authentication below for opt-in API key auth.
- Rate Limiting: See Rate Limiting below for per-endpoint limits.
Authentication
API key authentication is opt-in. When theAGTOS_API_KEY environment variable is set, all /api/* endpoints require a valid Bearer token.
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <your-api-key> | When AGTOS_API_KEY is set |
Response (401 Unauthorized)
Exempt Paths
These paths do not require authentication:GET /health(and sub-paths)GET /metrics
Rate Limiting
All API endpoints are rate-limited using a token bucket algorithm.Default Limits
| Scope | Limit | Configurable Via |
|---|---|---|
General API (/api/*) | 100 requests/min | API_RATE_LIMIT |
Chat + Tasks (/api/chat, /api/tasks) | 20 requests/min | CHAT_RATE_LIMIT |
Rate Limit Headers
Included on all API responses:| Header | Description |
|---|---|
X-RateLimit-Remaining | Tokens remaining in current window |
429 Too Many Requests responses:
| Header | Description |
|---|---|
Retry-After | Seconds until rate limit resets |
X-RateLimit-Limit | Maximum requests per window |
X-RateLimit-Remaining | Always 0 on rate-limited responses |
X-RateLimit-Reset | Seconds until rate limit resets |