API Reference
Authentication

Authentication

Learn how to authenticate API requests to deadend.ai.

API Keys

All API requests require authentication using an API key. You can create and manage API keys from your dashboard (opens in a new tab).

Authentication Method

All protected endpoints require API key authentication via Bearer token:

Authorization: Bearer <your-api-key>

Example

curl -X POST https://api.deadend.ai/v1/suggest \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "/products/blue-widget",
    "limit": 3
  }'

Getting Your API Key

  1. Log in to your deadend.ai dashboard (opens in a new tab)
  2. Navigate to SettingsAPI Keys
  3. Click Create API Key
  4. Copy and securely store your key

Using API Keys

Important: All API calls must be made from your server, never from the browser. API keys should only be used in server-side code. Your application server acts as a proxy between browsers and the deadend.ai API, keeping your API keys secure.

Security Best Practices

Do's ✅

  • Store API keys in environment variables
  • Never commit API keys to version control
  • Rotate keys regularly
  • Delete unused keys

Don'ts ❌

  • Never commit keys to Git
  • Don't share keys in chat/email
  • Don't expose keys in frontend code

Error Responses

Invalid API Key

{
  "error": {
    "code": "invalid_api_key",
    "message": "The API key provided is invalid"
  }
}

HTTP Status: 401 Unauthorized

Insufficient Permissions

{
  "error": {
    "code": "insufficient_permissions",
    "message": "API access not available. Please upgrade your plan."
  }
}

HTTP Status: 403 Forbidden

This error occurs when API access is restricted or the API key doesn't have sufficient permissions.

Next Steps