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 Artifacts 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: Artifacts
paths:
/artifacts:
get:
summary: List Artifacts
description: Return every artifact key the local lineage spines carry.
operationId: list_artifacts_artifacts_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Artifacts
/artifacts/health:
get:
summary: Artifact Health
description: 'Return the canonical health verdict for ``?uri=``.
Query parameters:
* ``uri`` (required) - the artifact key.
* ``at`` - evaluation instant; defaults to the wall clock. Pin it to
reproduce a verdict byte-for-byte against the CLI.
* ``cadence_seconds`` - declared refresh cadence; omitted means the cadence
leg reports ``not_applicable``.
The body is the exact string the CLI prints for the same state and instant,
byte for byte. The status is always 200: the verdict is the payload, and a
red artifact is a successfully computed answer, not a failed request.'
operationId: artifact_health_artifacts_health_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Artifacts
/artifacts/log:
get:
summary: Artifact Log Route
description: 'Return productions of ``?uri=``, newest first (the attribution log).
Recorded attempts -- tasks that declared this artifact and did not deliver it
-- travel in the same document under ``attempts`` (issue #2559), so a
consumer cannot see the productions without also seeing what tried and
failed. Byte-identical to what the CLI prints for the same state.'
operationId: artifact_log_route_artifacts_log_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Artifacts
/api/v1/artifacts:
get:
summary: List Artifacts
description: Return every artifact key the local lineage spines carry.
operationId: list_artifacts_api_v1_artifacts_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Artifacts
/api/v1/artifacts/health:
get:
summary: Artifact Health
description: 'Return the canonical health verdict for ``?uri=``.
Query parameters:
* ``uri`` (required) - the artifact key.
* ``at`` - evaluation instant; defaults to the wall clock. Pin it to
reproduce a verdict byte-for-byte against the CLI.
* ``cadence_seconds`` - declared refresh cadence; omitted means the cadence
leg reports ``not_applicable``.
The body is the exact string the CLI prints for the same state and instant,
byte for byte. The status is always 200: the verdict is the payload, and a
red artifact is a successfully computed answer, not a failed request.'
operationId: artifact_health_api_v1_artifacts_health_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Artifacts
/api/v1/artifacts/log:
get:
summary: Artifact Log Route
description: 'Return productions of ``?uri=``, newest first (the attribution log).
Recorded attempts -- tasks that declared this artifact and did not deliver it
-- travel in the same document under ``attempts`` (issue #2559), so a
consumer cannot see the productions without also seeing what tried and
failed. Byte-identical to what the CLI prints for the same state.'
operationId: artifact_log_route_api_v1_artifacts_log_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
tags:
- Artifacts