Overview
AgentUse supports multiple AI providers. You need to authenticate with at least one provider to run agents.Supported Providers
Anthropic
Claude models (Opus, Sonnet, Haiku)
Supports OAuth and API keys
OpenAI
GPT models including GPT-5, GPT-4, GPT-4o
Supports OAuth and API keys
OpenRouter
Access to 100+ models via unified API
API key authentication
Authentication Methods
1. Interactive Login (Recommended)
The simplest way to authenticate:2. Environment Variables
Set API keys as environment variables:3. Configuration File
Create a.env file in your project:
Advanced Environment Variable Configuration
AgentUse supports flexible environment variable patterns for multiple API keys:Managing Credentials
List Stored Credentials
Remove Credentials
Rotate API Keys
Getting API Keys
Get API keys from provider consoles:- Anthropic: console.anthropic.com → API Keys → Create Key (starts with
sk-ant-api03-) - OpenAI: platform.openai.com → API Keys → Create new secret key (starts with
sk-proj-) - OpenRouter: openrouter.ai → Keys → Create Key (starts with
sk-or-v1-)
Authentication Priority Order
AgentUse checks authentication sources in this order:- OAuth tokens - Checked first and refreshed automatically
- Stored API keys (via
agentuse auth login) - Stored in~/.local/share/agentuse/auth.json - Environment variables -
ANTHROPIC_API_KEY,OPENAI_API_KEY,OPENROUTER_API_KEY - Custom environment variables - Using suffix patterns (e.g.,
ANTHROPIC_API_KEY_DEV) or full variable names
Runtime Model Override
Override the model at runtime using the--model flag:
CLI Commands - Model Override
See the complete reference for model override format, environment-specific keys, CI/CD examples, and sub-agent inheritance behavior.
Multi-Provider Setup
Use different providers for different agents:Provider Options
Configure provider-specific settings for fine-tuned model behavior:OpenAI Provider Options
For OpenAI models (especially GPT-5), you can control reasoning and verbosity:reasoningEffort: Controls computational effort for reasoning
low: Faster responses with less thorough reasoningmedium: Balanced performance (default)high: More comprehensive reasoning, slower responses
low: Concise, minimal prosemedium: Balanced detail (default)high: Verbose, detailed explanations
- Speed vs Quality: Lower reasoning effort for faster responses
- Conciseness vs Detail: Lower verbosity for more direct answers
- Cost Optimization: Lower settings reduce token usage
Troubleshooting
Authentication failed
Authentication failed
- Verify API key is correct
- Check key hasn’t expired
- Ensure key has required permissions
- Try logging out and back in
Rate limiting
Rate limiting
- Check your API tier and limits
- Implement exponential backoff
- Consider upgrading your plan
- Use different keys for different projects
