Authentication
Authentication
Learn how to authenticate and manage your API keys securely
The BrainUs API uses API keys to authenticate requests. API keys are unique identifiers that grant access to the API and track your usage against your plan limits.
Security First: Treat your API keys like passwords. Never expose them in client-side code, public repositories, or share them publicly.
Quick Example
curl -X POST "https://api.brainus.lk/api/v1/query" \
-H "X-API-Key: $BRAINUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "What is photosynthesis?", "store_id": "default"}'Getting Your API Key
- Sign up at developers.brainus.lk
- Navigate to Dashboard → API Keys
- Click "Generate New Key"
- Copy your key immediately (you won't see it again!)
Free accounts start with 300 requests/month. No credit card required!
Next Steps
- API Key Management - Create, rotate, and revoke keys
- Security Best Practices - Keep your keys safe
- Environment Setup - Configure your development environment