Skip to main content

Authentication & API Keys

Manage access to Enclava's API with API keys and permissions.

What You'll Learn​

Authentication Methods​

Enclava supports API key authentication for external client applications.

API Key Authentication​

Used for: External client applications

Include Authorization: Bearer YOUR_API_KEY header in requests.

curl -H "Authorization: Bearer en_xxxxxxxx" \
http://localhost/api/v1/chat/completions

Key Types​

Full Access Keys​

  • Access to all enabled features
  • All available models
  • Recommended for development and testing

Restricted Keys​

  • Limited to specific models
  • Can have budget limits
  • Recommended for production deployments
  • Can be scoped to specific features

Security Best Practices​

  1. Never Commit Keys - Store in environment variables, not in code
  2. Use Specific Keys - Create separate keys for different apps
  3. Rotate Regularly - Revoke and regenerate keys periodically
  4. Monitor Usage - Track which keys are using which resources
  5. Set Budgets - Limit potential financial exposure
  6. Revoke Unused Keys - Delete keys that are no longer needed

Next Steps​