Usage
Description
Theprovider command group manages authentication for OAuth-based AI providers that require interactive login flows instead of static API keys.
Supported OAuth providers:
- OpenAI Codex: IDE integrations (Cursor, Windsurf)
- GitHub Copilot: GitHub-authenticated models
Subcommands
login
Authenticate with an OAuth provider.provider login
Authenticate with an OAuth provider using an interactive login flow.Usage
Arguments
OAuth provider name. Supported values:
openai-codexgithub-copilot
OpenAI Codex
Authenticate with OpenAI Codex (used by Cursor, Windsurf, and other AI coding tools).Usage
Requirements
- Python package:
oauth-cli-kit
First Login
Authorization Flow
- Browser opens automatically (or you click the URL)
- Log in with your OpenAI account
- Authorize the application
- Copy the authorization code
- Paste it in the terminal
Successful Authentication
Subsequent Logins
If already authenticated:Token Storage
Tokens are stored byoauth-cli-kit in:
- macOS: Keychain
- Linux: Secret Service (GNOME Keyring, KWallet)
- Windows: Credential Manager
Using OpenAI Codex
After authentication, configure your model:openai-codex/gpt-4oopenai-codex/gpt-4o-miniopenai-codex/gpt-4-turboopenai-codex/o1openai-codex/o1-mini
GitHub Copilot
Authenticate with GitHub Copilot using device flow.Usage
Device Flow
Authorization Steps
- Visit the URL shown
- Enter the device code
- Authorize GitHub Copilot access
- Return to terminal
Successful Authentication
Requirements
- GitHub Copilot subscription (Individual, Business, or Enterprise)
- LiteLLM with GitHub Copilot support
Using GitHub Copilot
After authentication, configure your model:github_copilot/gpt-4ogithub_copilot/gpt-4-turbogithub_copilot/claude-3.5-sonnetgithub_copilot/o1-previewgithub_copilot/o1-mini
Verifying Authentication
Check authentication status:Token Refresh
OAuth tokens are automatically refreshed when expired. If refresh fails:Logout
To remove OAuth credentials:OpenAI Codex
Tokens are managed byoauth-cli-kit. Remove manually:
GitHub Copilot
Tokens are managed by LiteLLM. Check LiteLLM docs for token location.Troubleshooting
oauth-cli-kit Not Installed
Browser Doesnβt Open
Invalid Authorization Code
- Ensure you copied the complete code
- Code may have expired - start over
- Try again:
nanobot provider login openai-codex
Authentication Failed
- Network connectivity issues
- Firewall blocking OAuth endpoints
- Proxy interfering with requests
- Invalid credentials
GitHub Copilot: No Subscription
Token Storage Failed
Provider Comparison
| Provider | Authentication | Models | Use Case |
|---|---|---|---|
| OpenAI Codex | OAuth browser flow | GPT-4o, o1, o1-mini | IDE integrations, power users |
| GitHub Copilot | Device code flow | GPT-4o, Claude, o1 | GitHub subscribers |
| OpenRouter | API key | 200+ models | General purpose, model variety |
| OpenAI | API key | GPT-4, GPT-3.5 | Official API access |
When to Use OAuth
Use OAuth providers when:- You have an existing subscription (Cursor, Windsurf, GitHub Copilot)
- You want unified billing
- You need specific model access
- You prefer browser-based authentication
- You want simple setup
- Youβre using scripts/automation
- You need multiple accounts
- You want explicit cost control
Exit Codes
- 0: Success
- 1: Error (authentication failed, network error, missing dependency)
- 130: Interrupted by user (Ctrl+C)
Related Commands
- status - Check authentication status
- agent - Use authenticated models
- onboard - Initial configuration