Skip to main content

Base URL

http://localhost:5050/api/v1/

Authentication

All endpoints except:
  • GET /health
  • GET /oracle/producers/{producer_id}/provenance
require a bearer token. b1e55ed refuses to start if api.auth_token is empty unless B1E55ED_INSECURE_OK=1 is set.

Set the token (YAML)

# config/user.yaml
api:
  auth_token: "your-secret-token"

Set the token (environment)

export B1E55ED_API__AUTH_TOKEN="your-secret-token"

Use the token

curl \
  -H "Authorization: Bearer your-secret-token" \
  http://localhost:5050/api/v1/brain/status

Error format

Most b1e55ed API errors use a stable machine-readable structure:
{
  "error": {
    "code": "auth.invalid_token",
    "message": "Bearer token is invalid"
  }
}
Some endpoints may also return FastAPI default errors:
{"detail": "..."}

Rate limiting

Rate limiting is not currently enforced at the API layer.
Be reasonable anyway (especially for SSE reconnect loops and polling). Treat the API as if a soft limit exists.

Endpoint groups (quick reference)

GroupWhat it’s forKey endpoints
HealthLiveness + basic DB size/uptimeGET /health
BrainRegime/kill-switch state + run cyclesGET /brain/status, POST /brain/run
SignalsRead or submit signalsGET /signals, POST /signals/submit
Events / SSEReal-time stream of eventsGET /events/stream
PositionsOpen positions viewGET /positions, GET /positions/{id}
ProducersProducer registry + healthGET /producers/, GET /producers/status, POST /producers/register
ContributorsRegistry + scoring + attestationsGET /contributors/, POST /contributors/register, GET /contributors/leaderboard
Karma / TreasuryTreasury state + settlement projectionsGET /treasury (plus /karma/*)
OraclePublic provenance projectionGET /oracle/producers/{producer_id}/provenance

Quick curl examples

Health (no auth)

curl -s http://localhost:5050/api/v1/health | jq

Brain status (auth)

export TOKEN="your-secret-token"
curl -s \
  -H "Authorization: Bearer $TOKEN" \
  http://localhost:5050/api/v1/brain/status | jq