Skip to main content

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

1

Create Account

Sign up at app.codealive.ai if you haven’t already
2

Access Dashboard

Log in and navigate to your account dashboard
3

Generate API Key

  1. Navigate to MCP & API
  2. Click ”+ Create API Key”
  3. Copy your key immediately (it won’t be displayed again)
  4. 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:
PlanRequests/HourConcurrent Requests
Free1005
Pro1,00020
Team5,00050
EnterpriseCustomCustom
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: