Skip to main content

Overview

Anannas uses Bearer token authentication via the Authorization header. All API requests require a valid API key.

API Keys

API keys are generated in the Anannas dashboard. Each key is associated with:
  • User account and organization
  • Credit limits and billing
  • Rate limits based on tier
  • Usage tracking and analytics

Authentication Header

Include your API key in the Authorization header:

Example

Security Best Practices

Store Keys Securely

Never commit API keys to version control. Use environment variables:

Key Rotation

If a key is compromised:
  1. Immediately revoke the key in the dashboard
  2. Generate a new key
  3. Update your application configuration
  4. Monitor for unauthorized usage

Key Scope

API keys have full access to:
  • All models available to your account
  • Credit balance and billing
  • Usage analytics
  • Rate limit quotas
Restrict key access at the application level if needed.

Error Responses

401 Unauthorized

Invalid or missing API key:
Common causes:
  • Missing Authorization header
  • Invalid key format
  • Revoked or expired key
  • Key not associated with active account

402 Payment Required

Insufficient credits:

Multiple Keys

You can create multiple API keys for:
  • Different environments (development, staging, production)
  • Different applications or services
  • Team members with separate usage tracking
Each key maintains independent usage statistics.

Key Management

Manage keys in the dashboard:
  • Create new keys
  • Revoke existing keys
  • View key usage and statistics
  • Set key-specific rate limits (if supported)

Testing Authentication

Verify your API key:
A successful response confirms authentication is working.