Skip to content

API Reference

Starpod exposes a REST API and WebSocket endpoint through the starpod-gateway crate.

Base URL

http://localhost:3000/api

Authentication

API key authentication is enabled automatically when the first admin user is bootstrapped on startup. Keys use the sp_live_ prefix and are verified against argon2id hashes in the database.

HTTP requests — include the key in the X-API-Key header:

bash
curl -H "X-API-Key: sp_live_..." http://localhost:3000/api/sessions

WebSocket — pass the key as a query parameter:

ws://localhost:3000/ws?token=sp_live_...

Verify — check if a key is valid (never returns 401):

bash
curl -H "X-API-Key: sp_live_..." http://localhost:3000/api/auth/verify
# → { "authenticated": true, "auth_disabled": false, "user": { "id": "...", "role": "admin" } }

When no users exist yet (fresh install), all endpoints are accessible without a key.

Endpoints

MethodPathDescription
GET/api/auth/verifyVerify API key validity
POST/api/chatSend a chat message
GET/api/sessionsList recent sessions
GET/api/sessions/:idGet session metadata
GET/api/sessions/:id/messagesGet session messages
GET/api/memory/searchFull-text memory search
POST/api/memory/reindexRebuild FTS5 index
GET/api/instancesList remote instances
POST/api/instancesCreate a new instance
GET/api/instances/:idGet instance details
DELETE/api/instances/:idDelete (kill) an instance
POST/api/instances/:id/pausePause an instance
POST/api/instances/:id/restartRestart an instance
GET/api/instances/:id/healthInstance health info
GET/api/healthHealth check
GET/PUT/api/settings/generalGeneral config (model, provider, limits)
GET/api/settings/modelsWell-known models per provider
GET/PUT/api/settings/memoryMemory settings
GET/PUT/api/settings/cronCron settings
GET/PUT/api/settings/channelsChannel settings (Telegram enabled, gap, stream mode)
GET/PUT/api/settings/frontendFrontend config (greeting, prompts)
GET/PUT/api/settings/files/:nameAgent personality files (SOUL.md, etc.)
GET/POST/api/settings/auth/usersList / create auth users
GET/PUT/api/settings/auth/users/:idGet / update auth user
GET/PUT/DELETE/api/settings/auth/users/:id/telegramPer-user Telegram linking
GET/POST/api/settings/auth/users/:id/api-keysUser API key management
POST/api/settings/auth/api-keys/:id/revokeRevoke an API key

WebSocket

PathDescription
/wsStreaming chat via WebSocket

Error Responses

Errors return JSON with an appropriate HTTP status code:

json
{
  "error": "Unauthorized"
}
StatusMeaning
401Missing or invalid API key
403Forbidden (e.g. non-admin accessing settings)
404Resource not found
429Rate limit exceeded
500Internal server error

Released under the MIT License.