Bernstein Plans API
The plans API from Bernstein — 8 operation(s) for plans.
The plans API from Bernstein — 8 operation(s) for plans.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/bernstein-run:bernstein-run-plans-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a 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.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Bernstein Task Server Plans 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: Plans
paths:
/plans:
get:
tags:
- Plans
summary: List Plans
description: 'List all plans, optionally filtered by status.
Query params:
status: Filter by plan status (pending, approved, rejected, expired).'
operationId: list_plans_plans_get
parameters:
- name: status
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Status
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
type: object
additionalProperties: true
title: Response List Plans Plans Get
'400':
description: Invalid status filter
'404':
description: Plan mode is not enabled on this server
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/plans/{plan_id}:
get:
tags:
- Plans
summary: Get Plan
description: Get a single plan by ID.
operationId: get_plan_plans__plan_id__get
parameters:
- name: plan_id
in: path
required: true
schema:
type: string
title: Plan Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Get Plan Plans Plan Id Get
'404':
description: Plan not found, or plan mode is not enabled on this server
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/plans/{plan_id}/approve:
post:
tags:
- Plans
summary: Approve Plan
description: 'Approve a plan: promotes all its PLANNED tasks to OPEN.
This is the key operation: once approved, the orchestrator will
pick up the tasks and start spawning agents.'
operationId: approve_plan_plans__plan_id__approve_post
parameters:
- name: plan_id
in: path
required: true
schema:
type: string
title: Plan Id
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/PlanDecisionRequest'
- type: 'null'
title: Body
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Approve Plan Plans Plan Id Approve Post
'404':
description: Plan not found, or plan mode is not enabled on this server
'409':
description: Plan already decided, or the plan changed after it was rendered for review
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/plans/{plan_id}/reject:
post:
tags:
- Plans
summary: Reject Plan
description: 'Reject a plan: cancels all its PLANNED tasks.
Rejected tasks are moved to CANCELLED status so they never execute.'
operationId: reject_plan_plans__plan_id__reject_post
parameters:
- name: plan_id
in: path
required: true
schema:
type: string
title: Plan Id
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/PlanDecisionRequest'
- type: 'null'
title: Body
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Reject Plan Plans Plan Id Reject Post
'404':
description: Plan not found, or plan mode is not enabled on this server
'409':
description: Plan already decided, or the plan changed after it was rendered for review
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/plans:
get:
tags:
- Plans
summary: List Plans
description: 'List all plans, optionally filtered by status.
Query params:
status: Filter by plan status (pending, approved, rejected, expired).'
operationId: list_plans_api_v1_plans_get
parameters:
- name: status
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Status
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
type: object
additionalProperties: true
title: Response List Plans Api V1 Plans Get
'400':
description: Invalid status filter
'404':
description: Plan mode is not enabled on this server
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/plans/{plan_id}:
get:
tags:
- Plans
summary: Get Plan
description: Get a single plan by ID.
operationId: get_plan_api_v1_plans__plan_id__get
parameters:
- name: plan_id
in: path
required: true
schema:
type: string
title: Plan Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Get Plan Api V1 Plans Plan Id Get
'404':
description: Plan not found, or plan mode is not enabled on this server
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/plans/{plan_id}/approve:
post:
tags:
- Plans
summary: Approve Plan
description: 'Approve a plan: promotes all its PLANNED tasks to OPEN.
This is the key operation: once approved, the orchestrator will
pick up the tasks and start spawning agents.'
operationId: approve_plan_api_v1_plans__plan_id__approve_post
parameters:
- name: plan_id
in: path
required: true
schema:
type: string
title: Plan Id
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/PlanDecisionRequest'
- type: 'null'
title: Body
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Approve Plan Api V1 Plans Plan Id Approve Post
'404':
description: Plan not found, or plan mode is not enabled on this server
'409':
description: Plan already decided, or the plan changed after it was rendered for review
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/plans/{plan_id}/reject:
post:
tags:
- Plans
summary: Reject Plan
description: 'Reject a plan: cancels all its PLANNED tasks.
Rejected tasks are moved to CANCELLED status so they never execute.'
operationId: reject_plan_api_v1_plans__plan_id__reject_post
parameters:
- name: plan_id
in: path
required: true
schema:
type: string
title: Plan Id
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/PlanDecisionRequest'
- type: 'null'
title: Body
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Reject Plan Api V1 Plans Plan Id Reject Post
'404':
description: Plan not found, or plan mode is not enabled on this server
'409':
description: Plan already decided, or the plan changed after it was rendered for review
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
PlanDecisionRequest:
properties:
reason:
type: string
title: Reason
default: ''
type: object
title: PlanDecisionRequest
description: Body for POST /plans/{plan_id}/approve or /reject.
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError