> Discover all available pages from the documentation index: https://mastra.ai/llms.txt

# ![Merge Gateway logo](https://models.dev/logos/merge-gateway.svg)Merge Gateway

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

Learn more in the [Merge Gateway documentation](https://docs.merge.dev/merge-gateway).

## Usage

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

const agent = new Agent({
  id: "my-agent",
  name: "My Agent",
  instructions: "You are a helpful assistant",
  model: "merge-gateway/anthropic/claude-3-7-sonnet-20250219"
});
```

> **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Merge Gateway documentation](https://docs.merge.dev/merge-gateway) for details.

## Configuration

```bash
# Use gateway API key
MERGE_GATEWAY_API_KEY=your-gateway-key

# Or use provider API keys directly
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=ant-...
```

## Available models

| Model                                            |
| ------------------------------------------------ |
| `anthropic/claude-3-7-sonnet-20250219`           |
| `anthropic/claude-fable-5`                       |
| `anthropic/claude-haiku-4-5-20251001`            |
| `anthropic/claude-opus-4-1-20250805`             |
| `anthropic/claude-opus-4-20250514`               |
| `anthropic/claude-opus-4-5-20251101`             |
| `anthropic/claude-opus-4-6`                      |
| `anthropic/claude-opus-4-7`                      |
| `anthropic/claude-opus-4-8`                      |
| `anthropic/claude-opus-5`                        |
| `anthropic/claude-sonnet-4-20250514`             |
| `anthropic/claude-sonnet-4-5-20250929`           |
| `anthropic/claude-sonnet-4-6`                    |
| `anthropic/claude-sonnet-5`                      |
| `bytedance/dola-seed-2.0-code`                   |
| `bytedance/dola-seed-2.0-code-preview`           |
| `bytedance/dola-seed-2.0-lite`                   |
| `bytedance/dola-seed-2.0-mini`                   |
| `bytedance/dola-seed-2.0-pro`                    |
| `cohere/command-a-03-2025`                       |
| `cohere/command-r-08-2024`                       |
| `cohere/command-r-plus-08-2024`                  |
| `cohere/command-r7b-12-2024`                     |
| `deepseek/deepseek-r1`                           |
| `deepseek/deepseek-v3`                           |
| `deepseek/deepseek-v3.1`                         |
| `deepseek/deepseek-v3.2`                         |
| `deepseek/deepseek-v4-flash`                     |
| `deepseek/deepseek-v4-flash-0731`                |
| `deepseek/deepseek-v4-pro`                       |
| `deepseek/deepseek-v4-pro-0813`                  |
| `google/gemini-2.5-computer-use-preview-10-2025` |
| `google/gemini-2.5-flash`                        |
| `google/gemini-2.5-flash-image`                  |
| `google/gemini-2.5-flash-lite`                   |
| `google/gemini-2.5-pro`                          |
| `google/gemini-3-flash-preview`                  |
| `google/gemini-3-pro-image`                      |
| `google/gemini-3-pro-preview`                    |
| `google/gemini-3.1-flash-image`                  |
| `google/gemini-3.1-flash-lite`                   |
| `google/gemini-3.1-flash-lite-preview`           |
| `google/gemini-3.1-pro-preview`                  |
| `google/gemini-3.1-pro-preview-customtools`      |
| `google/gemini-3.5-flash`                        |
| `google/gemini-3.5-flash-lite`                   |
| `google/gemini-3.6-flash`                        |
| `google/gemini-3.7-flash`                        |
| `google/gemini-embedding-001`                    |
| `google/gemini-flash-latest`                     |
| `google/gemini-flash-lite-latest`                |
| `google/gemma-4-26b-a4b-it`                      |
| `google/gemma-4-31b-it`                          |
| `meta/llama-3.1-8b-instruct`                     |
| `meta/llama-3.3-70b-instruct`                    |
| `meta/muse-spark-1.1`                            |
| `meta/muse-spark-1.2`                            |
| `minimax/minimax-m2`                             |
| `minimax/minimax-m2.1`                           |
| `minimax/minimax-m2.5`                           |
| `minimax/minimax-m2.5-highspeed`                 |
| `minimax/minimax-m2.7`                           |
| `minimax/minimax-m2.7-highspeed`                 |
| `minimax/minimax-m3`                             |
| `mistral/codestral-latest`                       |
| `mistral/devstral-2512`                          |
| `mistral/devstral-medium-2507`                   |
| `mistral/devstral-medium-latest`                 |
| `mistral/devstral-small-2507`                    |
| `mistral/magistral-medium-latest`                |
| `mistral/mistral-large-2411`                     |
| `mistral/mistral-large-2512`                     |
| `mistral/mistral-large-latest`                   |
| `mistral/mistral-medium-2505`                    |
| `mistral/mistral-medium-latest`                  |
| `mistral/mistral-small-latest`                   |
| `mistral/pixtral-large-latest`                   |
| `moonshot/kimi-k2.5`                             |
| `moonshot/kimi-k2.6`                             |
| `moonshot/kimi-k2.7-code`                        |
| `moonshot/kimi-k2.7-code-highspeed`              |
| `moonshot/kimi-k3`                               |
| `moonshotai/kimi-k2-thinking`                    |
| `nvidia/nemotron-3.5-lightning-30b-a3b`          |
| `nvidia/nemotron-nano-9b-v2`                     |
| `openai/gpt-3.5-turbo`                           |
| `openai/gpt-4`                                   |
| `openai/gpt-4-turbo`                             |
| `openai/gpt-4.1`                                 |
| `openai/gpt-4.1-mini`                            |
| `openai/gpt-4.1-nano`                            |
| `openai/gpt-4o`                                  |
| `openai/gpt-4o-2024-05-13`                       |
| `openai/gpt-4o-2024-08-06`                       |
| `openai/gpt-4o-2024-11-20`                       |
| `openai/gpt-4o-mini`                             |
| `openai/gpt-5`                                   |
| `openai/gpt-5-chat-latest`                       |
| `openai/gpt-5-mini`                              |
| `openai/gpt-5-nano`                              |
| `openai/gpt-5.1`                                 |
| `openai/gpt-5.1-chat-latest`                     |
| `openai/gpt-5.2`                                 |
| `openai/gpt-5.2-chat-latest`                     |
| `openai/gpt-5.3-chat-latest`                     |
| `openai/gpt-5.4`                                 |
| `openai/gpt-5.4-mini`                            |
| `openai/gpt-5.4-nano`                            |
| `openai/gpt-5.5`                                 |
| `openai/gpt-5.6-luna`                            |
| `openai/gpt-5.6-sol`                             |
| `openai/gpt-5.6-terra`                           |
| `openai/gpt-oss-120b`                            |
| `openai/gpt-oss-20b`                             |
| `openai/gpt-oss-safeguard-120b`                  |
| `openai/o1`                                      |
| `openai/o3`                                      |
| `openai/o3-mini`                                 |
| `openai/o4-mini`                                 |
| `qwen/qwen-flash`                                |
| `qwen/qwen-plus`                                 |
| `qwen/qwen3-235b-a22b`                           |
| `qwen/qwen3-235b-a22b-instruct-2507`             |
| `qwen/qwen3-30b-a3b`                             |
| `qwen/qwen3-32b`                                 |
| `qwen/qwen3-coder-480b-a35b-instruct`            |
| `qwen/qwen3-coder-flash`                         |
| `qwen/qwen3-coder-next`                          |
| `qwen/qwen3-coder-plus`                          |
| `qwen/qwen3-max`                                 |
| `qwen/qwen3-next-80b-a3b-instruct`               |
| `qwen/qwen3-next-80b-a3b-thinking`               |
| `qwen/qwen3-vl-235b-a22b-instruct`               |
| `qwen/qwen3-vl-235b-a22b-thinking`               |
| `qwen/qwen3-vl-plus`                             |
| `qwen/qwen3.5-122b-a10b`                         |
| `qwen/qwen3.5-27b`                               |
| `qwen/qwen3.5-35b-a3b`                           |
| `qwen/qwen3.5-397b-a17b`                         |
| `qwen/qwen3.5-9b`                                |
| `qwen/qwen3.5-flash`                             |
| `qwen/qwen3.5-plus`                              |
| `qwen/qwen3.6-27b`                               |
| `qwen/qwen3.6-35b-a3b`                           |
| `qwen/qwen3.6-flash`                             |
| `qwen/qwen3.6-max-preview`                       |
| `qwen/qwen3.6-plus`                              |
| `qwen/qwen3.7-max`                               |
| `qwen/qwen3.7-plus`                              |
| `qwen/qwen3.8-2.4t-a95b`                         |
| `qwen/qwen3.8-max`                               |
| `sakana/fugu-ultra`                              |
| `sakana/sakana-namazu`                           |
| `thinkingmachines/inkling`                       |
| `writer/palmyra-x4`                              |
| `writer/palmyra-x5`                              |
| `xai/grok-4.20-0309-non-reasoning`               |
| `xai/grok-4.20-0309-reasoning`                   |
| `xai/grok-4.3`                                   |
| `xai/grok-4.5`                                   |
| `xai/grok-4.6`                                   |
| `xai/grok-build-0.1`                             |
| `zai/glm-4.5`                                    |
| `zai/glm-4.5-air`                                |
| `zai/glm-4.5v`                                   |
| `zai/glm-4.6`                                    |
| `zai/glm-4.7`                                    |
| `zai/glm-4.7-flash`                              |
| `zai/glm-4.7-flashx`                             |
| `zai/glm-5`                                      |
| `zai/glm-5-turbo`                                |
| `zai/glm-5.1`                                    |
| `zai/glm-5.2`                                    |
| `zai/glm-5.3`                                    |