Features
- Unified API: Access multiple AI providers with one API key
- Model Flexibility: Switch between models without code changes
- Competitive Pricing: Pay-per-use with transparent pricing
- No Rate Limits: Less restrictive than individual provider limits
Setup
Get API Key
Visit OpenRouter and sign up for an account.
- Navigate to Keys section
- Create a new API key
- Copy the key (starts with
sk-or-v1-)
Configuration
Environment Variables
| Variable | Required | Description | Default |
|---|---|---|---|
OPENROUTER_API_KEY | Yes | Your OpenRouter API key | - |
OPENROUTER_MODEL | No | Model to use | google/gemini-2.5-flash |
Supported Models
Cluely is tested with these models, but OpenRouter supports many more:- Gemini Models
- GPT Models
- Claude Models
- Open Source Models
See the full list of models at OpenRouter Models
API Implementation
Request Configuration
Cluely sends requests to OpenRouter with this configuration:Endpoint
Headers
| Header | Value | Purpose |
|---|---|---|
Authorization | Bearer {API_KEY} | Authentication |
Content-Type | application/json | Request format |
HTTP-Referer | https://cluely.ai | App identification |
X-Title | Cluely | App name |
Model Selection
Default Model
Cluely usesgoogle/gemini-2.5-flash as the default OpenRouter model:
Changing Models
Limitations with OpenRouter
Vision/Image Analysis
OpenRouter cannot directly analyze images in the current implementation:Audio Processing
Audio features are not supported with OpenRouter. Cluely uses Gemini for all voice functionality.
Switching to OpenRouter
At Runtime
Switch from another provider to OpenRouter:Check Connection
Test your OpenRouter configuration:Cost Management
Monitor Usage
Track your OpenRouter usage:- Visit OpenRouter Dashboard
- View usage by model and date
- Set spending limits to prevent overages
Cost Optimization
Choose Appropriate Models
Choose Appropriate Models
- For simple tasks: Use
google/gemini-2.5-flashoropenai/gpt-3.5-turbo - For complex reasoning: Use
openai/gpt-4oranthropic/claude-3-opus - For cost efficiency: Use open-source models like
meta-llama/llama-3-70b
Optimize Request Parameters
Optimize Request Parameters
Use Rate Limiting
Use Rate Limiting
Implement client-side rate limiting to control costs:
- Limit requests per minute
- Cache common responses
- Debounce user input
Troubleshooting
API Key Not Working
API Key Not Working
Error:
OpenRouter API key is not configuredSolutions:- Verify
OPENROUTER_API_KEYis set in.env - Check API key starts with
sk-or-v1- - Ensure no extra spaces or quotes in
.env - Restart Cluely after updating
.env
Invalid Model
Invalid Model
Error:
Model not found or similarSolutions:- Check model name is correct (case-sensitive)
- Verify model exists: OpenRouter Models
- Use full model path:
google/gemini-2.5-flashnot justgemini-2.5-flash
Rate Limiting
Rate Limiting
Error:
429 Too Many RequestsSolutions:- Wait before retrying (OpenRouter handles rate limits per model)
- Switch to a different model with higher limits
- Upgrade your OpenRouter plan
Insufficient Credits
Insufficient Credits
Error: Payment or credit errorsSolutions:
- Add credits in OpenRouter dashboard
- Update payment method
- Check spending limits aren’t exceeded
Best Practices
- Start with default model:
google/gemini-2.5-flashoffers good balance of cost and quality - Monitor usage: Check OpenRouter dashboard regularly
- Test before production: Verify model behavior matches expectations
- Set spending limits: Prevent unexpected charges
- Use appropriate models: Don’t use expensive models for simple tasks
Hybrid Setup
Combine OpenRouter with other providers:Next Steps
Model Comparison
Compare different AI models and providers
K2 Think Setup
Configure advanced reasoning AI