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

# ![ZenMux logo](https://models.dev/logos/zenmux.svg)ZenMux

Access 120 ZenMux models through Mastra's model router. Authentication is handled automatically using the `ZENMUX_API_KEY` environment variable.

Learn more in the [ZenMux documentation](https://docs.zenmux.ai).

```bash
ZENMUX_API_KEY=your-api-key
```

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

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

// Generate a response
const response = await agent.generate("Hello!");

// Stream a response
const stream = await agent.stream("Tell me a story");
for await (const chunk of stream) {
  console.log(chunk);
}
```

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

## Models

| Model                                         | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
| --------------------------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
| `zenmux/anthropic/claude-fable-5`             | 1.0M    |       |           |       |       |       | $10        | $50         |
| `zenmux/anthropic/claude-haiku-4.5`           | 200K    |       |           |       |       |       | $1         | $5          |
| `zenmux/anthropic/claude-opus-4`              | 200K    |       |           |       |       |       | $15        | $75         |
| `zenmux/anthropic/claude-opus-4.1`            | 200K    |       |           |       |       |       | $15        | $75         |
| `zenmux/anthropic/claude-opus-4.5`            | 200K    |       |           |       |       |       | $5         | $25         |
| `zenmux/anthropic/claude-opus-4.6`            | 1.0M    |       |           |       |       |       | $5         | $25         |
| `zenmux/anthropic/claude-opus-4.7`            | 1.0M    |       |           |       |       |       | $5         | $25         |
| `zenmux/anthropic/claude-opus-4.8`            | 1.0M    |       |           |       |       |       | $5         | $25         |
| `zenmux/anthropic/claude-sonnet-4`            | 1.0M    |       |           |       |       |       | $3         | $15         |
| `zenmux/anthropic/claude-sonnet-4.5`          | 1.0M    |       |           |       |       |       | $3         | $15         |
| `zenmux/anthropic/claude-sonnet-4.6`          | 1.0M    |       |           |       |       |       | $3         | $15         |
| `zenmux/anthropic/claude-sonnet-5`            | 1.0M    |       |           |       |       |       | $2         | $10         |
| `zenmux/anthropic/claude-sonnet-5-free`       | 1.0M    |       |           |       |       |       | —          | —           |
| `zenmux/baidu/ernie-5.0-thinking-preview`     | 128K    |       |           |       |       |       | $0.84      | $3          |
| `zenmux/deepseek/deepseek-v3.2`               | 128K    |       |           |       |       |       | $0.28      | $0.43       |
| `zenmux/deepseek/deepseek-v3.2-exp`           | 163K    |       |           |       |       |       | $0.22      | $0.33       |
| `zenmux/deepseek/deepseek-v4-flash`           | 1.0M    |       |           |       |       |       | $0.14      | $0.28       |
| `zenmux/deepseek/deepseek-v4-pro`             | 1.0M    |       |           |       |       |       | $0.43      | $0.87       |
| `zenmux/google/gemini-2.5-flash`              | 1.0M    |       |           |       |       |       | $0.30      | $3          |
| `zenmux/google/gemini-2.5-flash-lite`         | 1.0M    |       |           |       |       |       | $0.10      | $0.40       |
| `zenmux/google/gemini-2.5-pro`                | 1.0M    |       |           |       |       |       | $1         | $10         |
| `zenmux/google/gemini-3-flash-preview`        | 1.0M    |       |           |       |       |       | $0.50      | $3          |
| `zenmux/google/gemini-3.1-flash-lite`         | 1.0M    |       |           |       |       |       | $0.25      | $2          |
| `zenmux/google/gemini-3.1-flash-lite-preview` | 1.1M    |       |           |       |       |       | $0.25      | $2          |
| `zenmux/google/gemini-3.1-pro-preview`        | 1.0M    |       |           |       |       |       | $2         | $12         |
| `zenmux/google/gemini-3.5-flash`              | 1.0M    |       |           |       |       |       | $2         | $9          |
| `zenmux/inclusionai/ring-2.6-1t`              | 262K    |       |           |       |       |       | $0.30      | $3          |
| `zenmux/kuaishou/kat-coder-pro-v2`            | 256K    |       |           |       |       |       | $0.30      | $1          |
| `zenmux/minimax/minimax-m2`                   | 204K    |       |           |       |       |       | $0.30      | $1          |
| `zenmux/minimax/minimax-m2.1`                 | 204K    |       |           |       |       |       | $0.30      | $1          |
| `zenmux/minimax/minimax-m2.5`                 | 205K    |       |           |       |       |       | $0.30      | $1          |
| `zenmux/minimax/minimax-m2.5-lightning`       | 205K    |       |           |       |       |       | $0.60      | $5          |
| `zenmux/minimax/minimax-m2.7`                 | 205K    |       |           |       |       |       | $0.31      | $1          |
| `zenmux/minimax/minimax-m2.7-highspeed`       | 205K    |       |           |       |       |       | $0.61      | $2          |
| `zenmux/minimax/minimax-m3`                   | 512K    |       |           |       |       |       | $0.60      | $2          |
| `zenmux/moonshotai/kimi-k2.5`                 | 262K    |       |           |       |       |       | $0.58      | $3          |
| `zenmux/moonshotai/kimi-k2.6`                 | 262K    |       |           |       |       |       | $0.95      | $4          |
| `zenmux/moonshotai/kimi-k2.7-code`            | 262K    |       |           |       |       |       | $0.95      | $4          |
| `zenmux/moonshotai/kimi-k2.7-code-free`       | 262K    |       |           |       |       |       | —          | —           |
| `zenmux/moonshotai/kimi-k3`                   | 1.0M    |       |           |       |       |       | $3         | $15         |
| `zenmux/moonshotai/kimi-k3-free`              | 1.0M    |       |           |       |       |       | —          | —           |
| `zenmux/openai/gpt-5`                         | 400K    |       |           |       |       |       | $1         | $10         |
| `zenmux/openai/gpt-5-codex`                   | 400K    |       |           |       |       |       | $1         | $10         |
| `zenmux/openai/gpt-5.1`                       | 400K    |       |           |       |       |       | $1         | $10         |
| `zenmux/openai/gpt-5.1-chat`                  | 128K    |       |           |       |       |       | $1         | $10         |
| `zenmux/openai/gpt-5.1-codex`                 | 400K    |       |           |       |       |       | $1         | $10         |
| `zenmux/openai/gpt-5.1-codex-mini`            | 400K    |       |           |       |       |       | $0.25      | $2          |
| `zenmux/openai/gpt-5.2`                       | 400K    |       |           |       |       |       | $2         | $14         |
| `zenmux/openai/gpt-5.2-codex`                 | 400K    |       |           |       |       |       | $2         | $14         |
| `zenmux/openai/gpt-5.2-pro`                   | 400K    |       |           |       |       |       | $21        | $168        |
| `zenmux/openai/gpt-5.3-chat`                  | 128K    |       |           |       |       |       | $2         | $14         |
| `zenmux/openai/gpt-5.3-codex`                 | 400K    |       |           |       |       |       | $2         | $14         |
| `zenmux/openai/gpt-5.4`                       | 1.1M    |       |           |       |       |       | $4         | $19         |
| `zenmux/openai/gpt-5.4-mini`                  | 400K    |       |           |       |       |       | $0.75      | $5          |
| `zenmux/openai/gpt-5.4-nano`                  | 400K    |       |           |       |       |       | $0.20      | $1          |
| `zenmux/openai/gpt-5.4-pro`                   | 1.1M    |       |           |       |       |       | $45        | $225        |
| `zenmux/openai/gpt-5.5`                       | 1.1M    |       |           |       |       |       | $5         | $30         |
| `zenmux/openai/gpt-5.5-instant`               | 400K    |       |           |       |       |       | $5         | $30         |
| `zenmux/openai/gpt-5.5-pro`                   | 1.1M    |       |           |       |       |       | $30        | $180        |
| `zenmux/openai/gpt-5.6-luna`                  | 1.1M    |       |           |       |       |       | $1         | $6          |
| `zenmux/openai/gpt-5.6-sol`                   | 1.1M    |       |           |       |       |       | $5         | $30         |
| `zenmux/openai/gpt-5.6-terra`                 | 1.1M    |       |           |       |       |       | $3         | $15         |
| `zenmux/qwen/qwen3-coder-plus`                | 1.0M    |       |           |       |       |       | $1         | $5          |
| `zenmux/qwen/qwen3-max`                       | 256K    |       |           |       |       |       | $1         | $6          |
| `zenmux/qwen/qwen3.5-flash`                   | 1.0M    |       |           |       |       |       | $0.10      | $0.40       |
| `zenmux/qwen/qwen3.5-plus`                    | 1.0M    |       |           |       |       |       | $0.80      | $5          |
| `zenmux/qwen/qwen3.6-plus`                    | 1.0M    |       |           |       |       |       | $0.50      | $3          |
| `zenmux/qwen/qwen3.7-max`                     | 1.0M    |       |           |       |       |       | $3         | $8          |
| `zenmux/qwen/qwen3.7-plus`                    | 1.0M    |       |           |       |       |       | $0.40      | $2          |
| `zenmux/sapiens-ai/agnes-1.5-lite`            | 256K    |       |           |       |       |       | $0.12      | $0.60       |
| `zenmux/sapiens-ai/agnes-1.5-pro`             | 256K    |       |           |       |       |       | $0.16      | $0.80       |
| `zenmux/stepfun/step-3.5-flash`               | 256K    |       |           |       |       |       | $0.10      | $0.30       |
| `zenmux/stepfun/step-3.7-flash`               | 256K    |       |           |       |       |       | $0.20      | $1          |
| `zenmux/stepfun/step-3.7-flash-free`          | 256K    |       |           |       |       |       | —          | —           |
| `zenmux/tencent/hy3-preview`                  | 256K    |       |           |       |       |       | $0.17      | $0.57       |
| `zenmux/volcengine/doubao-seed-1.8`           | 256K    |       |           |       |       |       | $0.11      | $0.28       |
| `zenmux/volcengine/doubao-seed-2.0-code`      | 256K    |       |           |       |       |       | $0.90      | $4          |
| `zenmux/volcengine/doubao-seed-2.0-lite`      | 256K    |       |           |       |       |       | $0.09      | $0.51       |
| `zenmux/volcengine/doubao-seed-2.0-mini`      | 256K    |       |           |       |       |       | $0.03      | $0.28       |
| `zenmux/volcengine/doubao-seed-2.0-pro`       | 256K    |       |           |       |       |       | $0.45      | $2          |
| `zenmux/x-ai/grok-4.2-fast`                   | 2.0M    |       |           |       |       |       | $3         | $9          |
| `zenmux/x-ai/grok-4.2-fast-non-reasoning`     | 2.0M    |       |           |       |       |       | $3         | $9          |
| `zenmux/x-ai/grok-4.3`                        | 1.0M    |       |           |       |       |       | $1         | $3          |
| `zenmux/x-ai/grok-4.5`                        | 500K    |       |           |       |       |       | $2         | $6          |
| `zenmux/x-ai/grok-build-0.1`                  | 256K    |       |           |       |       |       | $1         | $2          |
| `zenmux/xiaomi/mimo-v2-flash`                 | 262K    |       |           |       |       |       | $0.10      | $0.30       |
| `zenmux/xiaomi/mimo-v2-omni`                  | 265K    |       |           |       |       |       | $0.40      | $2          |
| `zenmux/xiaomi/mimo-v2-pro`                   | 1.0M    |       |           |       |       |       | $1         | $3          |
| `zenmux/xiaomi/mimo-v2.5`                     | 1.0M    |       |           |       |       |       | $0.40      | $2          |
| `zenmux/xiaomi/mimo-v2.5-pro`                 | 1.0M    |       |           |       |       |       | $1         | $3          |
| `zenmux/z-ai/glm-4.5`                         | 128K    |       |           |       |       |       | $0.35      | $2          |
| `zenmux/z-ai/glm-4.5-air`                     | 128K    |       |           |       |       |       | $0.11      | $0.56       |
| `zenmux/z-ai/glm-4.6`                         | 200K    |       |           |       |       |       | $0.35      | $2          |
| `zenmux/z-ai/glm-4.6v`                        | 200K    |       |           |       |       |       | $0.14      | $0.42       |
| `zenmux/z-ai/glm-4.6v-flash`                  | 200K    |       |           |       |       |       | $0.02      | $0.21       |
| `zenmux/z-ai/glm-4.6v-flash-free`             | 200K    |       |           |       |       |       | —          | —           |
| `zenmux/z-ai/glm-4.7`                         | 200K    |       |           |       |       |       | $0.28      | $1          |
| `zenmux/z-ai/glm-4.7-flash-free`              | 200K    |       |           |       |       |       | —          | —           |
| `zenmux/z-ai/glm-4.7-flashx`                  | 200K    |       |           |       |       |       | $0.07      | $0.42       |
| `zenmux/z-ai/glm-5`                           | 200K    |       |           |       |       |       | $0.58      | $3          |
| `zenmux/z-ai/glm-5-turbo`                     | 200K    |       |           |       |       |       | $0.88      | $3          |
| `zenmux/z-ai/glm-5.1`                         | 200K    |       |           |       |       |       | $0.88      | $4          |
| `zenmux/z-ai/glm-5.2`                         | 1.0M    |       |           |       |       |       | $1         | $5          |
| `zenmux/z-ai/glm-5.2-free`                    | 1.0M    |       |           |       |       |       | —          | —           |
| `zenmux/z-ai/glm-5v-turbo`                    | 200K    |       |           |       |       |       | $0.73      | $3          |

## Advanced configuration

### Custom headers

```typescript
const agent = new Agent({
  id: "custom-agent",
  name: "custom-agent",
  model: {
    url: "https://zenmux.ai/api/v1",
    id: "zenmux/anthropic/claude-3.5-haiku",
    apiKey: process.env.ZENMUX_API_KEY,
    headers: {
      "X-Custom-Header": "value"
    }
  }
});
```

### Dynamic model selection

```typescript
const agent = new Agent({
  id: "dynamic-agent",
  name: "Dynamic Agent",
  model: ({ requestContext }) => {
    const useAdvanced = requestContext.task === "complex";
    return useAdvanced
      ? "zenmux/z-ai/glm-5v-turbo"
      : "zenmux/anthropic/claude-3.5-haiku";
  }
});
```