Migrating from OpenRouter
This guide will help you migrate your existing OpenRouter integration to use the AI Stats Gateway instead.Overview
AI Stats Gateway provides OpenAI-compatible endpoints, similar to OpenRouter. Migration involves:- Changing the API base URL
- Updating your API key
- Adjusting model names if necessary
Prerequisites
- An AI Stats account and API key (get one at AI Stats Dashboard)
- Existing OpenRouter code
Migration Steps
1. Update API Key and Base URL
Replace OpenRouter’s base URL with AI Stats’.2. Update Model Names
OpenRouter uses specific model identifiers. AI Stats may use different names for the same models. Check the models endpoint for available models. Example mappings:openai/gpt-4→gpt-4anthropic/claude-3-sonnet→claude-3-sonnet-20240229
3. Test Your Integration
Run your code with the new configuration.Common Issues
- Model availability: Not all OpenRouter models may be available in AI Stats.
- Pricing: Different pricing structure.
- Features: Some OpenRouter-specific features may not be available.
Next Steps
- Explore AI Stats’ analytics features.
- Check the API Reference.