docs/src/content/en/models/providers/zenmux.mdx
Access 69 ZenMux models through Mastra's model router. Authentication is handled automatically using the ZENMUX_API_KEY environment variable.
Learn more in the ZenMux documentation.
ZENMUX_API_KEY=your-api-key
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);
}
:::info
Mastra uses the OpenAI-compatible /chat/completions endpoint. Some provider-specific features may not be available. Check the ZenMux documentation for details.
:::
<ProviderModelsTable models={[ { "model": "zenmux/anthropic/claude-3.5-haiku", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 0.8, "outputCost": 4 }, { "model": "zenmux/anthropic/claude-3.5-sonnet", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 3, "outputCost": 15 }, { "model": "zenmux/anthropic/claude-3.7-sonnet", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 3, "outputCost": 15 }, { "model": "zenmux/anthropic/claude-haiku-4.5", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 1, "outputCost": 5 }, { "model": "zenmux/anthropic/claude-opus-4", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 15, "outputCost": 75 }, { "model": "zenmux/anthropic/claude-opus-4.1", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 15, "outputCost": 75 }, { "model": "zenmux/anthropic/claude-opus-4.5", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 5, "outputCost": 25 }, { "model": "zenmux/anthropic/claude-opus-4.6", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 1000000, "maxOutput": 128000, "inputCost": 5, "outputCost": 25 }, { "model": "zenmux/anthropic/claude-sonnet-4", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 1000000, "maxOutput": 64000, "inputCost": 3, "outputCost": 15 }, { "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/anthropic/claude-sonnet-4.6", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 1000000, "maxOutput": 64000, "inputCost": 3, "outputCost": 15 }, { "model": "zenmux/baidu/ernie-5.0-thinking-preview", "imageInput": true, "audioInput": false, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 128000, "maxOutput": 64000, "inputCost": 0.84, "outputCost": 3.37 }, { "model": "zenmux/deepseek/deepseek-chat", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 128000, "maxOutput": 64000, "inputCost": 0.28, "outputCost": 0.42 }, { "model": "zenmux/deepseek/deepseek-v3.2", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 128000, "maxOutput": 64000, "inputCost": 0.28, "outputCost": 0.43 }, { "model": "zenmux/deepseek/deepseek-v3.2-exp", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 163000, "maxOutput": 64000, "inputCost": 0.22, "outputCost": 0.33 }, { "model": "zenmux/google/gemini-2.5-flash", "imageInput": true, "audioInput": true, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 1048000, "maxOutput": 64000, "inputCost": 0.3, "outputCost": 2.5 }, { "model": "zenmux/google/gemini-2.5-flash-lite", "imageInput": true, "audioInput": true, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 1048000, "maxOutput": 64000, "inputCost": 0.1, "outputCost": 0.4 }, { "model": "zenmux/google/gemini-2.5-pro", "imageInput": true, "audioInput": true, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 1048000, "maxOutput": 64000, "inputCost": 1.25, "outputCost": 10 }, { "model": "zenmux/google/gemini-3-flash-preview", "imageInput": true, "audioInput": true, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 1048000, "maxOutput": 64000, "inputCost": 0.5, "outputCost": 3 }, { "model": "zenmux/google/gemini-3-pro-preview", "imageInput": true, "audioInput": true, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 1048000, "maxOutput": 64000, "inputCost": 2, "outputCost": 12 }, { "model": "zenmux/google/gemini-3.1-pro-preview", "imageInput": true, "audioInput": true, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 1048000, "maxOutput": 64000, "inputCost": 2, "outputCost": 12 }, { "model": "zenmux/inclusionai/ling-1t", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 128000, "maxOutput": 64000, "inputCost": 0.56, "outputCost": 2.24 }, { "model": "zenmux/inclusionai/ring-1t", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 128000, "maxOutput": 64000, "inputCost": 0.56, "outputCost": 2.24 }, { "model": "zenmux/kuaishou/kat-coder-pro-v1", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 256000, "maxOutput": 64000, "inputCost": 0.3, "outputCost": 1.2 }, { "model": "zenmux/kuaishou/kat-coder-pro-v1-free", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 256000, "maxOutput": 64000, "inputCost": null, "outputCost": null }, { "model": "zenmux/minimax/minimax-m2", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 204000, "maxOutput": 64000, "inputCost": 0.3, "outputCost": 1.2 }, { "model": "zenmux/minimax/minimax-m2.1", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 204000, "maxOutput": 64000, "inputCost": 0.3, "outputCost": 1.2 }, { "model": "zenmux/minimax/minimax-m2.5", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 204800, "maxOutput": 131072, "inputCost": 0.3, "outputCost": 1.2 }, { "model": "zenmux/minimax/minimax-m2.5-lightning", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 204800, "maxOutput": 131072, "inputCost": 0.6, "outputCost": 4.8 }, { "model": "zenmux/moonshotai/kimi-k2-0905", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 262000, "maxOutput": 64000, "inputCost": 0.6, "outputCost": 2.5 }, { "model": "zenmux/moonshotai/kimi-k2-thinking", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 64000, "inputCost": 0.6, "outputCost": 2.5 }, { "model": "zenmux/moonshotai/kimi-k2-thinking-turbo", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 64000, "inputCost": 1.15, "outputCost": 8 }, { "model": "zenmux/moonshotai/kimi-k2.5", "imageInput": true, "audioInput": false, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 64000, "inputCost": 0.58, "outputCost": 3.02 }, { "model": "zenmux/openai/gpt-5", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 400000, "maxOutput": 64000, "inputCost": 1.25, "outputCost": 10 }, { "model": "zenmux/openai/gpt-5-codex", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 400000, "maxOutput": 64000, "inputCost": 1.25, "outputCost": 10 }, { "model": "zenmux/openai/gpt-5.1", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 400000, "maxOutput": 64000, "inputCost": 1.25, "outputCost": 10 }, { "model": "zenmux/openai/gpt-5.1-chat", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 128000, "maxOutput": 64000, "inputCost": 1.25, "outputCost": 10 }, { "model": "zenmux/openai/gpt-5.1-codex", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 400000, "maxOutput": 64000, "inputCost": 1.25, "outputCost": 10 }, { "model": "zenmux/openai/gpt-5.1-codex-mini", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 400000, "maxOutput": 64000, "inputCost": 0.25, "outputCost": 2 }, { "model": "zenmux/openai/gpt-5.2", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 400000, "maxOutput": 64000, "inputCost": 1.75, "outputCost": 14 }, { "model": "zenmux/openai/gpt-5.2-codex", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 400000, "maxOutput": 64000, "inputCost": 1.75, "outputCost": 14 }, { "model": "zenmux/openai/gpt-5.2-pro", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 400000, "maxOutput": 128000, "inputCost": 21, "outputCost": 168 }, { "model": "zenmux/qwen/qwen3-coder-plus", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 1000000, "maxOutput": 64000, "inputCost": 1, "outputCost": 5 }, { "model": "zenmux/qwen/qwen3-max", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 256000, "maxOutput": 64000, "inputCost": 1.2, "outputCost": 6 }, { "model": "zenmux/stepfun/step-3", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 65536, "maxOutput": 64000, "inputCost": 0.21, "outputCost": 0.57 }, { "model": "zenmux/stepfun/step-3.5-flash", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 256000, "maxOutput": 64000, "inputCost": 0.1, "outputCost": 0.3 }, { "model": "zenmux/stepfun/step-3.5-flash-free", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 256000, "maxOutput": 64000, "inputCost": null, "outputCost": null }, { "model": "zenmux/volcengine/doubao-seed-1.8", "imageInput": true, "audioInput": false, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 256000, "maxOutput": 64000, "inputCost": 0.11, "outputCost": 0.28 }, { "model": "zenmux/volcengine/doubao-seed-2.0-lite", "imageInput": true, "audioInput": false, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 256000, "maxOutput": 64000, "inputCost": 0.09, "outputCost": 0.51 }, { "model": "zenmux/volcengine/doubao-seed-2.0-mini", "imageInput": true, "audioInput": false, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 256000, "maxOutput": 64000, "inputCost": 0.03, "outputCost": 0.28 }, { "model": "zenmux/volcengine/doubao-seed-2.0-pro", "imageInput": true, "audioInput": false, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 256000, "maxOutput": 64000, "inputCost": 0.45, "outputCost": 2.24 }, { "model": "zenmux/volcengine/doubao-seed-code", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 256000, "maxOutput": 64000, "inputCost": 0.17, "outputCost": 1.12 }, { "model": "zenmux/x-ai/grok-4", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 256000, "maxOutput": 64000, "inputCost": 3, "outputCost": 15 }, { "model": "zenmux/x-ai/grok-4-fast", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 2000000, "maxOutput": 64000, "inputCost": 0.2, "outputCost": 0.5 }, { "model": "zenmux/x-ai/grok-4.1-fast", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 2000000, "maxOutput": 64000, "inputCost": 0.2, "outputCost": 0.5 }, { "model": "zenmux/x-ai/grok-4.1-fast-non-reasoning", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 2000000, "maxOutput": 64000, "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": 64000, "inputCost": 0.2, "outputCost": 1.5 }, { "model": "zenmux/xiaomi/mimo-v2-flash", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 64000, "inputCost": 0.1, "outputCost": 0.3 }, { "model": "zenmux/xiaomi/mimo-v2-flash-free", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 64000, "inputCost": null, "outputCost": null }, { "model": "zenmux/z-ai/glm-4.5", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 128000, "maxOutput": 64000, "inputCost": 0.35, "outputCost": 1.54 }, { "model": "zenmux/z-ai/glm-4.5-air", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 128000, "maxOutput": 64000, "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": 64000, "inputCost": 0.35, "outputCost": 1.54 }, { "model": "zenmux/z-ai/glm-4.6v", "imageInput": true, "audioInput": false, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 0.14, "outputCost": 0.42 }, { "model": "zenmux/z-ai/glm-4.6v-flash", "imageInput": true, "audioInput": false, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 0.02, "outputCost": 0.21 }, { "model": "zenmux/z-ai/glm-4.6v-flash-free", "imageInput": true, "audioInput": false, "videoInput": true, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": null, "outputCost": null }, { "model": "zenmux/z-ai/glm-4.7", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 0.28, "outputCost": 1.14 }, { "model": "zenmux/z-ai/glm-4.7-flash-free", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": null, "outputCost": null }, { "model": "zenmux/z-ai/glm-4.7-flashx", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 64000, "inputCost": 0.07, "outputCost": 0.42 }, { "model": "zenmux/z-ai/glm-5", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 200000, "maxOutput": 128000, "inputCost": 0.58, "outputCost": 2.6 } ]} />
const agent = new Agent({
id: "custom-agent",
name: "custom-agent",
model: {
url: "https://zenmux.ai/api/anthropic/v1",
id: "zenmux/anthropic/claude-3.5-haiku",
apiKey: process.env.ZENMUX_API_KEY,
headers: {
"X-Custom-Header": "value"
}
}
});
const agent = new Agent({
id: "dynamic-agent",
name: "Dynamic Agent",
model: ({ requestContext }) => {
const useAdvanced = requestContext.task === "complex";
return useAdvanced
? "zenmux/z-ai/glm-5"
: "zenmux/anthropic/claude-3.5-haiku";
}
});
This provider can also be installed directly as a standalone package, which can be used instead of the Mastra model router string. View the package documentation for more details.
npm install @ai-sdk/anthropic