Skip to main content

Connecting to External LLM Providers

ByteRover CLI supports connecting to external LLM providers, giving you access to hundreds of models beyond the built-in ByteRover LLM. Currently supports OpenRouter with 200+ models, with more providers coming soon.
This feature is in BETA. API keys are stored securely in your system keychain.

Supported Providers

ProviderDescriptionAPI KeyStatus
ByteRoverInternal ByteRover LLM (default)NoAvailable
OpenRouterAccess 200+ models from multiple providersYesAvailable
AnthropicDirect Claude API accessYesComing Soon
OpenAIDirect GPT API accessYesComing Soon
GoogleGemini modelsYesComing Soon
GroqFast inference modelsYesComing Soon

Quick Start

Connect to OpenRouter and select a model in under a minute:
1

Open provider selection

In the Console tab, run:
/provider
2

Select OpenRouter

Choose OpenRouter from the provider list.Provider selection
3

Enter your API key

Get your key at openrouter.ai/keys and paste it when prompted.API key prompt
4

Select a model

Browse and select from 200+ available models:
/model
Model browser

The /provider Command

Connect to or switch between LLM providers. Aliases: /providers, /connect

Behavior

  1. Displays a selection prompt with all available providers
  2. Shows connection status indicators:
    • (Current) - The active provider
    • [Connected] - Previously connected, API key stored
  3. If selecting an unconnected provider that requires an API key:
    • Prompts for the API key
    • Validates the key against the provider’s API
    • Stores the key securely in your system keychain
  4. Sets the selected provider as active

Examples

# Open provider selection dialog
/provider

# Also accessible via aliases
/providers
/connect

The /model Command

Browse and select models from your active provider. Aliases: /models
Requires an external provider to be connected. If using ByteRover (default), this command will prompt you to switch to an external provider.

Model Information Displayed

  • Model name and provider
  • Pricing (input/output cost per million tokens)
  • Context window size (e.g., “128K ctx”, “1.0M ctx”)
  • Status indicators:
    • (Current) - Currently selected model
    • - Favorited model
    • [Free] - Free to use

Sorting Order

  1. Favorite models (starred)
  2. Recently used models
  3. Alphabetically by provider, then model name
Models are cached for 1 hour to improve performance. The cache refreshes automatically when needed.

Favorites and Recent Models

ByteRover tracks your model preferences to make selection faster.

Favorite Models

Mark models as favorites to pin them at the top of the selection list. Favorites are indicated with a symbol.

Recent Models

Your 10 most recently used models appear after favorites in the selection list, making it easy to switch between frequently used models.

Configuration

Storage Locations

DataLocationPurpose
Provider config~/.config/brv/providers.jsonActive provider, favorites, recent models
API keysSystem keychainSecure credential storage

API Key Security

API keys are stored in your operating system’s secure keychain:

macOS

Keychain Access

Windows

Credential Manager

Linux

Secret Service (or encrypted file)

Configuration Structure

The provider configuration file stores non-sensitive preferences:
{
  "activeProvider": "openrouter",
  "providers": {
    "openrouter": {
      "activeModel": "anthropic/claude-3.5-sonnet",
      "connectedAt": "2025-01-31T00:00:00Z",
      "favoriteModels": ["anthropic/claude-3.5-sonnet"],
      "recentModels": ["anthropic/claude-3.5-sonnet", "openai/gpt-4o"]
    }
  }
}

OpenRouter Setup

OpenRouter provides unified access to 200+ models from multiple providers through a single API key.

Getting an API Key

  1. Visit openrouter.ai/keys
  2. Sign up or log in
  3. Create a new API key
  4. Copy the key (starts with sk-or-...)
ModelProviderBest ForPricing (Input/Output)
anthropic/claude-3.5-sonnetAnthropicCoding, reasoning3.00/3.00 / 15.00 per M tokens
anthropic/claude-3.5-haikuAnthropicFast responses1.00/1.00 / 5.00 per M tokens
openai/gpt-4oOpenAIMultimodal tasks2.50/2.50 / 10.00 per M tokens
google/gemini-2.0-flashGoogleSpeed + quality balance0.10/0.10 / 0.40 per M tokens
meta-llama/llama-3.1-70bMetaOpen-source alternative0.35/0.35 / 0.40 per M tokens
Free models are marked with [Free] in the model selector. Great for testing and development.

Troubleshooting

Common causes:
  • API key is expired or revoked
  • Insufficient credits in your provider account
  • Network connectivity issues
Solution: Verify your API key at openrouter.ai/keys and ensure you have available credits.
Cause: The active provider requires an API key that hasn’t been configured.Solution: Run /provider to connect the provider with your API key first.
Run /provider and select ByteRover from the list. No API key is required for the built-in provider.
API keys are stored in your system keychain for security:
  • macOS: Keychain Access app (search for “byterover-cli-providers”)
  • Windows: Credential Manager
  • Linux: Your secret service manager

Next Steps