Skip to main content

OpenRouter API Configuration Guide

Overview

OpenRouter API is a unified interface platform that aggregates multiple LLM services, supporting access to models from OpenAI, Anthropic, Google, Meta, and more.

With OpenRouter, you can:

  • Use a unified API to call models from different providers
  • Auto-route to optimal models or lowest-cost nodes
  • Avoid rate limiting issues from single platforms
  • Switch models flexibly without changing code

Popular available models:

ModelProviderFeaturesUse Cases
openai/gpt-4o-miniOpenAIFast, low costDaily conversations
openai/gpt-4oOpenAIHigh qualityMultimodal tasks
anthropic/claude-3-haikuAnthropicFastLight tasks
anthropic/claude-3-opusAnthropicHigh reasoningComplex analysis
google/gemini-proGoogleStrong multimodalGeneral tasks

Getting API Key

Step 1: Visit OpenRouter

Go to OpenRouter

Step 2: Sign In

Supports GitHub / Google login.

Step 3: Create API Key

  1. Navigate to Dashboard → Keys
  2. Click Create Key
  3. Copy and save your API Key

⚠️ Note: Keep your API Key secure and avoid exposing it.

OpenRouter API Key

OpenRouter API Key


Configuring PicoClaw

PicoClaw provides a WebUI interface where you can easily configure models without manually editing configuration files.

Edit preset settings, or click the "Add Model" button in the top right corner:

Add Model

FieldValue
Model AliasCustom name, e.g., gpt-4o-mini
Model Identifieropenai/gpt-4o-mini (or other supported models)
API KeyOpenRouter API Key
API Base URLhttps://openrouter.ai/api/v1

Option 2: Edit Configuration File

Add in config.json:

{
"model_list": [
{
"model_name": "gpt-4o-mini",
"model": "openai/gpt-4o-mini",
"base_url": "https://openrouter.ai/api/v1",
"auth_method": "api_key",
"api_key": "YOUR_OPENROUTER_API_KEY",
"headers": {
"HTTP-Referer": "http://localhost",
"X-Title": "PicoClaw"
}
},
{
"model_name": "claude-3-haiku",
"model": "anthropic/claude-3-haiku",
"base_url": "https://openrouter.ai/api/v1",
"auth_method": "api_key",
"api_key": "YOUR_OPENROUTER_API_KEY"
}
],
"agents": {
"defaults": {
"model": "gpt-4o-mini"
}
}
}

Limits & Quotas

Billing

OpenRouter uses a pay-as-you-go model, charging based on the actual model used and token consumption.

Rate Limits

  • Different models have different rate limits
  • Free models may have stricter limits
  • Paid users enjoy higher rate quotas

Common Issues

Model Unavailable

Cause: Model discontinued or insufficient account balance

Solutions:

  • Check if the model is still available
  • Top up account balance

Response Timeout

Cause: Slow model response or network issues

Solutions:

  • Try using a faster model
  • Check network connection