Integrations
Migrate from OpenRouter
Migrate your existing OpenRouter workflows to Inworld Inference
To migrate from OpenRouter, update your authentication, base URL, and model settings as shown below. Inworld Inference is designed as a drop-in replacement for OpenAI-compatible endpoints, with added reliability and cost controls.
Key Differences
| Feature | OpenRouter | Inworld Inference |
|---|---|---|
| Authentication | API key (Authorization: Bearer) | Base64 API credential (Authorization: Basic) |
| Base URL | https://openrouter.ai/api/v1 | https://api.inworld.ai/v1 |
| Model Names | provider/model | provider/model (e.g., openai/gpt-5.4) |
| Routing | Handled via model string | Handled via model: "auto" or custom Routers |
Migration Steps
1. Update Authentication
OpenRouter uses a single API key with Bearer auth. Inworld uses a key/secret pair, delivered as one Base64 credential that you copy from Portal or the CLI and send with Basic auth. Don't encode it again.
OpenRouter:
Authorization: Bearer $OPENROUTER_API_KEYInworld:
Authorization: Basic $INWORLD_API_KEY2. Update the Base URL
Change your client configuration to point to our endpoint. With the OpenAI SDK, the examples also set the Basic authorization header. The SDK sends api_key as a Bearer token, which Inworld Inference also accepts, but the examples use Basic throughout:
import os
from openai import OpenAI
api_key = os.environ["INWORLD_API_KEY"]
client = OpenAI(
# From:
# base_url="https://openrouter.ai/api/v1"
# To:
base_url="https://api.inworld.ai/v1",
api_key=api_key,
default_headers={"Authorization": f"Basic {api_key}"},
)See OpenAI compatibility for the supported endpoints.
3. Map Your Models
Inworld supports the same provider/model syntax you're used to.
openai/gpt-5.4→openai/gpt-5.4anthropic/claude-opus-4-6→anthropic/claude-opus-4-6google-ai-studio/gemini-2.5-flash→google-ai-studio/gemini-2.5-flash
4. Enable Intelligent Routing
Instead of manually picking models, you can now use our routing engine.
{
"model": "auto",
"extra_body": {
"sort": ["price", "latency"]
}
}Why Migrate?
- Enterprise Reliability: Built-in automatic fallbacks across providers.
- Cost Optimization: Dynamic tiering to reduce bills by up to 70%.
- Unified Observability: Detailed logs and performance metrics across all models.
- Privacy Controls: Regional routing and PII detection.
Support
Need help with a complex migration? Contact our engineering team.