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

# OpenRouter

# OpenRouter

OpenRouter is a unified API gateway that routes requests to 100+ models from providers like Anthropic, OpenAI, Google, Meta, and more. A single API key and a single base URL gives you access to the full catalog, making it easy to experiment with different models without managing multiple credentials.

## Requirements

* An OpenRouter API key from [openrouter.ai](https://openrouter.ai)

## Quickstart

```bash theme={"dark"}
export OPENROUTER_API_KEY="sk-or-..."
wednesdayai onboard --auth-choice openrouter-api-key
```

Then set a default model:

```json5 theme={"dark"}
{
  agents: {
    defaults: {
      model: { primary: "openrouter/anthropic/claude-opus-4-6" },
    },
  },
}
```

## Configuration

### Environment variable

```bash theme={"dark"}
export OPENROUTER_API_KEY="sk-or-..."
```

WednesdayAI reads `OPENROUTER_API_KEY` automatically and enables the `openrouter` provider.

### Config snippet

```json5 theme={"dark"}
{
  env: { OPENROUTER_API_KEY: "sk-or-..." },
  agents: {
    defaults: {
      model: { primary: "openrouter/anthropic/claude-opus-4-6" },
    },
  },
}
```

### Provider settings

| Setting | Value |
| - | - |
| Provider ID | `openrouter` |
| Base URL | `https://openrouter.ai/api/v1` |
| API | OpenAI-compatible (`openai-completions`) |
| Auth env var | `OPENROUTER_API_KEY` |
| Default model | `auto` (OpenRouter smart routing) |
| Default context window | 200,000 tokens |
| Default max tokens | 8,192 |

## Model IDs

OpenRouter model references follow the pattern `openrouter/<provider>/<model>`. Examples:

```
openrouter/anthropic/claude-opus-4-6
openrouter/openai/gpt-4o
openrouter/meta-llama/llama-3.3-70b-instruct
openrouter/google/gemini-2.5-pro
openrouter/deepseek/deepseek-r1
```

You can also use `openrouter/auto` to let OpenRouter pick the best model for each request.

The full model list is available at [openrouter.ai/models](https://openrouter.ai/models).

## Auto routing

The `openrouter/auto` model lets OpenRouter select the best available model for each request based on capability, cost, and availability. WednesdayAI disables the reasoning effort parameter for `auto` because the target model is unknown at request time.

```json5 theme={"dark"}
{
  agents: {
    defaults: {
      model: { primary: "openrouter/auto" },
    },
  },
}
```

## Troubleshooting

**401 Unauthorized**

* Verify your key starts with `sk-or-` and is copied in full.
* Re-run onboarding: `wednesdayai onboard --auth-choice openrouter-api-key`.

**Model not available / 404**

* Check that the model ID matches OpenRouter's catalog exactly (case-sensitive).
* Some models require special approval; check your OpenRouter account settings.

**Rate limits**

OpenRouter applies per-model rate limits based on your tier. If you hit limits, add multiple API keys as auth profiles for rotation: `wednesdayai models auth add-key --provider openrouter`.

## Related

* [Model providers](https://docs.wednesdayai.dev/next/developers/concepts/model-providers.md)
* [Models](https://docs.wednesdayai.dev/next/developers/concepts/models.md)
* [Model failover](https://docs.wednesdayai.dev/next/developers/concepts/model-failover.md)
* [Gateway configuration](https://docs.wednesdayai.dev/next/admin/gateway/configuration.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.