Authentication
All API requests require authentication using an API key.
API Key Format
Include your API key in the Authorization header:
Authorization: Bearer sk-your-api-key
Security Features
Key Hashing
API keys are hashed using SHA-256 before storage. The full key is shown only once at creation time.
IP Whitelisting
Restrict API key usage to specific IP addresses:
- Configure up to 10 IP addresses or CIDR ranges per key
- Empty whitelist = no restriction (all IPs allowed)
- Manage in Dashboard > API Keys
Spend Limits
Set spending caps to prevent unexpected charges:
| Limit | Description |
|---|---|
| Hourly | Maximum credits consumed per hour |
| Daily | Maximum credits consumed per day |
| Total | Maximum total credits this key can ever consume |
Key Management
- Disable: Temporarily deactivate a key without deleting it
- Delete: Permanently remove a key
- Rotate: Create a new key and disable the old one
Error Responses
| Status | Code | Description |
|---|---|---|
| 401 | invalid_api_key | Key is invalid, disabled, or deleted |
| 403 | ip_not_allowed | Request IP not in allowlist |
| 429 | spend_limit_exceeded | Key spend limit reached |