Help Center/API Keys & Configuration/Using OpenRouter for Multiple Models
Back to Help Center
API Keys & Configuration

Using OpenRouter for Multiple Models

Access dozens of AI models through a single API

What is OpenRouter?

OpenRouter provides unified access to multiple AI models through a single API, including:

  • OpenAI models (GPT-4, GPT-3.5)
  • Anthropic models (Claude)
  • Meta models (Llama)
  • Mistral models
  • Google models (Gemini)
  • Many others

Pay-as-you-go pricing with one account instead of managing multiple provider accounts.

Getting Started with OpenRouter

  1. Go to openrouter.ai
  2. Click "Sign Up"
  3. Create account with email or OAuth
  4. Add credits to your account

Creating API Key

  1. Log in to OpenRouter
  2. Go to "Keys" section
  3. Click "Create Key"
  4. Give it a name
  5. Copy the key (starts with sk-or-)

Configuration in AgentClaw

Add these environment variables:

OPENROUTER_API_KEY=sk-or-your-key AI_MODEL=anthropic/claude-4.5-sonnet OPENROUTER_APP_NAME=AgentClaw Bot

Then restart your instance.

Available Models

Popular models on OpenRouter (use these as AI_MODEL):

Anthropic/Claude

  • anthropic/claude-4.6-opus
  • anthropic/claude-4.5-sonnet
  • anthropic/claude-4.5-haiku

OpenAI

  • openai/gpt-4.1
  • openai/gpt-4-turbo
  • openai/gpt-3.5-turbo

Meta/Llama

  • meta-llama/llama-3.1-70b-instruct
  • meta-llama/llama-3.1-8b-instruct

Mistral

  • mistralai/mistral-large
  • mistralai/mistral-medium

See full list at openrouter.ai/models

Pricing

OpenRouter adds a small markup (~10-20%) to provider prices. Benefits:

  • Single account for all models
  • Unified billing
  • Easy model switching
  • No need to manage multiple API keys

Check current pricing at openrouter.ai/models

Advantages of OpenRouter

  • Model variety: Access 50+ models
  • Easy switching: Change AI_MODEL variable, no new API key
  • Fallback support: Specify backup models if primary is unavailable
  • Cost comparison: Compare prices across models easily
  • One billing statement: All usage in one place

Monitoring Usage

  1. Log in to OpenRouter dashboard
  2. View usage statistics
  3. See breakdown by model
  4. Track credit balance
  5. Enable low balance alerts

Switching Models

To try different models:

  1. Update AI_MODEL environment variable
  2. Use format: provider/model-name
  3. Save changes
  4. Restart instance
  5. Test with messages

Best Practices

  • Start with credits: Add $10-20 to test
  • Enable auto-top-up: Prevent service interruption
  • Try multiple models: Find best balance of cost/quality
  • Monitor usage: Some models more expensive than others
  • Set spending limits: Configure alerts

Troubleshooting

"Invalid API key"

  • Verify key starts with sk-or-
  • Check variable name is OPENROUTER_API_KEY
  • Ensure key wasn't revoked

"Model not found"

  • Check model name format: provider/model
  • Verify model exists at openrouter.ai/models
  • Some models may be temporarily unavailable

"Insufficient credits"

  • Add credits in OpenRouter dashboard
  • Enable auto-top-up
  • Check credit balance

When to Use OpenRouter

Good For:

  • Experimenting with multiple models
  • Avoiding vendor lock-in
  • Accessing models not directly available
  • Simplified billing across providers

May Not Be Best For:

  • Production use requiring direct provider SLAs
  • Situations where markup matters significantly
  • When you only use one provider

Next Steps

Still need help?

Our support team is ready to assist you with any questions.

Contact Support