Local Context API · /v1
Small packets. Clear boundaries.
All endpoints bind to loopback and require a per-process bearer token. The API is local-first in v1; hosted accounts and public provider calls are deferred.
Base URL:
http://127.0.0.1:<ephemeral-port>/v1. The TUI starts the API automatically and falls back in-process if a loopback listener is unavailable.| Method | Path | Purpose |
|---|---|---|
| GET | /health | Service status and connector count |
| POST | /sessions | Create a session with cap, pack size, and weights |
| POST | /context/chunks | Ingest a context chunk and vector |
| POST | /context/query | Retrieve the packet |
| GET | /connectors | List real endpoint manifests |
| POST | /connectors/discover | Import manifests |
| POST | /connectors/:id/allow | Allowlist an endpoint |
| POST | /connectors/:id/report | Freeze / report / blacklist |
| POST | /hunts/estimate | Estimate calls and $0.50 default price |
| POST | /hunts | Execute a stateless pack turn |
| GET | /proofs/:id | Read the signed proof chain record |
Hunt request
{
"sessionId": "session-uuid",
"prompt": "Compare approaches and return a concise recommendation.",
"responseMode": "text",
"packSize": 24,
"wideHunt": false,
"outputLimit": 500
}
Invariants
- No connector receives the session transcript.
- No failed gate commits a charge.
- No secret is written to SQLite or logs.
- No model holds the context hive.