Skip to main content

HTTP API

Run sxth-mind as an HTTP service.

Starting the Server

Options:
  • --adapter — Adapter to use (sales, habits, learning)
  • --port — Port to bind (default: 8000)
  • --host — Host to bind (default: 0.0.0.0)
  • --storage — Storage backend (memory, sqlite)
  • --db-path — SQLite database path

Endpoints

Health Check

Response:

Chat

Send a message and get a response. State is managed automatically. Request:
Response:

Chat Stream

Stream a response via Server-Sent Events. Request:
Response (SSE):

Get State

Retrieve cognitive state for a user. Response:

Explain State

Get a human-readable summary. Response:

Get Nudges

Get pending nudges for a user. Response:

Generate Nudges

Generate new nudges based on current state. Response:

Dismiss Nudge

Mark a nudge as dismissed. Response:

Act on Nudge

Mark a nudge as acted upon. Response:

Programmatic Usage

Create a custom FastAPI app:

Security Note

The HTTP API has no built-in authentication. For production:
  1. Mount into your own app with your auth middleware
  2. Use a reverse proxy with authentication
  3. Deploy in a private network
See SECURITY.md for details.