Skip to content

API Contract Index

The LingXiao Fastify server exposes HTTP REST + SSE + WebSocket + ACP JSON-RPC endpoints. There are 207 registered routes, assembled in src/server.ts, with 25 src/web-server/*Routes.ts files registering routes by module.

Endpoint GroupAuth MethodNotes
/health, /* (static web), /api/v1/acp/connectPublic / static / no authconnect stage returns connectionId + sessionToken
/api/v1/** (except acp/connect and /llm/*)server tokenheader x-lingxiao-token or ?token= query; hardened mode: header only
/api/v1/acp (GET SSE / POST JSON-RPC)server token + ACP credentialsheader acp-connection-id + acp-session-token
/llm/openai/v1/**, /llm/anthropic/v1/**gateway virtual keyheader Authorization: Bearer <key> or x-api-key
/api/v1/storage PUTserver tokenWrites to session_state immediately
  • In-process self-calls (no remoteAddress) → always exempt
  • Non-hardened mode localhost (127.0.0.1/::1) → exempt
  • Hardened mode / non-localhost → not exempt, 429 triggers cooldown
  • Non-loopback binding without hardening → strong warning, not gated
MethodPathDescription
GET/healthHealth probe, public
GET/*Static web assets + SPA fallback
MethodPathDescription
POST/api/v1/acp/connectGet connectionId + sessionToken
GET/api/v1/acpSSE connection (requires ACP credentials)
POST/api/v1/acpJSON-RPC request (requires ACP credentials)
DELETE/api/v1/acpDisconnect ACP connection

ACP JSON-RPC methods include: session/send, session/command, session/interrupt, session/hydrate, etc.

MethodPathDescription
GET/api/sessionsList all sessions
POST/api/sessionsCreate a new session
GET/api/v1/sessions/activeGet active session
POST/api/v1/sessions/side-threadCreate a side thread
MethodPathDescription
GET/api/v1/settingsGet settings (masked)
PUT/api/v1/settingsUpdate settings
GET/api/v1/model/listList configured models
PUT/api/v1/modelUpdate Leader model
GET/api/v1/prompt/listList available prompts
GET/api/v1/intuitionGet intuition runtime state
MethodPathDescription
GET/api/v1/rolesList role definitions
GET/api/v1/commandsList slash command registry
MethodPathDescription
GET/api/v1/tasksList tasks
POST/api/v1/tasksCreate a task
GET/api/v1/workflow/stateWorkflow state
POST/api/v1/workflow/toggleToggle workflow mode
MethodPathDescription
GET/api/v1/statsSession statistics
GET/api/v1/storageRead session_state key
PUT/api/v1/storageWrite session_state key
MethodPathDescription
GET/api/v1/filesList workspace files
GET/api/v1/files/contentRead file content
GET/api/v1/wikiWiki page list
GET/api/v1/git/statusGit status
POST/api/v1/git/initInitialize repository
GET/api/v1/git/platform/infoPlatform integration info
GET/api/v1/git/platform/mrsList MR/PR
POST/api/v1/git/platform/mrsCreate MR/PR
MethodPathDescription
GET/api/v1/worktreesList worktrees
POST/api/v1/worktreesCreate a worktree
GET/api/v1/worktrees/:idGet a single worktree
POST/api/v1/worktrees/:id/mergeMerge worktree branch
DELETE/api/v1/worktrees/:idRemove a worktree
MethodPathDescription
GET/api/v1/pluginsList plugins
POST/api/v1/mcp-forge/generateGenerate MCP server
GET/api/v1/design-market/themesList design themes
GET/api/v1/design-market/searchSearch design assets
MethodPathDescription
GET/llm/openai/v1/modelsOpenAI model list
POST/llm/openai/v1/chat/completionsOpenAI chat proxy
POST/llm/anthropic/v1/messagesAnthropic messages proxy
PathDescription
/ws/terminalTerminal PTY WebSocket
/ws/browserBrowser real-time interaction
StatusMeaning
401Unauthorized (token missing or invalid)
403Forbidden (hardened mode restriction)
404Resource not found
429Rate limited (30s cooldown)
500Internal server error