Skip to content

API & Real-Time Routing Reference

Anvil Agent Gateway (:8792)

All /v1/* and /mcp endpoints require either Authorization: Bearer <AGENT_CLIENT_TOKEN> or an allowlisted Tailscale-User-Login header (configured in agent.toml).

Method Path Purpose
GET /healthz Unauthenticated liveness probe ({"ok": true})
GET /v1/agents List configured agent backends ({"agents": [{"id": "...", "label": "..."}]})
POST /v1/agent/turn Multipart spoken (audio) or typed (text) turn with optional agent ID; transcribes speech through the router, queries the selected backend, and returns {"agent", "transcript", "reply", "sessionId", "status"}
POST /v1/hermes/turn Legacy alias for POST /v1/agent/turn with agent=hermes
POST /v1/memos/preview Multipart Ogg Opus rolling-window STT preview for live captions and push-to-talk (ephemeral; stores nothing)
GET /v1/glasses/events?after=<id>&wait=<0..25> Long-poll glasses event stream (updates presence and returns queued NOTIFY/control events)
POST /v1/glasses/answer Multipart wearer answer (askId + text, audio, or declined=1) to settle a pending MCP ASK
POST /v1/glasses/notify JSON convenience endpoint ({"body": "...", "title": "...", "kind": "notify"|"task"}) to queue a NOTIFY card
POST /mcp Streamable HTTP JSON-RPC 2.0 MCP endpoint exposing memomind_glasses (rejects browser Origin headers)

Real-Time Capability Router (:8000)

All /v1/* endpoints require Authorization: Bearer <AGENT_ROUTER_TOKEN>. Unknown route IDs return 404 with no hidden fallback.

Method Path Purpose
GET /healthz Unauthenticated liveness probe ({"ok": true})
GET /v1/models OpenAI-style list of declared STT and chat route IDs
POST /v1/audio/transcriptions Accepts either OpenAI multipart/form-data (file + model) or Anvil Agent's normalized JSON STT envelope ({"purpose": "stt", "format": "wav", "audio_b64": "...", "route": "..."}) and forwards to audio_routes.<route> (converting JSON envelopes to OpenAI multipart by default)
POST /v1/chat/completions Chat JSON forwarded to the matching chat_routes.<model> upstream