Skip to main content

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

OpenCode Go

Low-cost open coding models curated by OpenCode API key authentication

Amazon Bedrock

Claude, Llama, Mistral, Nova and more via AWS AWS SigV4 or Bearer token

Custom / Local

Any OpenAI-compatible endpoint: Ollama, LM Studio, vLLM, llama.cpp, etc.

Authentication Methods

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:
Never commit .env files to version control! Add to .gitignore:

OpenCode Go

OpenCode Go provides curated open coding models through a low-cost OpenCode subscription. AgentUse treats it as a built-in provider and automatically routes each model to the correct OpenCode Go API shape.
Or configure it with an environment variable:
OpenCode Go publishes its live model list at https://opencode.ai/zen/go/v1/models, so opencode-go: model IDs are passed through rather than validated against AgentUse’s static model registry.

Amazon Bedrock

Bedrock authenticates with standard AWS credentials rather than agentuse provider login. Three modes are supported (in priority order): 1. Static IAM access keys (SigV4)
2. Bedrock API key (Bearer token)
3. AWS SDK credential provider chain, used automatically when neither of the above is set. Resolves AWS_PROFILE, ~/.aws/credentials, SSO cache, EC2/ECS/EKS instance roles, etc.
Use the full Bedrock model ID (which contains colons) as-is, or an inference profile ARN:
Your IAM user/role needs AmazonBedrockFullAccess (or an equivalent custom policy) and you must have requested access to the foundation model in the AWS console. The bedrock: prefix bypasses the static model registry, so any Bedrock model ID or inference-profile ARN is accepted.

Custom Providers (Local LLMs)

Connect to any OpenAI-compatible endpoint, Ollama, LM Studio, vLLM, llama.cpp, and more.

Adding a Custom Provider

Using Custom Providers

In your agent file:
Or override at runtime:
Custom providers support colons in model names, ollama:qwen3.5:0.8b is parsed as provider ollama, model qwen3.5:0.8b.

Environment Variable Overrides

Custom providers support env var overrides using the uppercased provider name:

Managing Custom Providers

Local model limitations:
  • Quality: Small models (under 30B parameters) often struggle with complex tool use, multi-step reasoning, and following detailed agent instructions. For best results, use 30B+ parameter models.
  • Context window: Ensure your model is loaded with a context size of at least 8192 tokens. AgentUse’s system prompts can exceed 4096 tokens.
  • Tool calling: Many local models have limited or no native tool/function calling support, which may cause agents with tools to fail or behave unpredictably.

Managing Credentials

List Stored Credentials

Output:

Remove Credentials

Rotate API Keys

Getting API Keys

Get API keys from provider consoles:
Keys are shown only once. Store them securely and never commit to version control.

Authentication Priority Order

AgentUse checks authentication sources in this order:
  1. OAuth tokens - Checked first and refreshed automatically
  2. Stored API keys (via agentuse provider login) - Stored in ~/.local/share/agentuse/auth.json
  3. Environment variables - ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, OPENCODE_GO_API_KEY
  4. 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: The simplest way to control how hard a model thinks is the top-level reasoning. It works across providers, AgentUse maps one level to each one’s native control (Anthropic thinking budget, OpenAI reasoning effort), so you set a single value and it works whether the agent runs on Claude or GPT-5:
Use medium/high for genuine judgment (hard multi-constraint calls, planning, debugging), low/minimal for lighter work, omit for the model default, and none to force reasoning off. It is opt-in and bills reasoning tokens at output rates. Reach for reasoning first. The provider-specific openai.reasoningEffort and anthropic.thinking.budgetTokens below are escape hatches for exact control, honored only when the top-level reasoning is unset. Being top-level, reasoning also avoids a subtle trap: a provider-specific key placed at the wrong nesting level is silently dropped (the agent parses and runs with the tuning never applied).

OpenAI Provider Options

For OpenAI models (especially GPT-5), you can control thinking effort and verbosity:
reasoningEffort: Controls thinking effort for reasoning
  • none: Disable reasoning when the selected model supports it
  • minimal: Use the lightest reasoning mode
  • low: Faster responses with less thorough reasoning
  • medium: Balanced performance (default)
  • high: More comprehensive reasoning, slower responses
  • xhigh: Maximum reasoning for models that support it
reasoningSummary: Streams a natural-language summary of the model’s reasoning so it appears inline in the session trace (auto or detailed). On reasoning-capable models this defaults to auto, the reasoning tokens are billed whether or not you ask for the summary, so surfacing it is near-free. Non-reasoning models (e.g. gpt-4o) omit it automatically.textVerbosity: Controls response length and detail
  • low: Concise, minimal prose
  • medium: Balanced detail (default)
  • high: Verbose, detailed explanations
prompt caching: AgentUse automatically sends a stable OpenAI promptCacheKey per agent so repeated runs with the same prompt prefix are easier for OpenAI to route to cache. You usually do not need to configure this. Set promptCacheRetention: 24h only when you want extended retention and the selected OpenAI model supports it.
If you omit reasoningEffort, textVerbosity, or promptCacheRetention, AgentUse leaves those fields unset and uses the OpenAI/AI SDK defaults. Reasoning effort is typically medium on reasoning models. none, xhigh, and 24h retention are model-specific OpenAI options; if a model does not support a selected option, OpenAI will reject the request. Whether a reasoning summary actually streams also depends on the effort level and task complexity.

Anthropic Provider Options

For Claude models, you can enable extended thinking so the model’s reasoning streams into the session trace:
Extended thinking is off by default, an explicit opt-in. Enabling it generates new thinking tokens billed at output rates, a real cost increase that scales with the budget (unlike OpenAI’s reasoningSummary, where the reasoning is billed either way). AgentUse automatically raises max_tokens above the budget so Anthropic’s max_tokens > budget constraint is met and there’s headroom for the answer.
These options help you optimize for:
  • 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
  • Reasoning visibility: reasoningSummary (OpenAI) and thinking (Anthropic) surface the model’s “why” inline in the session view

Troubleshooting

  • Verify API key is correct
  • Check key hasn’t expired
  • Ensure key has required permissions
  • Try logging out and back in
  • Check your API tier and limits
  • Implement exponential backoff
  • Consider upgrading your plan
  • Use different keys for different projects

CI/CD Authentication

For automated environments:

GitHub Actions

Docker

Next Steps

Quick Start

Start using your authenticated providers

Creating Agents

Build agents with your providers