# <img src="https://models.dev/logos/openrouter.svg" alt="OpenRouter logo" className="inline w-8 h-8 mr-2 align-middle dark:invert dark:brightness-0 dark:contrast-200" />OpenRouter
[EN] Source: https://mastra.ai/models/gateways/openrouter

OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 118 models through Mastra's model router.

Learn more in the [OpenRouter documentation](https://openrouter.ai/models).

## Usage

```typescript
import { Agent } from "@mastra/core";

const agent = new Agent({
  name: "my-agent",
  instructions: "You are a helpful assistant",
  model: "openrouter/anthropic/claude-3.5-haiku"
});
```

:::info

Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [OpenRouter documentation](https://openrouter.ai/models) for details.

:::

## Configuration

```bash