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

# OpenRouter Plugin

> Multi-provider LLM access through OpenRouter

## Features

* **Multiple providers** - Access 50+ models from various providers
* **Automatic failover** - Route to available providers
* **Cost optimization** - Choose models by price/performance
* **Single API key** - One key for all providers

## Installation

```bash theme={null}
elizaos plugins add @elizaos/plugin-openrouter
```

## Configuration

### Environment Variables

```bash theme={null}
# Required
OPENROUTER_API_KEY=sk-or-...

# Optional model configuration
# You can use any model available on OpenRouter
OPENROUTER_SMALL_MODEL=google/gemini-2.0-flash-001           # Default: google/gemini-2.0-flash-001
OPENROUTER_LARGE_MODEL=google/gemini-2.5-flash-preview-05-20 # Default: google/gemini-2.5-flash-preview-05-20
OPENROUTER_IMAGE_MODEL=anthropic/claude-3-5-sonnet           # For vision tasks

# Examples of other available models:
# OPENROUTER_SMALL_MODEL=anthropic/claude-3-haiku
# OPENROUTER_LARGE_MODEL=anthropic/claude-3-opus
# OPENROUTER_LARGE_MODEL=openai/gpt-4o
# OPENROUTER_SMALL_MODEL=meta-llama/llama-3.1-8b-instruct:free
```

### Character Configuration

```json theme={null}
{
  "name": "MyAgent",
  "plugins": [
    "@elizaos/plugin-openrouter"
  ]
}
```

## Supported Operations

| Operation          | Support | Notes                               |
| ------------------ | ------- | ----------------------------------- |
| TEXT\_GENERATION   | ✅       | All available models                |
| EMBEDDING          | ✅       | Multiple embedding models available |
| OBJECT\_GENERATION | ✅       | Model dependent                     |

## Embedding Models

OpenRouter now provides embedding endpoints with multiple models:

* `text-embedding-3-large` (OpenAI via OpenRouter)
* `qwen3-embedding` (Qwen)
* `gemini-embedding` (Google)
* `mistral-embed` (Mistral)

Configure embedding model:

```bash theme={null}
OPENROUTER_EMBEDDING_MODEL=openai/text-embedding-3-large
```

## Model Configuration

The plugin uses model tiers:

* **SMALL\_MODEL**: Fast, cost-effective responses
* **LARGE\_MODEL**: Complex reasoning, best quality
* **IMAGE\_MODEL**: Multimodal capabilities

OpenRouter provides access to 50+ models from various providers. You can use:

### Premium Models

* Any Anthropic Claude model (Opus, Sonnet, Haiku)
* Any OpenAI GPT model (GPT-4o, GPT-4, GPT-3.5)
* Google Gemini models (Pro, Flash, etc.)
* Cohere Command models

### Open Models

* Meta Llama models (3.1, 3.2, 3.3)
* Mistral/Mixtral models
* Many models with `:free` suffix for testing

## Pricing Strategy

OpenRouter charges a small markup (usually \~10%) on top of provider prices:

1. **Pay-per-token** - No monthly fees
2. **Price transparency** - See costs per model
3. **Credits system** - Pre-pay for usage

## External Resources

* [Plugin Source](https://github.com/elizaos/eliza/tree/main/packages/plugin-openrouter)
* [OpenRouter Documentation](https://openrouter.ai/docs)
* [Model List & Pricing](https://openrouter.ai/models)
