API Keys
Eventop uses API keys to authenticate requests. Your API keys carry significant privileges, so keep them secure!Key Types
Test Keys
Format:
sk_test_...- Use with Devnet environment
- No real funds
- Safe for development and testing
Live Keys
Format:
sk_live_...- Use with Mainnet environment
- Real cryptocurrency transactions
- Production use only
Creating API Keys
1
Navigate to Settings
2
Click Create API Key
Choose a descriptive name and select the environment
3
Save Your Key
Copy the key immediately - it’s only shown once!
4
Store Securely
Save the key in your environment variables or secrets manager
Using API Keys
Include your API key in theAuthorization header with the Bearer scheme:
Environment Variables
Store API keys in environment variables:Key Management
Rotating Keys
Rotate your API keys periodically for security:1
Create New Key
Generate a new API key in the dashboard
2
Update Your Code
Deploy your application with the new key
3
Verify Operation
Confirm everything works with the new key
4
Revoke Old Key
Delete the old key from the dashboard
Revoking Compromised Keys
If an API key is compromised:- Immediately revoke it in the dashboard
- Create a new key with a different name
- Update your application with the new key
- Review recent activity for suspicious requests
Security Best Practices
Use Environment Variables
Use Environment Variables
Never hardcode API keys in your source code. Use environment variables or a secrets manager.
Separate Test and Live Keys
Separate Test and Live Keys
Use different keys for development and production. Never use live keys in testing.
Restrict Key Permissions
Restrict Key Permissions
Create separate keys for different purposes (e.g., one for checkouts, one for webhooks).
Monitor Key Usage
Monitor Key Usage
Check the “Last Used” timestamp in the dashboard to detect unauthorized usage.
Rotate Keys Regularly
Rotate Keys Regularly
Rotate API keys every 90 days as a security best practice.
Troubleshooting
401 Unauthorized
401 Unauthorized
Environment Mismatch
Environment Mismatch
Problem: Using a test key on mainnet URLs or vice versa.Solution:
- Test keys (
sk_test_...) only work withapi-devnet.eventop.xyz - Live keys (
sk_live_...) only work withapi.eventop.xyz - Let the SDK auto-detect the environment from your key prefix