Mycelos logo mycelos

API Reference

The Gateway exposes a RESTful HTTP API on port 9100. All endpoints return JSON unless noted otherwise.

Authentication

When MYCELOS_PASSWORD is set in .env, every endpoint requires HTTP Basic Auth. Username is ignored; the password is checked against MYCELOS_PASSWORD in constant time. Set this as soon as you expose the gateway beyond 127.0.0.1 — there is no other authentication layer in v0.3 (passkey ships in Phase 2).

/api/health and /healthz remain unauthenticated so Docker healthchecks and external probes can verify the service is up without a password.

Chat

MethodEndpointDescription
POST/api/chatSend a message and receive a streamed response via Server-Sent Events (SSE). Body: { "message": "...", "session_id": "..." }

Sessions

MethodEndpointDescription
GET/api/sessionsList all chat sessions.
GET/api/sessions/{id}/messagesRetrieve all messages for a specific session.

Knowledge

MethodEndpointDescription
GET/api/knowledge/notesList all notes in the knowledge base.
POST/api/knowledge/searchFull-text search across notes. Body: { "query": "..." }

Connectors

MethodEndpointDescription
GET/api/connectorsList all configured MCP connectors.
POST/api/connectorsAdd a new MCP connector. Body: { "name": "...", "command": "...", "secrets": [...] }
DELETE/api/connectors/{name}Remove a connector by name.

Agents

MethodEndpointDescription
GET/api/agentsList all registered agents.
GET/api/agents/{id}Get details for a specific agent.

Models

MethodEndpointDescription
GET/api/modelsList all available LLM models from configured providers.

Cost

MethodEndpointDescription
GET/api/cost?period=today|week|monthGet token usage and cost breakdown for the specified period.

Config

MethodEndpointDescription
GET/api/configGet the current active configuration.
GET/api/config/generationsList all config generations with timestamps.
POST/api/config/rollbackRoll back to a specific config generation. Body: { "generation": N }

Health

MethodEndpointDescription
GET/api/healthHealth check endpoint. Returns { "status": "ok" } when the Gateway is running.