Authentication
The Darta API uses API key authentication. All requests must include a valid API key in the Authorization header.
API Key Authentication
All API requests must be authenticated using a Bearer token in the Authorization header:
Keep Your API Key Secret
Never expose your API key in client-side code, public repositories, or logs. Always use environment variables or secure credential management.
Getting Your API Key
To get your API key:
API Key Format
API keys start with darta_
followed by a unique identifier.
Making Authenticated Requests
Here are examples of how to include your API key in requests:
cURL
JavaScript
Python
Environment Variables
Always store your API key in environment variables for security:
.env File
Using Environment Variables
API Key Management
You can manage your API keys from the dashboard:
🔑 Multiple API Keys
Create multiple API keys for different applications or environments (development, staging, production).
🏷️ Key Naming
Give your API keys descriptive names to easily identify their purpose (e.g., "Production App", "Development", "Mobile App").
🔄 Key Rotation
Regularly rotate your API keys for security. Create a new key before deleting the old one to avoid downtime.
📊 Usage Monitoring
Monitor API key usage in the dashboard to track consumption and identify unusual activity.
Rate Limits
API keys are subject to rate limits based on your subscription plan:
Plan | Requests/Hour | Requests/Day | Concurrent |
---|---|---|---|
Free | 100 | 1,000 | 2 |
Starter | 1,000 | 10,000 | 5 |
Professional | 5,000 | 50,000 | 10 |
Enterprise | Custom | Custom | Custom |
Rate limits are enforced per API key. If you exceed your limits, you'll receive a 429 status code.
Error Responses
Authentication-related errors will return specific status codes:
401
UnauthorizedMissing or invalid API key
429
Rate LimitedToo many requests
403
ForbiddenInsufficient credits or permissions
Best Practices
✅ Do
- • Store API keys in environment variables
- • Use different keys for different environments
- • Implement proper error handling for auth failures
- • Monitor your API usage regularly
- • Rotate keys periodically
❌ Don't
- • Hardcode API keys in your source code
- • Commit API keys to version control
- • Share API keys between team members
- • Use production keys in development
- • Ignore rate limit responses
Need Help?
If you're having trouble with authentication, check our error handling guide or contact support.