All Motte API endpoints require authentication using API keys. Learn how to obtain, manage, and use your API keys securely.
Motte uses API key authentication for all requests. Your API key identifies your account and provides access to your resources. Always keep your API keys secure and never expose them in client-side code.
Create an account at motte.ai if you haven't already.
Navigate to your account dashboard and go to the "API Keys" section.
Click "Generate New API Key" and give it a descriptive name for easy identification.
Copy your API key immediately and store it securely. You won't be able to see it again.
Include your API key in the Authorization header of every request using the Bearer token format:
Authorization: Bearer YOUR_API_KEY_HERE
curl -X POST https://api.motte.ai/api/memory/search \ -H "Authorization: Bearer YOUR_API_KEY_HERE" \ -H "Content-Type: application/json" \ -d '{ "query": "customer support best practices", "limit": 5 }'
const response = await fetch('https://api.motte.ai/api/memory/search', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY_HERE', 'Content-Type': 'application/json' }, body: JSON.stringify({ query: 'customer support best practices', limit: 5 }) }); const data = await response.json();
import requests headers = { 'Authorization': 'Bearer YOUR_API_KEY_HERE', 'Content-Type': 'application/json' } data = { 'query': 'customer support best practices', 'limit': 5 } response = requests.post( 'https://api.motte.ai/api/memory/search', headers=headers, json=data ) result = response.json()
Store API keys in environment variables, never hardcode them in your source code.
# .env file MOTTE_API_KEY=your_api_key_here # In your code const apiKey = process.env.MOTTE_API_KEY;
Regularly rotate your API keys, especially if you suspect they may have been compromised.
Use different API keys for different environments (development, staging, production) and limit their scope when possible.
Monitor your API key usage regularly and set up alerts for unusual activity patterns.
Missing or invalid API key
{ "error": { "code": "UNAUTHORIZED", "message": "Invalid API key provided" } }
API key doesn't have required permissions
{ "error": { "code": "FORBIDDEN", "message": "API key does not have permission to access this resource" } }
Rate limit exceeded
{ "error": { "code": "RATE_LIMIT_EXCEEDED", "message": "Too many requests. Please try again later.", "retry_after": 60 } }
Endpoint Category | Rate Limit | Burst Limit |
---|---|---|
General API | 1000/hour | 100/minute |
Training API | 10/hour | 5/minute |
Memory API | 5000/hour | 500/minute |
Monitoring API | 2000/hour | 200/minute |