Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Bernstein Task Server Slo API
description: 'Bernstein REST API - the open-source governance layer for AI agents, one git worktree per task.
## Authentication
Authentication is ENABLED by default. Include a Bearer token in all requests:
```
Authorization: Bearer
```
To run without auth (development only), set `BERNSTEIN_AUTH_DISABLED=1` - this logs a loud warning and passes every request through.
Public endpoints (no auth required): `/health`, `/health/ready`, `/health/live`, `/ready`, `/alive`, `/.well-known/agent.json`, `/docs`, `/openapi.json`, and the auth-flow endpoints (`/auth/login`, `/auth/oidc/callback`, etc.).
Webhook and hook endpoints (`/webhook`, `/webhooks/*`, `/hooks/{session_id}`) authenticate via HMAC-SHA256 signatures - they do NOT accept Bearer tokens.
## Base URL
Default: `http://127.0.0.1:8052`. Override with env vars `BERNSTEIN_HOST` and `BERNSTEIN_PORT`.
## Error Format
All errors return JSON with a `detail` field:
```json
{"detail": "Task not found: task-xyz"}
```
| Status | Meaning |
|--------|---------|
| 400 | Bad request (validation error) |
| 401 | Unauthorized (missing/invalid token) |
| 403 | Forbidden (IP not in allowlist) |
| 404 | Resource not found |
| 409 | Conflict (task already in terminal state) |
| 429 | Rate limited - respect the `Retry-After` header |
| 500 | Internal server error |'
version: 3.22.0
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
contact:
name: Alex Chernysh
url: https://github.com/sipyourdrink-ltd/bernstein
servers:
- url: http://{host}:{port}
description: Task server started by the Bernstein CLI on the operator's own machine. There is no hosted instance; substitute the host and port of your install.
variables:
host:
default: 127.0.0.1
description: Interface the task server binds to. Loopback by default.
port:
default: '8052'
description: Task server port. Override with BERNSTEIN_PORT.
tags:
- name: Slo
paths:
/slo:
get:
summary: Get Slo Status
description: Return current SLO dashboard data.
operationId: get_slo_status_slo_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Slo
/slo/budget:
get:
summary: Get Error Budget
description: Return error budget details in focused format.
operationId: get_error_budget_slo_budget_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Slo
/slo/burndown:
get:
summary: Get Slo Burndown
description: 'Return SLO burn-down rate visualization data .
Provides:
- Current SLO compliance and error budget fraction
- Burn rate relative to the allowed failure rate (1.0 = on-target)
- Linear projection of days until the SLO is breached
- Sparkline data points for rendering a burn-down chart
- Human-readable breach projection summary
Example response::
{
"slo_name": "task_success",
"slo_target": 0.9,
"slo_current": 0.942,
"burn_rate": 0.3,
"burn_rate_per_day": 0.05,
"budget_fraction": 0.72,
"budget_consumed_pct": 28.0,
"days_to_breach": 6.1,
"breach_projection": "SLO will breach in 6.1 days at current rate",
"status": "green",
"sparkline": [...]
}'
operationId: get_slo_burndown_slo_burndown_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Slo
/slo/reset:
post:
summary: Reset Slo State
description: Reset SLO tracker to initial state (no persisted data cleared).
operationId: reset_slo_state_slo_reset_post
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Slo
/api/v1/slo:
get:
summary: Get Slo Status
description: Return current SLO dashboard data.
operationId: get_slo_status_api_v1_slo_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Slo
/api/v1/slo/budget:
get:
summary: Get Error Budget
description: Return error budget details in focused format.
operationId: get_error_budget_api_v1_slo_budget_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Slo
/api/v1/slo/burndown:
get:
summary: Get Slo Burndown
description: 'Return SLO burn-down rate visualization data .
Provides:
- Current SLO compliance and error budget fraction
- Burn rate relative to the allowed failure rate (1.0 = on-target)
- Linear projection of days until the SLO is breached
- Sparkline data points for rendering a burn-down chart
- Human-readable breach projection summary
Example response::
{
"slo_name": "task_success",
"slo_target": 0.9,
"slo_current": 0.942,
"burn_rate": 0.3,
"burn_rate_per_day": 0.05,
"budget_fraction": 0.72,
"budget_consumed_pct": 28.0,
"days_to_breach": 6.1,
"breach_projection": "SLO will breach in 6.1 days at current rate",
"status": "green",
"sparkline": [...]
}'
operationId: get_slo_burndown_api_v1_slo_burndown_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Slo
/api/v1/slo/reset:
post:
summary: Reset Slo State
description: Reset SLO tracker to initial state (no persisted data cleared).
operationId: reset_slo_state_api_v1_slo_reset_post
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Slo