Skip to main content

Chutes logoChutes

Access 31 Chutes models through Mastra's model router. Authentication is handled automatically using the CHUTES_API_KEY environment variable.

Learn more in the Chutes documentation.

CHUTES_API_KEY=your-api-key
import { Agent } from "@mastra/core";

const agent = new Agent({
name: "my-agent",
instructions: "You are a helpful assistant",
model: "chutes/Qwen/Qwen3-235B-A22B-Instruct-2507",
});

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

Mastra uses the OpenAI-compatible /chat/completions endpoint. Some provider-specific features may not be available. Check the Chutes documentation for details.

Models

ModelImageAudioVideoToolsStreamingContext Window
chutes/moonshotai/Kimi-Dev-72B131,072
chutes/moonshotai/Kimi-K2-Instruct-75k75,000
chutes/moonshotai/Kimi-K2-Instruct-0905262,144
chutes/moonshotai/Kimi-VL-A3B-Thinking131,072
chutes/meituan-longcat/LongCat-Flash-Chat-FP8131,072
chutes/tngtech/DeepSeek-R1T-Chimera163,840
chutes/tngtech/DeepSeek-TNG-R1T2-Chimera163,840
chutes/openai/gpt-oss-120b131,072
chutes/chutesai/Devstral-Small-250532,768
chutes/chutesai/Mistral-Small-3.2-24B-Instruct-2506131,072
chutes/Qwen/Qwen3-30B-A3B40,960
chutes/Qwen/Qwen3-30B-A3B-Thinking-2507262,144
chutes/Qwen/Qwen3-235B-A22B-Instruct-2507262,144
chutes/Qwen/Qwen3-Coder-30B-A3B-Instruct262,144
chutes/Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8262,144
chutes/Qwen/Qwen3-30B-A3B-Instruct-2507262,144
chutes/Qwen/Qwen3-235B-A22B-Thinking-2507262,144
chutes/Qwen/Qwen3-Next-80B-A3B-Instruct262,144
chutes/Qwen/Qwen3-Next-80B-A3B-Thinking262,144
chutes/zai-org/GLM-4.5-turbo131,072
chutes/zai-org/GLM-4.6-FP8204,800
chutes/zai-org/GLM-4.5-FP8131,072
chutes/zai-org/GLM-4.5-Air131,072
chutes/deepseek-ai/DeepSeek-R1-0528-Qwen3-8B131,072
chutes/deepseek-ai/DeepSeek-R1-052875,000
chutes/deepseek-ai/DeepSeek-V3.1-Terminus131,072
chutes/deepseek-ai/DeepSeek-V3.1-turbo128,000
chutes/deepseek-ai/DeepSeek-V3.1:THINKING163,840
chutes/deepseek-ai/DeepSeek-R1-Distill-Llama-70B131,072
chutes/deepseek-ai/DeepSeek-V3.1163,840
chutes/deepseek-ai/DeepSeek-V3-032475,000

Advanced Configuration

Custom Headers

const agent = new Agent({
name: "custom-agent",
model: {
url: "https://llm.chutes.ai/v1",
modelId: "Qwen/Qwen3-235B-A22B-Instruct-2507",
apiKey: process.env.CHUTES_API_KEY,
headers: {
"X-Custom-Header": "value",
},
},
});

Dynamic Model Selection

const agent = new Agent({
name: "dynamic-agent",
model: ({ runtimeContext }) => {
const useAdvanced = runtimeContext.task === "complex";
return useAdvanced
? "chutes/zai-org/GLM-4.6-FP8"
: "chutes/Qwen/Qwen3-235B-A22B-Instruct-2507";
},
});