Authentication Method
CodeAlive uses Bearer token authentication in the Authorization header for all API calls:
curl -X GET https://app.codealive.ai/api/datasources/all \
-H "Authorization: Bearer YOUR_API_KEY"
This authentication method works consistently across all endpoints and integrations.
Obtaining Your API Key
Access Dashboard
Log in and navigate to your account dashboard
Generate API Key
- Navigate to MCP & API
- Click ”+ Create API Key”
- Copy your key immediately (it won’t be displayed again)
- Store it securely
API keys are shown only once when created. Store them securely and never commit them to version control.
Security Best Practices
Environment Variables
Store your API key in environment variables:
export CODEALIVE_API_KEY="your_api_key_here"
Then use it in your code:
import os
import requests
api_key = os.environ.get('CODEALIVE_API_KEY')
headers = {'Authorization': f'Bearer {api_key}'}
response = requests.get(
'https://app.codealive.ai/api/datasources/all',
headers=headers
)
Key Rotation
We recommend rotating your API keys periodically:
- Every 90 days for production environments
- Immediately if a key is compromised
- When team members leave your organization
Rate Limiting
API keys are subject to rate limits based on your plan:
| Plan | Requests/Hour | Concurrent Requests |
|---|
| Free | 100 | 5 |
| Pro | 1,000 | 20 |
| Team | 5,000 | 50 |
| Enterprise | Custom | Custom |
Rate limit information is included in response headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1642076400
Error Responses
Authentication failures return appropriate HTTP status codes:
401 Unauthorized
Missing or invalid API key:
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}
403 Forbidden
Valid key but insufficient permissions:
{
"error": {
"code": "FORBIDDEN",
"message": "API key does not have access to this resource"
}
}
429 Too Many Requests
Rate limit exceeded:
{
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Please retry after 1642076400"
}
}
Testing Authentication
Test your API key with this simple request:
curl -X GET https://app.codealive.ai/api/datasources/alive \
-H "Authorization: Bearer YOUR_API_KEY"
A successful response confirms your authentication is working. You’ll receive an array of available data sources:
Or if you have data sources:
[
{
"id": "60d21b4667d0d63ce0f9a1d1",
"name": "MyProject",
"type": "Repository"
}
]
Support
Having authentication issues? Contact us: