Kenari
Access 59 Kenari models through Mastra's model router. Authentication is handled automatically using the KENARI_API_KEY environment variable.
Learn more in the Kenari documentation.
.env
KENARI_API_KEY=your-api-key
src/mastra/agents/my-agent.ts
import { Agent } from "@mastra/core/agent";
const agent = new Agent({
id: "my-agent",
name: "My Agent",
instructions: "You are a helpful assistant",
model: "kenari/claude-fable-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);
}
note
Mastra uses the OpenAI-compatible /chat/completions endpoint. Some provider-specific features may not be available. Check the Kenari documentation for details.
ModelsDirect link to Models
| Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
|---|---|---|---|---|---|---|---|---|
kenari/claude-fable-5 | 1.0M | — | — | |||||
kenari/claude-opus-4-7 | 1.0M | — | — | |||||
kenari/claude-opus-4-8 | 1.0M | — | — | |||||
kenari/claude-opus-5 | 1.0M | — | — | |||||
kenari/claude-sonnet-4-6 | 1.0M | — | — | |||||
kenari/claude-sonnet-5 | 1.0M | — | — | |||||
kenari/deepseek-v4-flash | 1.0M | — | — | |||||
kenari/deepseek-v4-flash:free | 1.0M | — | — | |||||
kenari/deepseek-v4-pro | 1.0M | — | — | |||||
kenari/gemini-2-5-flash | 1.0M | — | — | |||||
kenari/gemini-2-5-flash-lite | 1.0M | — | — | |||||
kenari/gemini-3-1-flash-lite | 1.0M | — | — | |||||
kenari/gemini-3-1-flash-tts | 8K | — | — | |||||
kenari/gemini-3-1-pro | 1.0M | — | — | |||||
kenari/gemini-3-5-flash | 1.0M | — | — | |||||
kenari/gemini-3-6-flash | 1.0M | — | — | |||||
kenari/gemini-3-7-flash | 1.0M | — | — | |||||
kenari/gemma-4-31b-it | 262K | — | — | |||||
kenari/glm-4-7-flash:free | 200K | — | — | |||||
kenari/glm-5-1 | 200K | — | — | |||||
kenari/glm-5-2 | 1.0M | — | — | |||||
kenari/glm-5-3 | 1.0M | — | — | |||||
kenari/glm-5-3-flash | 1.0M | — | — | |||||
kenari/gpt-5-4-mini | 400K | — | — | |||||
kenari/gpt-5-5 | 1.1M | — | — | |||||
kenari/gpt-5-6-luna | 1.1M | — | — | |||||
kenari/gpt-5-6-sol | 1.1M | — | — | |||||
kenari/gpt-5-6-terra | 1.1M | — | — | |||||
kenari/gpt-image-2 | 272K | — | — | |||||
kenari/gpt-oss-120b | 131K | — | — | |||||
kenari/gpt-oss-20b | 131K | — | — | |||||
kenari/grok-4-5 | 500K | — | — | |||||
kenari/grok-4-6 | 500K | — | — | |||||
kenari/grok-build-0-1 | 256K | — | — | |||||
kenari/grok-imagine-image-2-0 | 8K | — | — | |||||
kenari/hy3 | 256K | — | — | |||||
kenari/hy3:free | 256K | — | — | |||||
kenari/kimi-k2-6 | 262K | — | — | |||||
kenari/kimi-k2-6:free | 262K | — | — | |||||
kenari/kimi-k2-7-code | 262K | — | — | |||||
kenari/kimi-k2-7-code:free | 262K | — | — | |||||
kenari/kimi-k3 | 1.0M | — | — | |||||
kenari/mimo-v2-5 | 1.0M | — | — | |||||
kenari/mimo-v2-5-pro | 1.0M | — | — | |||||
kenari/mimo-v2-5:free | 1.0M | — | — | |||||
kenari/minimax-m2-7 | 205K | — | — | |||||
kenari/minimax-m2-7-highspeed | 205K | — | — | |||||
kenari/minimax-m3 | 1.0M | — | — | |||||
kenari/mistral-large:free | 262K | — | — | |||||
kenari/mistral-medium-3-5:free | 262K | — | — | |||||
kenari/nemotron-3-nano-30b-a3b | 262K | — | — | |||||
kenari/nemotron-3-super-120b-a12b | 262K | — | — | |||||
kenari/nemotron-3-super-120b-a12b:free | 262K | — | — | |||||
kenari/nemotron-3-ultra-550b-a55b | 1.0M | — | — | |||||
kenari/qwen3-7-plus | 1.0M | — | — | |||||
kenari/qwen3-8-max | 1.0M | — | — | |||||
kenari/step-3-7-flash | 256K | — | — | |||||
kenari/step-3-7-flash:free | 256K | — | — | |||||
kenari/whisper-large-v3-turbo | 448 | — | — |
Model availability, capabilities, context windows, and pricing are sourced from models.dev and may change.
Advanced configurationDirect link to Advanced configuration
Custom headersDirect link to Custom headers
src/mastra/agents/my-agent.ts
const agent = new Agent({
id: "custom-agent",
name: "custom-agent",
model: {
url: "https://kenari.id/v1",
id: "kenari/claude-fable-5",
apiKey: process.env.KENARI_API_KEY,
headers: {
"X-Custom-Header": "value"
}
}
});
Dynamic model selectionDirect link to Dynamic model selection
src/mastra/agents/my-agent.ts
const agent = new Agent({
id: "dynamic-agent",
name: "Dynamic Agent",
model: ({ requestContext }) => {
const useAdvanced = requestContext.task === "complex";
return useAdvanced
? "kenari/whisper-large-v3-turbo"
: "kenari/claude-fable-5";
}
});