Getting an API Key
- Sign up or log in at langdex.co/dashboard
- Navigate to Settings > API Keys
- Click Create API Key
- Copy your key (it won’t be shown again)
Using Your API Key
Include your API key in theAuthorization header:
API Key Types
| Type | Use Case | Permissions |
|---|---|---|
| Public | Client-side apps | Read-only, rate-limited |
| Secret | Server-side apps | Full access |
| Test | Development | Sandbox data only |
Authentication Errors
401 Unauthorized
Missing or invalid API key:403 Forbidden
Valid key but insufficient permissions:Rate Limits by Key Type
| Key Type | Rate Limit | Monthly Quota |
|---|---|---|
| Public | 10 req/s | 10,000 |
| Secret | 50 req/s | 100,000 |
| Enterprise | 200 req/s | Unlimited |
Rotating API Keys
To rotate your API key:- Create a new API key
- Update your application to use the new key
- Delete the old key
API keys can be deleted immediately, but this will break any applications still using them.
Security Best Practices
Use environment variables
Use environment variables
Never hardcode API keys. Use environment variables:
Use server-side requests
Use server-side requests
Make API calls from your backend, not from client-side JavaScript.
Restrict key permissions
Restrict key permissions
Create keys with only the permissions needed for each use case.
Monitor usage
Monitor usage
Check your dashboard regularly for unexpected usage patterns.