Route Reference
Complete endpoint reference for the Open Astra gateway. Every HTTP endpoint is listed below, organized by route group, with its method, path, and description.
X-Api-Key header. Auth conventions
| Label | Meaning |
|---|---|
| Public | No authentication required |
| JWT | Authorization: Bearer <token> — validated by jwtAuth() middleware |
| JWT + workspace | JWT plus X-Workspace-Id header — membership validated by workspaceResolver() |
| JWT + budget | JWT plus per-user token budget enforcement via tokenBudget() |
| Internal API key | X-Api-Key: <INTERNAL_API_KEY> — for admin, autonomous, and diagnostics |
1. Auth
Public endpoints for user registration, login, token rotation, and logout. No authentication required.
| Method | Path | Description |
|---|---|---|
| POST | /auth/register | Create user (email + password). Returns { user, accessToken, refreshToken } |
| POST | /auth/login | Authenticate. Returns { user, accessToken, refreshToken } |
| POST | /auth/refresh | Rotate refresh token. Returns { accessToken, refreshToken } |
| POST | /auth/logout | Revoke all tokens for the calling user |
curl -X POST http://localhost:8080/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "s3cret!"}'
# Response
{
"user": { "id": "usr_abc", "email": "user@example.com" },
"accessToken": "eyJhbG...",
"refreshToken": "eyJhbG..."
}2. Agent Chat
Core conversation endpoints. Middleware chain: JWT + tokenBudget + workspace + rateLimiter + userRateLimit + timeout.
| Method | Path | Description |
|---|---|---|
| POST | /agent/chat | Send message. Supports X-Idempotency-Key (5-min TTL). Returns { content, sessionId, toolsUsed, usage } |
| POST | /agent/chat/stream | SSE streaming. Emits session_resolved, content, tool_call, tool_call_complete, tool_result, done, error events |
| POST | /agent/reset | Manually reset session for agent + surface + surfaceId |
| GET | /agent/presence | Active agent states for the calling user |
| GET | /agent/health | Simple { status: "ok" } check |
Request body
Both /agent/chat and /agent/chat/stream accept the same body shape.
{
"message": "Summarize my calendar for today", // 1-10 000 chars, required
"agentId": "chad", // default "chad"
"surface": "chat", // "chat" | "prop" | "group"
"surfaceId": "main", // default "main"
"webhookUrl": "https://example.com/hook" // optional, non-streaming only
}| Field | Type | Required | Notes |
|---|---|---|---|
message | string | Yes | 1 -- 10 000 characters |
agentId | string | No | Default "chad" |
surface | string | No | "chat" | "prop" | "group" |
surfaceId | string | No | Default "main" |
webhookUrl | string | No | Non-streaming only. Receives the final response as a POST |
Response (non-streaming)
{
"content": "You have 3 meetings today...",
"sessionId": "ses_abc123",
"toolsUsed": ["google_calendar"],
"usage": {
"promptTokens": 1240,
"completionTokens": 310,
"totalTokens": 1550
}
}SSE events (streaming)
event: session_resolved
data: { "sessionId": "ses_abc", "isNew": true }
event: content
data: { "content": "Here's what I found..." }
event: tool_call
data: { "index": 0, "name": "web_search", "toolCallId": "tc_1" }
event: tool_call_complete
data: { "index": 0, "name": "web_search", "arguments": "{...}" }
event: tool_result
data: { "name": "web_search", "durationMs": 320 }
event: done
data: { "content": "...", "sessionId": "ses_abc", "usage": {...}, "toolsUsed": [...] }
event: error
data: { "message": "Rate limit exceeded", "code": "RATE_LIMIT" }POST /agent/chat accepts an X-Idempotency-Key header. Responses are cached in-process for 5 minutes -- duplicate requests return the cached response without running the agent again. 3. Memory
User long-term memory management. Middleware chain: JWT + tokenBudget + workspace + rateLimiter.
| Method | Path | Description |
|---|---|---|
| GET | /agent/memory/profile | Load user long-term profile |
| PUT | /agent/memory/profile | Update profile |
| GET | /agent/memory/daily | Recent daily memory entries |
| GET | /agent/memory/daily/:date | Daily memory for a specific date |
| DELETE | /agent/memory/daily/:date/:entryIndex | Delete a single daily entry |
| POST | /agent/memory/notes | Add a strategic note |
| DELETE | /agent/memory/notes/:index | Delete a strategic note |
| GET | /agent/memory/search | Semantic memory search (Typesense). Query params: q, topK |
/agent/memory/* routes interact with the three-tier memory system. See Memory Overview for details on profile, daily, and strategic note storage. 4. Agents
CRUD for agent configurations with versioning and rollback. Middleware: JWT + workspaceResolver. List and detail endpoints return ETag headers (30s cache).
| Method | Path | Description |
|---|---|---|
| POST | /agents | Create agent config |
| GET | /agents | List agents for workspace (ETag cached, 30s) |
| GET | /agents/:id | Get agent config (ETag cached) |
| GET | /agents/:id/capabilities | Effective tool list after skill expansion |
| PUT | /agents/:id | Update agent config (auto-versions) |
| DELETE | /agents/:id | Delete agent |
| GET | /agents/:id/versions | List config versions |
| GET | /agents/:id/versions/:version | Get historical version |
| POST | /agents/:id/versions/:version/rollback | Restore historical version |
| PATCH | /agents/:id/versions/:version | Update version label |
PUT /agents/:id saves a snapshot of the previous config. Use the versioning endpoints to list, inspect, or roll back to any prior state. 5. Workspaces
Workspace management, member invitations, usage stats, cross-workspace grants, and provider restrictions. Middleware: JWT only.
| Method | Path | Description |
|---|---|---|
| POST | /workspaces | Create workspace |
| GET | /workspaces | List user's workspaces |
| GET | /workspaces/:id | Get workspace + yourRole |
| PUT | /workspaces/:id/settings | Update settings (owner/admin) |
| POST | /workspaces/:id/members | Invite member (owner/admin) |
| DELETE | /workspaces/:id/members/:uid | Remove member |
| GET | /workspaces/:id/stats | Usage dashboard. Query param: ?days=30 (default 30, max 365) |
| POST | /workspaces/:id/grants | Grant cross-workspace agent access |
| DELETE | /workspaces/:id/grants | Revoke grant |
| PUT | /workspaces/:id/restrictions | Set allowed providers/models |
POST /workspaces/:id/grants to let another workspace use one of your agents. See Agent Grants for the full grant lifecycle. 6. Sessions
Session listing, detail retrieval, full-text search, and agent handoff. Middleware: JWT only.
| Method | Path | Description |
|---|---|---|
| GET | /sessions | Paginated session list. Query params: status, limit, offset |
| GET | /sessions/:id | Session detail + messages. Query param: limit |
| GET | /sessions/search/messages | Full-text search across messages. Query params: q, limit |
| POST | /sessions/:id/handoff | Transfer session to a different agent |
7. Webhooks
Register webhook URLs to receive events. Middleware: JWT only.
| Method | Path | Description |
|---|---|---|
| POST | /webhooks | Register webhook (url, events, description) |
| GET | /webhooks | List webhooks (secret omitted) |
| GET | /webhooks/:id | Get webhook |
| PUT | /webhooks/:id | Update webhook |
| DELETE | /webhooks/:id | Delete webhook |
| GET | /webhooks/:id/deliveries | Recent delivery history |
| POST | /webhooks/:id/test | Send test event |
8. Costs
Workspace cost tracking and breakdowns. Middleware: JWT + workspace.
| Method | Path | Description |
|---|---|---|
| GET | /costs | Workspace cost summary. Query param: ?months=3 |
| GET | /costs/breakdown | Detailed breakdown. Query params: months, startDate, endDate |
9. Heartbeat
Scheduled monitoring configs for RSS feeds and HTTP endpoints. Middleware: JWT + workspace.
| Method | Path | Description |
|---|---|---|
| GET | /heartbeat | List configs with last run status |
| POST | /heartbeat | Create config (rss | http, 5 min -- 1 week interval) |
| GET | /heartbeat/:id/runs | Paginated run history. Query params: limit, offset |
| PATCH | /heartbeat/:id | Enable/disable |
| DELETE | /heartbeat/:id | Delete config |
10. Skills
Skill registry and cache management. List and detail endpoints are public. Cache management requires JWT.
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /skills | None | All registered skills (ETag cached, 60s) |
| GET | /skills/:id | None | Skill detail + instructions |
| GET | /skills/:id/metrics | None | Performance metrics (30 days) |
| GET | /skills/cache/stats | JWT | Tool result cache stats |
| POST | /skills/cache/clear | JWT | Clear tool cache. Query param: ?tool= |
11. Traces
Agent execution traces for debugging and observability. Middleware: JWT + workspace.
| Method | Path | Description |
|---|---|---|
| GET | /traces | Paginated agent traces. Query params: agentId, limit, offset |
| GET | /traces/:id | Full trace detail |
12. Jobs
Background job queue. Middleware: JWT + workspace.
| Method | Path | Description |
|---|---|---|
| POST | /jobs | Enqueue job (type, payload, maxRetries, timeoutSeconds) |
| GET | /jobs | List jobs. Query params: status, limit |
| GET | /jobs/:id | Get job |
| DELETE | /jobs/:id | Cancel pending job |
13. Memory Profiles
Reusable memory profile templates that can be assigned to agents. Middleware: JWT + workspace.
| Method | Path | Description |
|---|---|---|
| POST | /memory-profiles | Create profile |
| GET | /memory-profiles | List profiles |
| GET | /memory-profiles/:id | Get profile |
| PUT | /memory-profiles/:id | Update profile |
| DELETE | /memory-profiles/:id | Delete profile |
| PUT | /memory-profiles/agents/:agentId/memory-profile | Assign profile to agent |
| GET | /memory-profiles/agents/:agentId/memory-profile | Get agent's assigned profile |
14. Onboarding
First-run setup endpoint. Middleware: JWT only.
| Method | Path | Description |
|---|---|---|
| POST | /onboarding/setup | Create initial workspace + seed agents in one call |
15. Autonomous
Run agent tasks programmatically from backend services. Auth: internal API key via X-Api-Key. Rate limited to 60 requests per minute.
| Method | Path | Description |
|---|---|---|
| POST | /autonomous/run | Run agent for a specific uid. Body: { uid, agentId, taskMessage } |
| POST | /autonomous/batch | Run for multiple uids. Returns 207 on partial failure |
curl -X POST http://localhost:8080/autonomous/run \
-H "X-Api-Key: ${INTERNAL_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"uid": "usr_abc",
"agentId": "chad",
"taskMessage": "Summarize overnight alerts"
}'INTERNAL_API_KEY to client-side code. 16. Admin
Operational visibility into the running gateway. Auth: internal API key via X-Api-Key.
| Method | Path | Description |
|---|---|---|
| GET | /admin/health | Memory usage, uptime, active sessions, tool count |
| GET | /admin/agents | All registered agent configs |
| GET | /admin/usage/:uid | Monthly billing usage for a user |
| GET | /admin/sessions/:uid | Active sessions for a user |
| GET | /admin/audit/:uid | Last 50 audit entries for a user |
17. Diagnostics
System diagnostics and circuit breaker inspection. Auth: internal API key via X-Api-Key.
| Method | Path | Description |
|---|---|---|
| GET | /diagnostics | Full diagnostic run |
| GET | /diagnostics/quick | Connectivity checks only |
| GET | /diagnostics/history | Last 10 diagnostic runs |
| GET | /diagnostics/circuit-breakers | Inference provider circuit breaker states |
Health & Metrics
Public system endpoints. No authentication required.
| Method | Path | Description |
|---|---|---|
| GET | /health | Deep health check (Typesense + Postgres + WS count). Returns 503 if any check fails |
| GET | /readiness | Kubernetes readiness probe. Returns 503 if unavailable |
| GET | /metrics | Operational metrics (uptime, connections, tools, skills, sessions, messages, billing, cache) |
| GET | /openapi.json | Full OpenAPI 3.1 spec |
// GET /health
{
"status": "ok",
"checks": { "typesense": true, "postgres": true },
"wsConnections": 42,
"timestamp": "2026-02-27T12:00:00.000Z"
}
// GET /readiness — 200 or 503
{ "ready": true }
// GET /metrics
{
"uptime": 86400,
"wsConnections": 42,
"tools": 106,
"skills": 48,
"sessions": { "active": 15, "total": 1240 },
"messages": 28400,
"billing": { "month": "2026-02", "totalCost": 12.40 },
"cache": { "hits": 9820, "misses": 1430 }
}See also
- Gateway Overview -- architecture, middleware stack, and WebSocket transport
- Middleware Reference -- auth, CSRF, rate limiting, RBAC, security headers
- WebSocket Reference -- frame types, back-pressure, multi-device
- Event System -- all emitted events and webhook delivery
- REST API Reference -- authentication flow, WebSocket API, and correlation IDs