> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenRouter to Inworld

> Migrate your existing OpenRouter workflows to Inworld Router

If you are already using OpenRouter, migrating to Inworld Router is straightforward. Our API is designed to be a drop-in replacement for OpenAI-compatible endpoints, with additional features for enterprise reliability and cost optimization.

## Key Differences

| Feature            | OpenRouter                     | Inworld Router                                |
| :----------------- | :----------------------------- | :-------------------------------------------- |
| **Authentication** | API Key (Bearer)               | API Key & Secret (Basic Auth)                 |
| **Base URL**       | `https://openrouter.ai/api/v1` | `https://api.inworld.ai/v1`                   |
| **Model Names**    | `provider/model`               | `provider/model` (e.g., `openai/gpt-5`)       |
| **Routing**        | Handled via model string       | Handled via `model: "auto"` or custom Routers |

## Migration Steps

### 1. Update Authentication

OpenRouter uses a single API key. Inworld uses a Key/Secret pair.

**OpenRouter:**

```bash theme={"system"}
Authorization: Bearer $OPENROUTER_API_KEY
```

**Inworld:**

```bash theme={"system"}
Authorization: Bearer <your-api-key>
```

### 2. Update the Base URL

Change your client configuration to point to our endpoint.

```python theme={"system"}
# From:
# base_url="https://openrouter.ai/api/v1"
# To:
base_url="https://api.inworld.ai/v1"
```

### 3. Map Your Models

Inworld supports the same `provider/model` syntax you're used to.

* `openai/gpt-5` → `openai/gpt-5`
* `anthropic/claude-opus-4-6` → `anthropic/claude-opus-4-6`
* `google-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.

```json theme={"system"}
{
  "model": "auto",
  "extra_body": {
    "sort": ["price", "latency"]
  }
}
```

## Why Migrate?

1. **Enterprise Reliability**: Built-in automatic failover across providers.
2. **Cost Optimization**: Dynamic tiering to reduce bills by up to 70%.
3. **Unified Observability**: Detailed logs and performance metrics across all models.
4. **Privacy Controls**: Regional routing and PII detection.

## Support

Need help with a complex migration? [Contact our engineering team](mailto:support@inworld.ai).
