Skip to main content

SiliconFlow (China) logoSiliconFlow (China)

Access 72 SiliconFlow (China) models through Mastra's model router. Authentication is handled automatically using the SILICONFLOW_API_KEY environment variable.

Learn more in the SiliconFlow (China) documentation.

SILICONFLOW_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: "siliconflow-cn/ByteDance-Seed/Seed-OSS-36B-Instruct"
});

// 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 SiliconFlow (China) documentation for details.

Models
Direct link to Models

ModelContextToolsReasoningImageAudioVideoInput $/1MOutput $/1M
siliconflow-cn/baidu/ERNIE-4.5-300B-A47B131K$0.28$1
siliconflow-cn/ByteDance-Seed/Seed-OSS-36B-Instruct262K$0.21$0.57
siliconflow-cn/deepseek-ai/DeepSeek-R1164K$0.50$2
siliconflow-cn/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B131K$0.10$0.10
siliconflow-cn/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B131K$0.18$0.18
siliconflow-cn/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B33K$0.05$0.05
siliconflow-cn/deepseek-ai/DeepSeek-V3164K$0.25$1
siliconflow-cn/deepseek-ai/DeepSeek-V3.1164K$0.27$1
siliconflow-cn/deepseek-ai/DeepSeek-V3.1-Terminus164K$0.27$1
siliconflow-cn/deepseek-ai/DeepSeek-V3.2-Exp164K$0.27$0.41
siliconflow-cn/deepseek-ai/deepseek-vl24K$0.15$0.15
siliconflow-cn/inclusionAI/Ling-flash-2.0131K$0.14$0.57
siliconflow-cn/inclusionAI/Ling-mini-2.0131K$0.07$0.28
siliconflow-cn/inclusionAI/Ring-flash-2.0131K$0.14$0.57
siliconflow-cn/meta-llama/Meta-Llama-3.1-8B-Instruct33K$0.06$0.06
siliconflow-cn/MiniMaxAI/MiniMax-M1-80k131K$0.55$2
siliconflow-cn/MiniMaxAI/MiniMax-M2197K$0.30$1
siliconflow-cn/moonshotai/Kimi-Dev-72B131K$0.29$1
siliconflow-cn/moonshotai/Kimi-K2-Instruct131K$0.58$2
siliconflow-cn/moonshotai/Kimi-K2-Instruct-0905262K$0.40$2
siliconflow-cn/moonshotai/Kimi-K2-Thinking262K$0.55$3
siliconflow-cn/nex-agi/DeepSeek-V3.1-Nex-N1131K$0.50$2
siliconflow-cn/openai/gpt-oss-120b131K$0.05$0.45
siliconflow-cn/openai/gpt-oss-20b131K$0.04$0.18
siliconflow-cn/Qwen/Qwen2.5-14B-Instruct33K$0.10$0.10
siliconflow-cn/Qwen/Qwen2.5-32B-Instruct33K$0.18$0.18
siliconflow-cn/Qwen/Qwen2.5-72B-Instruct33K$0.59$0.59
siliconflow-cn/Qwen/Qwen2.5-72B-Instruct-128K131K$0.59$0.59
siliconflow-cn/Qwen/Qwen2.5-7B-Instruct33K$0.05$0.05
siliconflow-cn/Qwen/Qwen2.5-Coder-32B-Instruct33K$0.18$0.18
siliconflow-cn/Qwen/Qwen2.5-VL-32B-Instruct131K$0.27$0.27
siliconflow-cn/Qwen/Qwen2.5-VL-72B-Instruct131K$0.59$0.59
siliconflow-cn/Qwen/Qwen2.5-VL-7B-Instruct33K$0.05$0.05
siliconflow-cn/Qwen/Qwen3-14B131K$0.07$0.28
siliconflow-cn/Qwen/Qwen3-235B-A22B131K$0.35$1
siliconflow-cn/Qwen/Qwen3-235B-A22B-Instruct-2507262K$0.09$0.60
siliconflow-cn/Qwen/Qwen3-235B-A22B-Thinking-2507262K$0.13$0.60
siliconflow-cn/Qwen/Qwen3-30B-A3B131K$0.09$0.45
siliconflow-cn/Qwen/Qwen3-30B-A3B-Instruct-2507262K$0.09$0.30
siliconflow-cn/Qwen/Qwen3-30B-A3B-Thinking-2507262K$0.09$0.30
siliconflow-cn/Qwen/Qwen3-32B131K$0.14$0.57
siliconflow-cn/Qwen/Qwen3-8B131K$0.06$0.06
siliconflow-cn/Qwen/Qwen3-Coder-30B-A3B-Instruct262K$0.07$0.28
siliconflow-cn/Qwen/Qwen3-Coder-480B-A35B-Instruct262K$0.25$1
siliconflow-cn/Qwen/Qwen3-Next-80B-A3B-Instruct262K$0.14$1
siliconflow-cn/Qwen/Qwen3-Next-80B-A3B-Thinking262K$0.14$0.57
siliconflow-cn/Qwen/Qwen3-Omni-30B-A3B-Captioner66K$0.10$0.40
siliconflow-cn/Qwen/Qwen3-Omni-30B-A3B-Instruct66K$0.10$0.40
siliconflow-cn/Qwen/Qwen3-Omni-30B-A3B-Thinking66K$0.10$0.40
siliconflow-cn/Qwen/Qwen3-VL-235B-A22B-Instruct262K$0.30$2
siliconflow-cn/Qwen/Qwen3-VL-235B-A22B-Thinking262K$0.45$4
siliconflow-cn/Qwen/Qwen3-VL-30B-A3B-Instruct262K$0.29$1
siliconflow-cn/Qwen/Qwen3-VL-30B-A3B-Thinking262K$0.29$1
siliconflow-cn/Qwen/Qwen3-VL-32B-Instruct262K$0.20$0.60
siliconflow-cn/Qwen/Qwen3-VL-32B-Thinking262K$0.20$2
siliconflow-cn/Qwen/Qwen3-VL-8B-Instruct262K$0.18$0.68
siliconflow-cn/Qwen/Qwen3-VL-8B-Thinking262K$0.18$2
siliconflow-cn/Qwen/QwQ-32B131K$0.15$0.58
siliconflow-cn/stepfun-ai/step366K$0.57$1
siliconflow-cn/tencent/Hunyuan-A13B-Instruct131K$0.14$0.57
siliconflow-cn/tencent/Hunyuan-MT-7B33K
siliconflow-cn/THUDM/GLM-4-32B-041433K$0.27$0.27
siliconflow-cn/THUDM/GLM-4-9B-041433K$0.09$0.09
siliconflow-cn/THUDM/GLM-4.1V-9B-Thinking66K$0.04$0.14
siliconflow-cn/THUDM/GLM-Z1-32B-0414131K$0.14$0.57
siliconflow-cn/THUDM/GLM-Z1-9B-0414131K$0.09$0.09
siliconflow-cn/z-ai/GLM-4.5131K$0.40$2
siliconflow-cn/z-ai/GLM-4.5-Air131K$0.14$0.86
siliconflow-cn/zai-org/GLM-4.5131K$0.40$2
siliconflow-cn/zai-org/GLM-4.5-Air131K$0.14$0.86
siliconflow-cn/zai-org/GLM-4.5V66K$0.14$0.86
siliconflow-cn/zai-org/GLM-4.6205K$0.50$2
72 available models

Advanced Configuration
Direct link to Advanced Configuration

Custom Headers
Direct link to Custom Headers

const agent = new Agent({
id: "custom-agent",
name: "custom-agent",
model: {
url: "https://api.siliconflow.cn/v1",
id: "siliconflow-cn/ByteDance-Seed/Seed-OSS-36B-Instruct",
apiKey: process.env.SILICONFLOW_API_KEY,
headers: {
"X-Custom-Header": "value"
}
}
});

Dynamic Model Selection
Direct link to Dynamic Model Selection

const agent = new Agent({
id: "dynamic-agent",
name: "Dynamic Agent",
model: ({ requestContext }) => {
const useAdvanced = requestContext.task === "complex";
return useAdvanced
? "siliconflow-cn/zai-org/GLM-4.6"
: "siliconflow-cn/ByteDance-Seed/Seed-OSS-36B-Instruct";
}
});

On this page