Authentication management
Overview
The Vapi CLI supports sophisticated authentication management, allowing you to work with multiple accounts, organizations, and environments seamlessly. This is perfect for developers who work across different teams, manage client accounts, or need to switch between production and staging environments.
In this guide, you’ll learn to:
- Authenticate with your Vapi account
- Manage multiple accounts simultaneously
- Switch between organizations and environments
- Configure API keys and tokens
Quick start
Authentication methods
OAuth login (recommended)
The default authentication method uses OAuth for maximum security:
Benefits:
- No manual API key handling
- Automatic token refresh
- Secure credential storage
- Organization access management
API key authentication
For CI/CD or scripting, use API keys:
Configuration file
Store API keys in configuration:
Multi-account management
Understanding accounts
Each authenticated account includes:
- User identity - Your email and user ID
- Organization - The Vapi organization you belong to
- API access - Permissions and API keys
- Environment - Production, staging, or custom
Viewing accounts
List all authenticated accounts:
Output:
Adding accounts
Add accounts without affecting existing ones:
Switching accounts
Switch between accounts instantly:
Account aliases
Assign meaningful aliases to accounts:
Common workflows
Development vs production
Separate environments
Agency workflow
Team collaboration
Account information
Get detailed information about current account:
Output:
Token management
View and manage API tokens:
Security best practices
Credential storage
The CLI stores credentials securely:
- macOS: Keychain
- Linux: Secret Service API / keyring
- Windows: Credential Manager
Environment isolation
Keep environments separate:
CI/CD integration
For automated workflows:
Revoking access
Remove accounts when no longer needed:
Advanced features
Custom API endpoints
For on-premise or custom deployments:
Service accounts
For server applications:
Proxy configuration
For corporate environments:
Troubleshooting
Login opens wrong browser
Configure default browser:
Token expired
If you see authentication errors:
Keychain access issues
For credential storage problems:
Organization access
If you can’t access organization resources:
- Verify organization membership in dashboard
- Check account permissions
- Re-authenticate:
Best practices
Account naming
Use clear, consistent aliases:
Regular maintenance
Keep your authentication clean:
Team documentation
Document account structure for your team:
Next steps
With authentication configured:
- Create assistants: Build voice assistants
- Initialize projects: Add Vapi to your codebase
- Test webhooks: Debug locally with any account
Security tip: Always use OAuth login for interactive use and API keys only for automation. Never commit API keys to version control!