API Keys
Egg API uses API keys for authentication. Each request must include your API key in theAuthorization header.
Getting Your API Key
1
Sign up
Create an account at eggapi.ai
2
Go to Dashboard
Navigate to the API Keys section
3
Create a Key
Click “Create API Key” and give it a descriptive name
4
Copy and Store
Copy your key immediately - it won’t be shown again
Using Your API Key
Include your API key in theAuthorization header with the Bearer prefix:
Security Best Practices
Do’s
- Store API keys in environment variables
- Use server-side code to make API calls
- Rotate keys periodically
- Create separate keys for different environments (dev, staging, prod)
Don’ts
- Hardcode API keys in your source code
- Commit API keys to version control
- Share API keys in chat or email
- Use the same key for all environments
Environment Variables
Store your API key in an environment variable:.env
Authentication Errors
If authentication fails, you’ll receive a401 Unauthorized response:
- Missing
Authorizationheader - Missing
Bearerprefix - Invalid or revoked API key
- Typo in the API key
Managing API Keys
From your dashboard, you can:- Create new API keys
- View existing keys (partial display only)
- Revoke compromised keys
- Track usage per key
If you suspect your API key has been compromised, revoke it immediately and create a new one.