Skip to main content

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’.
# Before (OpenRouter)
curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer sk-or-v1-your-openrouter-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

# After (AI Stats)

curl https://api.phaseo.app/v1/chat/completions \
 -H "Authorization: Bearer your-ai-stats-key" \
 -H "Content-Type: application/json" \
 -d '{
"model": "gpt-4",
"messages": [{"role": "user", "content": "Hello!"}]
}'

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-4gpt-4
  • anthropic/claude-3-sonnetclaude-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.
Last modified on February 11, 2026