Authentication Methods
MemoryLake API supports two authentication methods:1. Session Authentication
For web applications where users log in:- Session cookies automatically included
- No additional headers needed
- Inherits user permissions
2. API Key Authentication (MCP Servers)
For external applications and AI models:- Use API keys generated in projects
- Include in Authorization header
- Project-scoped access
API Key Authentication
Obtaining an API Key
- Navigate to a project
- Go to MCP Servers tab
- Click “Add MCP Server”
- Copy the generated secret
Using API Keys
Include API key in Authorization header:Example Request
Response
Error Responses
401 Unauthorized
API key missing or invalid:- Verify API key is included in Authorization header
- Check key format:
Bearer YOUR_KEY - Ensure key hasn’t been deleted
- Generate new key if lost
403 Forbidden
Valid authentication but insufficient permissions:- Verify project ID is correct
- Check API key is for the correct project
- Ensure resource exists
Security Best Practices
Secure Storage
Secure Storage
- Store API keys in environment variables
- Never commit keys to version control
- Use secrets management services
- Rotate keys periodically
Key Management
Key Management
- Create separate keys per environment
- Use descriptive names for keys
- Delete unused keys promptly
- Monitor key usage
Request Security
Request Security
- Always use HTTPS
- Don’t log API keys
- Implement request timeouts
- Handle errors gracefully