BrainAPI
BrainAPI
Reference

For the complete BrainAPI documentation index, see llms.txt. A markdown version of any docs page is available by appending .md to its URL. Docs MCP: /docs/mcp.

Regional API hosts

Call managed BrainAPI on the us-east1 and europe-central2 REST hosts

Managed BrainAPI REST is served at:

https://system.<region>.brainapi.lumen-labs.ai

The hosted regions are us-east1 and europe-central2. Do not use api.brain-api.dev as the product API; that hostname does not resolve.

Hosted engine version

These guides document engine 2.21.0. Public regional hosts may lag this documentation. On hosts that have not rolled 2.21.0, /model/facts and /retrieve/conflicts return 404 because those routes are not deployed yet. That 404 is not the 2.21.0 contract. A 404 on /retrieve/search is separate: Search is gated by SEARCH_ENABLED and stays off on hosted production.

Regions

RegionREST base
us-east1https://system.us-east1.brainapi.lumen-labs.ai
europe-central2https://system.europe-central2.brainapi.lumen-labs.ai

Self-hosted

http://localhost:8000

Example

export API_BASE="https://system.us-east1.brainapi.lumen-labs.ai"
export BRAINPAT_TOKEN="replace-with-your-token"
export BRAIN_ID="replacewithid"

curl --fail-with-body "$API_BASE/health"

curl --fail-with-body "$API_BASE/retrieve/context" \
  -H "BrainPAT: $BRAINPAT_TOKEN" \
  -H "X-Brain-ID: $BRAIN_ID" \
  -H "Content-Type: application/json" \
  -d '{"text":"What is in this brain?"}'

GET /health is public and is the liveness probe. The live body is {"status":"healthy"}. GET / requires the system PAT and is not a ping.

X-Brain-ID is the alphanumeric Brain ID from the dashboard Settings page, not the display name. Letters and digits only.

Hosted Search (/retrieve/search) is gated by SEARCH_ENABLED and is off in production. Use POST /retrieve/context unless your deployment has Search enabled.

On this page