API Keys
All API requests require an API key. Your key proves you have permission to access the API.Get Your API Key
Sign In
Go to https://agentclara.app and sign in.
Using Your API Key
Include your API key in every request as a Bearer token:YOUR_API_KEY with your actual key.
API Key Security
Protecting Your Key
Do:- ✅ Store in environment variables:
process.env.AGENTCLARA_API_KEY - ✅ Use
.envfiles (never commit to git) - ✅ Rotate keys periodically
- ✅ Use separate keys for different environments (dev, staging, prod)
- ✅ Restrict key permissions if available
- ❌ Hardcode keys in source code
- ❌ Commit keys to Git/GitHub
- ❌ Share keys in Slack/email
- ❌ Use in client-side code (browser/mobile)
- ❌ Use production keys in development
If Your Key is Compromised
- Go to Settings > Advanced > API Keys
- Find the compromised key
- Click Delete or Revoke
- Create a new key
- Update all your applications with the new key
Key Formats
Keys have this format:sk_- Prefix (indicates secret key)test_orlive_- Environment (test keys are safe for development)1234...- Random string (your unique key)
Multiple Keys
You can create multiple keys for:- Different environments - Separate keys for dev, staging, production
- Different applications - One key per app
- Team members - Each person has their own key (not shared)
Authentication Examples
JavaScript (Node.js)
Python
cURL
Ruby
Rate Limits
Your API key has rate limits:- 1,000 requests per minute (standard tier)
- 10,000 requests per minute (enterprise tier)
Handling Rate Limits
Best practice: Exponential backoffEnvironment Variables
Store your API key in.env:
Testing Your Key
Test if your key works:Troubleshooting
'Invalid API key' error
'Invalid API key' error
- Check you copied the full key (no extra spaces)
- Make sure the key hasn’t been revoked
- Verify you’re using the right environment (test vs. live)
'Unauthorized' error
'Unauthorized' error
I lost my API key
I lost my API key
You can’t recover it, but you can:
- Go to Settings > Advanced > API Keys
- Click Delete on the old key
- Create a new key
- Update your code with the new key
How do I rotate keys?
How do I rotate keys?
- Create a new key in the dashboard
- Update your applications to use the new key
- Wait a few minutes for existing requests to finish
- Delete the old key
- Done!
Next Steps
- Call the conversations endpoint - See Conversations
- Manage contacts - See Contacts
- Set up webhooks - See Webhooks
Questions? Email support@agentclara.ai