Getting Started
Authentication
API authentication and security
Overview
All RunAgent API requests require authentication using API keys. This guide covers how to obtain, use, and manage API keys securely.
Obtaining API Keys
Via CLI
Via Dashboard
- Log in to dashboard.run-agent.ai
- Navigate to API Keys section
- Click “Create New Key”
- Copy and save securely
Using API Keys
Header Authentication
Include your API key in the Authorization header:
SDK Authentication
Environment Variable
Set the API key as an environment variable:
API Key Types
Personal Keys
- Tied to your user account
- Full access to your resources
- Should not be shared
Service Keys
- For production applications
- Limited scope and permissions
- Can be revoked independently
Temporary Keys
- Short-lived tokens
- For testing or demos
- Auto-expire after set time
Security Best Practices
Key Storage
Never commit API keys to version control or expose them in client-side code.
DO:
DON’T:
Key Rotation
Regularly rotate your API keys:
Scope Limitation
Create keys with minimal required permissions:
Request Signing
For additional security, enable request signing:
OAuth 2.0 (Coming Soon)
Future support for OAuth 2.0 flow:
Rate Limiting
API keys have associated rate limits:
Tier | Requests/Hour | Burst |
---|---|---|
Free | 100 | 10 |
Pro | 1,000 | 100 |
Enterprise | Custom | Custom |
Rate limit headers:
IP Whitelisting
Restrict API key usage to specific IPs:
Monitoring Key Usage
Via CLI
Via API
Error Responses
Invalid Key
Expired Key
Rate Limited
Troubleshooting
Key Not Working
- Check key format (should start with
ra_
) - Verify key hasn’t expired
- Ensure proper Authorization header format
- Check IP whitelist settings
- Verify rate limits haven’t been exceeded
Permission Denied
- Check key scope and permissions
- Verify resource ownership
- Ensure key is active
- Check organization settings
See Also
- API Introduction - API overview
- Error Handling - Error responses
- Rate Limits - Rate limiting details