Skip to main content

bonito-api

The FastAPI query layer of Bonito (BON-003). Exposes the data stored by bonito-store as structured JSON for AI agents, the MCP server (BON-004) and Remo (R-007).

Contract public, deployment private. /openapi.json + /docs are the public contract (no auth) — every consumer implements against them. The data endpoints are private: every request needs X-API-Key (or Authorization: Bearer) matching BONITO_API_KEY.

Run

uv pip install -e bonito-api
export BONITO_API_KEY=change-me
bonito-api serve --db bonito.db          # FastAPI on :8100
curl -H "X-API-Key: $BONITO_API_KEY" localhost:8100/queries/top?limit=5
curl -H "X-API-Key: $BONITO_API_KEY" localhost:8100/baseline/-6842865755026457642

Endpoints

Endpoint Description
GET /queries/top?period=&limit= Top queries by mean execution time
GET /locks/active Recent lock events / blocking pairs
GET /waits Wait breakdown by wait_event_type
GET /plans/{fingerprint} Latest execution plan (JSON) for a query
GET /health/{db_instance} Session + bloat summary
GET /baseline/{fingerprint} Query vs its 7-day baseline (mean/p95 + regression)
POST /ingest Compat webhook — same payload as the store's /events

The committed openapi.yaml is the versioned public contract.

Config

Env var Default Description
BONITO_API_KEY (required) API key for all data endpoints
BONITO_DB bonito.db SQLite file written by bonito-store
BONITO_API_PORT 8100 HTTP port

Metadata

Release files for bonito-api 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bonito-api 0.2.0
File Size Uploaded
bonito_api-0.2.0.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bonito-api 0.2.0
File Interpreter ABI Platform
bonito_api-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / bonito_api-0.2.0.tar.gz

Download URL bonito_api-0.2.0.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4193e707a05e42d324d933a62874ecd7b2bea3f6607935cebaf54539df859a3f
BLAKE2b-256 checksum
How to use checksums
169c29b753102991ff73f7d593e63d70f3f46db1b481b70a768d48e4183777c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Release files / bonito_api-0.2.0-py3-none-any.whl

Download URL bonito_api-0.2.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e1f58cb5e7c54b4ce507df4166bbbcf6eb641dfa7ec3156bcfcf7656c7d0a31
BLAKE2b-256 checksum
How to use checksums
f02d0f0cf1672cf400202ec658d4614536a837d915b310856f3a0243125d36fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.17

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page