Skip to main content

Chutes logoChutes

Access 33 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);
}
info

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/chutesai/Devstral-Small-2505✗✗✗✓✗32,768
chutes/chutesai/Mistral-Small-3.2-24B-Instruct-2506✗✗✗✓✗131,072
chutes/deepseek-ai/DeepSeek-R1-0528✗✗✗✓✗75,000
chutes/deepseek-ai/DeepSeek-R1-0528-Qwen3-8B✗✗✗✓✗131,072
chutes/deepseek-ai/DeepSeek-R1-Distill-Llama-70B✗✗✗✗✗131,072
chutes/deepseek-ai/DeepSeek-V3-0324✗✗✗✓✗75,000
chutes/deepseek-ai/DeepSeek-V3.1✗✗✗✓✗163,840
chutes/deepseek-ai/DeepSeek-V3.1-Terminus✗✗✗✓✗131,072
chutes/deepseek-ai/DeepSeek-V3.1-turbo✗✗✗✓✗128,000
chutes/deepseek-ai/DeepSeek-V3.1:THINKING✗✗✗✓✗163,840
chutes/deepseek-ai/DeepSeek-V3.2-Exp✗✗✗✓✗128,000
chutes/meituan-longcat/LongCat-Flash-Chat-FP8✗✗✗✓✗131,072
chutes/moonshotai/Kimi-Dev-72B✗✗✗✓✗131,072
chutes/moonshotai/Kimi-K2-Instruct-0905✗✗✗✓✗262,144
chutes/moonshotai/Kimi-K2-Instruct-75k✗✗✗✓✗75,000
chutes/moonshotai/Kimi-VL-A3B-Thinking✓✗✗✓✗131,072
chutes/openai/gpt-oss-120b✗✗✗✓✗131,072
chutes/Qwen/Qwen3-235B-A22B-Instruct-2507✗✗✗✓✗262,144
chutes/Qwen/Qwen3-235B-A22B-Thinking-2507✗✗✗✓✗262,144
chutes/Qwen/Qwen3-30B-A3B✗✗✗✓✗40,960
chutes/Qwen/Qwen3-30B-A3B-Instruct-2507✗✗✗✓✗262,144
chutes/Qwen/Qwen3-30B-A3B-Thinking-2507✗✗✗✓✗262,144
chutes/Qwen/Qwen3-Coder-30B-A3B-Instruct✗✗✗✓✗262,144
chutes/Qwen/Qwen3-Coder-480B-A35B-Instruct-FP8✗✗✗✓✗262,144
chutes/Qwen/Qwen3-Next-80B-A3B-Instruct✗✗✗✓✗262,144
chutes/Qwen/Qwen3-Next-80B-A3B-Thinking✗✗✗✓✗262,144
chutes/tngtech/DeepSeek-R1T-Chimera✗✗✗✗✗163,840
chutes/tngtech/DeepSeek-TNG-R1T2-Chimera✗✗✗✗✗163,840
chutes/zai-org/GLM-4.5-Air✗✗✗✓✗131,072
chutes/zai-org/GLM-4.5-FP8✗✗✗✓✗131,072
chutes/zai-org/GLM-4.5-turbo✗✗✗✓✗131,072
chutes/zai-org/GLM-4.6-FP8✗✗✗✓✗204,800
chutes/zai-org/GLM-4.6-turbo✗✗✗✓✗204,800

Advanced Configuration​

Custom Headers​

const agent = new Agent({
name: "custom-agent",
model: {
url: "https://llm.chutes.ai/v1",
id: "chutes/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-turbo"
: "chutes/Qwen/Qwen3-235B-A22B-Instruct-2507";
}
});

On this page