Skip to main content

Authentication

The Case AI API uses Bearer token authentication. All API requests must include your API key in the Authorization header.

Getting Your API Key

  1. Log in to your buyer dashboard
  2. Navigate to Account > API Keys
  3. Click Create API Key
  4. Give your key a name and copy the generated key
Your API key will only be shown once. Store it securely and never expose it in client-side code.

Making Authenticated Requests

Include your API key in the Authorization header with the Bearer prefix:
curl -X GET "https://api.trycase.ai/api/v1/products" \
  -H "Authorization: Bearer cc_live_abc123xyz..."

API Key Format

API keys follow this format:
  • Test keys: cc_test_ prefix
  • Live keys: cc_live_ prefix
cc_live_a1b2c3d4e5f6g7h8i9j0...

Security Best Practices

Never commit API keys to version control or expose them in client-side JavaScript. Use environment variables instead.
Create separate API keys for development and production environments.
Regenerate your API keys periodically and immediately if you suspect they’ve been compromised.
Check your API key activity in the dashboard to detect unauthorized use.

Error Responses

If authentication fails, you’ll receive a 401 Unauthorized response:
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key"
  }
}