Skip to main content

Overview

Every API request needs an API key in the Authorization header. Get your key from the dashboard, add it to requests as a Bearer token, start building.
Keep your API key secure! Never expose your API key in client-side code or public repositories.

Getting Your API Key

  1. Sign up or log in at babou.ai
  2. Navigate to your Dashboard
  3. Go to SettingsAPI Keys
  4. Click Create New API Key
  5. Copy your key immediately (it won’t be shown again)
API keys follow the format: sk-bab-[random-string]

Making Authenticated Requests

Include your API key in the Authorization header of every request:
Authorization: Bearer sk-bab-your-api-key-here

Examples

curl https://api.babou.ai/api/v1/projects \
  -H "Authorization: Bearer sk-bab-your-api-key-here" \
  -H "Content-Type: application/json"

API Key Management

Security Best Practices

Never hardcode API keys in your source code. Use environment variables:
export BABOU_API_KEY=sk-bab-your-api-key-here
Or use a .env file (and add it to .gitignore):
BABOU_API_KEY=sk-bab-your-api-key-here
Create new API keys periodically and delete old ones from your dashboard to maintain security.
Create different API keys for development, staging, and production environments to isolate access.
Check your dashboard regularly for unexpected API usage that might indicate a compromised key.

Key Expiration

API keys can have expiration dates. You’ll receive a 401 Unauthorized error if your key has expired:
{
  "error": "API key has expired",
  "code": "API_KEY_EXPIRED"
}

Authentication Errors

Common Error Responses

UNAUTHORIZED
401
Invalid or missing API key
{
  "error": "Unauthorized - Invalid API key",
  "code": "UNAUTHORIZED"
}
INVALID_API_KEY_FORMAT
401
API key doesn’t match expected format (sk-bab-*)
{
  "error": "Invalid API key format",
  "code": "INVALID_API_KEY_FORMAT"
}
API_KEY_EXPIRED
401
The API key has expired
{
  "error": "API key has expired",
  "code": "API_KEY_EXPIRED"
}

Testing Your Authentication

Use this simple request to verify your API key is working:
curl https://api.babou.ai/api/v1/projects \
  -H "Authorization: Bearer sk-bab-your-api-key-here"

Next Steps