REST API Quickstart
Get started with BrainTube's REST API — authentication, endpoints, and first call.
Access your BrainTube corpus programmatically via the REST API.
Authentication
Generate an API key from Settings → API Keys. Include it in requests:
Authorization: Bearer bt_sk_your_api_key_here
Example: Search Your Corpus
POST to the brain-api endpoint with your query and authorization header.
Available Endpoints
| Endpoint | Method | Description |
|---|---|---|
| /brain-api | POST | Main API — search, list, manage |
| /brain-chat | POST | Chat with a specific brain |
| /graph-enhanced-search | POST | Advanced semantic + graph search |
Response Format
All responses return JSON with success, data, and meta fields.
Error Handling
| Status | Meaning |
|---|---|
| 200 | Success |
| 401 | Invalid or missing API key |
| 403 | Insufficient permissions |
| 429 | Rate limit exceeded |
| 500 | Server error |
Still need help? Email support.