Skip to main content
description: “Bring your own AI API keys”

API Keys

Agentbot uses a “bring your own keys” model. You control your AI costs directly.

Supported Providers

Best for: General use, wide model selection
OPENROUTER_API_KEY=sk-or-v1-xxxxx
Models available:
  • Anthropic: Claude 3.5 Sonnet, Claude 3 Opus
  • OpenAI: GPT-4, GPT-4 Turbo
  • Google: Gemini Pro
  • Meta: Llama 3
  • And 200+ more

Anthropic

Best for: Highest quality reasoning
ANTHROPIC_API_KEY=sk-ant-xxxxx

OpenAI

Best for: GPT-4 features
OPENAI_API_KEY=sk-xxxxx

Google AI

Best for: Gemini models
GOOGLE_API_KEY=AIzaSyxxxxx

Adding API Keys

Via Dashboard

  1. Go to Settings → API Keys
  2. Click Add Key
  3. Select provider
  4. Paste your key
  5. Click Save

Via Environment Variable

Set in your deployment:
# For all agents
OPENROUTER_API_KEY=sk-or-...

# Per-agent override
ANTHROPIC_API_KEY=sk-ant-...

Cost Tracking

Monitor your usage in Dashboard → Costs:
  • API calls by agent
  • Token usage (input/output)
  • Cost per model
  • Daily/weekly/monthly reports

Rate Limits

Each provider has rate limits:
ProviderRequests/minTokens/min
OpenRouter1000100,000
Anthropic50100,000
OpenAI500150,000
Google6060,000

Best Practices

  1. Use OpenRouter - Best model selection, competitive pricing
  2. Set budgets - Monitor costs in dashboard
  3. Rotate keys - Update keys periodically
  4. Don’t commit keys - Use environment variables only

Troubleshooting

Check:
  • Key is correct and not expired
  • Has sufficient credits/quota
  • Correct format for provider
  • Wait and retry
  • Upgrade plan for higher limits
  • Use OpenRouter for more capacity
Some models require approval:
  • Apply for OpenRouter Prime
  • Enable in Anthropic console
  • Check Google AI quota