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

Access 18 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";

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

// 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);
}
```

:::info

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

<ProviderModelsTable
  models={[
  {
    "model": "zenmux/anthropic/claude-haiku-4.5",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 200000,
    "maxOutput": 64000,
    "inputCost": 1,
    "outputCost": 5
  },
  {
    "model": "zenmux/anthropic/claude-opus-4.1",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 200000,
    "maxOutput": 32000,
    "inputCost": 15,
    "outputCost": 75
  },
  {
    "model": "zenmux/anthropic/claude-sonnet-4.5",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 1000000,
    "maxOutput": 64000,
    "inputCost": 3,
    "outputCost": 15
  },
  {
    "model": "zenmux/deepseek/deepseek-chat",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 8000,
    "inputCost": 0.56,
    "outputCost": 1.68
  },
  {
    "model": "zenmux/google/gemini-2.5-pro",
    "imageInput": true,
    "audioInput": true,
    "videoInput": true,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 1048576,
    "maxOutput": 65536,
    "inputCost": 1.25,
    "outputCost": 10
  },
  {
    "model": "zenmux/inclusionai/lint-1t",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 32000,
    "inputCost": 0.56,
    "outputCost": 2.24
  },
  {
    "model": "zenmux/inclusionai/ring-1t",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 32000,
    "inputCost": 0.56,
    "outputCost": 2.24
  },
  {
    "model": "zenmux/kuaishou/kat-coder-pro-v1",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 256000,
    "maxOutput": 32000,
    "inputCost": 0.6,
    "outputCost": 2.4
  },
  {
    "model": "zenmux/moonshotai/kimi-k2-0905",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 262144,
    "maxOutput": 16384,
    "inputCost": 0.6,
    "outputCost": 2.5
  },
  {
    "model": "zenmux/openai/gpt-5",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 400000,
    "maxOutput": 128000,
    "inputCost": 1.25,
    "outputCost": 10
  },
  {
    "model": "zenmux/openai/gpt-5-codex",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 400000,
    "maxOutput": 128000,
    "inputCost": 1.25,
    "outputCost": 10
  },
  {
    "model": "zenmux/qwen/qwen3-coder-plus",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 1000000,
    "maxOutput": 66540,
    "inputCost": 1,
    "outputCost": 5
  },
  {
    "model": "zenmux/x-ai/grok-4",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 256000,
    "maxOutput": 256000,
    "inputCost": 3,
    "outputCost": 15
  },
  {
    "model": "zenmux/x-ai/grok-4-fast",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 2000000,
    "maxOutput": 30000,
    "inputCost": 0.2,
    "outputCost": 0.5
  },
  {
    "model": "zenmux/x-ai/grok-4-fast-non-reasoning",
    "imageInput": true,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": false,
    "contextWindow": 2000000,
    "maxOutput": 30000,
    "inputCost": 0.2,
    "outputCost": 0.5
  },
  {
    "model": "zenmux/x-ai/grok-code-fast-1",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 256000,
    "maxOutput": 10000,
    "inputCost": 0.2,
    "outputCost": 1.5
  },
  {
    "model": "zenmux/z-ai/glm-4.5-air",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 128000,
    "maxOutput": 96000,
    "inputCost": 0.11,
    "outputCost": 0.56
  },
  {
    "model": "zenmux/z-ai/glm-4.6",
    "imageInput": false,
    "audioInput": false,
    "videoInput": false,
    "toolUsage": true,
    "reasoning": true,
    "contextWindow": 200000,
    "maxOutput": 128000,
    "inputCost": 0.35,
    "outputCost": 1.54
  }
]}
/>

## Advanced Configuration

### Custom Headers

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

### Dynamic Model Selection

```typescript
const agent = new Agent({
  name: "dynamic-agent",
  model: ({ runtimeContext }) => {
    const useAdvanced = runtimeContext.task === "complex";
    return useAdvanced
      ? "zenmux/z-ai/glm-4.6"
      : "zenmux/anthropic/claude-haiku-4.5";
  }
});
```




---
title: "Zhipu AI Coding Plan | Models | Mastra"
description: "Use Zhipu AI Coding Plan models with Mastra. 5 models available."
---

{/* This file is auto-generated by generate-model-docs.ts - DO NOT EDIT MANUALLY */}