Authentication management
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
The default authentication method uses OAuth for maximum security:
Benefits:
- No manual API key handling
- Automatic token refresh
- Secure credential storage
- Organization access management
For CI/CD or scripting, use API keys:
Store API keys in configuration:
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
List all authenticated accounts:
Output:
Add accounts without affecting existing ones:
Switch between accounts instantly:
Assign meaningful aliases to accounts:
Separate environments
Agency workflow
Team collaboration
Get detailed information about current account:
Output:
View and manage API tokens:
The CLI stores credentials securely:
- macOS: Keychain
- Linux: Secret Service API / keyring
- Windows: Credential Manager
Keep environments separate:
For automated workflows:
Remove accounts when no longer needed:
For on-premise or custom deployments:
For server applications:
For corporate environments:
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:
Use clear, consistent aliases:
Keep your authentication clean:
Document account structure for your team:
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!