API Overview
All Brainz Lab products expose REST APIs for integration.
Base URLs
| Product | URL |
|---|
| Platform | https://brainzlab.ai/api/v1 |
| Recall | https://recall.brainzlab.ai/api/v1 |
| Reflex | https://reflex.brainzlab.ai/api/v1 |
| Pulse | https://pulse.brainzlab.ai/api/v1 |
Authentication
All API requests require authentication via API key:
curl https://recall.brainzlab.ai/api/v1/logs \
-H "Authorization: Bearer sk_live_xxxxxxxx"
Or via header:
curl https://recall.brainzlab.ai/api/v1/logs \
-H "X-API-Key: sk_live_xxxxxxxx"
Key Types
| Key | Prefix | Use |
|---|
| Secret Key (Live) | sk_live_ | Server-side, full access |
| Secret Key (Test) | sk_test_ | Server-side, test environment |
| Public Key (Live) | pk_live_ | Client-side, read-only |
| Public Key (Test) | pk_test_ | Client-side, test environment |
Never expose your secret key in client-side code!
All POST/PUT requests should use JSON:
curl https://recall.brainzlab.ai/api/v1/logs \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-d '{"level": "info", "message": "Hello"}'
All responses are JSON:
{
"data": { ... },
"meta": {
"request_id": "req_abc123"
}
}
Error Responses
{
"error": {
"code": "invalid_api_key",
"message": "The API key provided is invalid"
}
}
HTTP Status Codes
| Code | Description |
|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden (feature not in plan) |
| 404 | Not Found |
| 429 | Rate Limited |
| 500 | Server Error |
Next Steps