# ![SiliconFlow logo](https://models.dev/logos/siliconflow.svg)SiliconFlow Access 74 SiliconFlow models through Mastra's model router. Authentication is handled automatically using the `SILICONFLOW_API_KEY` environment variable. Learn more in the [SiliconFlow documentation](https://cloud.siliconflow.com/models). ```bash SILICONFLOW_API_KEY=your-api-key ``` ```typescript import { Agent } from "@mastra/core/agent"; const agent = new Agent({ id: "my-agent", name: "My Agent", instructions: "You are a helpful assistant", model: "siliconflow/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); } ``` Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [SiliconFlow documentation](https://cloud.siliconflow.com/models) for details. ## Models | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M | | ------------------------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- | | `siliconflow/baidu/ERNIE-4.5-300B-A47B` | 131K | | | | | | $0.28 | $1 | | `siliconflow/ByteDance-Seed/Seed-OSS-36B-Instruct` | 262K | | | | | | $0.21 | $0.57 | | `siliconflow/deepseek-ai/DeepSeek-R1` | 164K | | | | | | $0.50 | $2 | | `siliconflow/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B` | 131K | | | | | | $0.10 | $0.10 | | `siliconflow/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B` | 131K | | | | | | $0.18 | $0.18 | | `siliconflow/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B` | 33K | | | | | | $0.05 | $0.05 | | `siliconflow/deepseek-ai/DeepSeek-V3` | 164K | | | | | | $0.25 | $1 | | `siliconflow/deepseek-ai/DeepSeek-V3.1` | 164K | | | | | | $0.27 | $1 | | `siliconflow/deepseek-ai/DeepSeek-V3.1-Terminus` | 164K | | | | | | $0.27 | $1 | | `siliconflow/deepseek-ai/DeepSeek-V3.2` | 164K | | | | | | $0.27 | $0.42 | | `siliconflow/deepseek-ai/DeepSeek-V3.2-Exp` | 164K | | | | | | $0.27 | $0.41 | | `siliconflow/deepseek-ai/deepseek-vl2` | 4K | | | | | | $0.15 | $0.15 | | `siliconflow/inclusionAI/Ling-flash-2.0` | 131K | | | | | | $0.14 | $0.57 | | `siliconflow/inclusionAI/Ling-mini-2.0` | 131K | | | | | | $0.07 | $0.28 | | `siliconflow/inclusionAI/Ring-flash-2.0` | 131K | | | | | | $0.14 | $0.57 | | `siliconflow/meta-llama/Meta-Llama-3.1-8B-Instruct` | 33K | | | | | | $0.06 | $0.06 | | `siliconflow/MiniMaxAI/MiniMax-M1-80k` | 131K | | | | | | $0.55 | $2 | | `siliconflow/MiniMaxAI/MiniMax-M2` | 197K | | | | | | $0.30 | $1 | | `siliconflow/MiniMaxAI/MiniMax-M2.1` | 197K | | | | | | $0.30 | $1 | | `siliconflow/moonshotai/Kimi-Dev-72B` | 131K | | | | | | $0.29 | $1 | | `siliconflow/moonshotai/Kimi-K2-Instruct` | 131K | | | | | | $0.58 | $2 | | `siliconflow/moonshotai/Kimi-K2-Instruct-0905` | 262K | | | | | | $0.40 | $2 | | `siliconflow/moonshotai/Kimi-K2-Thinking` | 262K | | | | | | $0.55 | $3 | | `siliconflow/nex-agi/DeepSeek-V3.1-Nex-N1` | 131K | | | | | | $0.50 | $2 | | `siliconflow/openai/gpt-oss-120b` | 131K | | | | | | $0.05 | $0.45 | | `siliconflow/openai/gpt-oss-20b` | 131K | | | | | | $0.04 | $0.18 | | `siliconflow/Qwen/Qwen2.5-14B-Instruct` | 33K | | | | | | $0.10 | $0.10 | | `siliconflow/Qwen/Qwen2.5-32B-Instruct` | 33K | | | | | | $0.18 | $0.18 | | `siliconflow/Qwen/Qwen2.5-72B-Instruct` | 33K | | | | | | $0.59 | $0.59 | | `siliconflow/Qwen/Qwen2.5-72B-Instruct-128K` | 131K | | | | | | $0.59 | $0.59 | | `siliconflow/Qwen/Qwen2.5-7B-Instruct` | 33K | | | | | | $0.05 | $0.05 | | `siliconflow/Qwen/Qwen2.5-Coder-32B-Instruct` | 33K | | | | | | $0.18 | $0.18 | | `siliconflow/Qwen/Qwen2.5-VL-32B-Instruct` | 131K | | | | | | $0.27 | $0.27 | | `siliconflow/Qwen/Qwen2.5-VL-72B-Instruct` | 131K | | | | | | $0.59 | $0.59 | | `siliconflow/Qwen/Qwen2.5-VL-7B-Instruct` | 33K | | | | | | $0.05 | $0.05 | | `siliconflow/Qwen/Qwen3-14B` | 131K | | | | | | $0.07 | $0.28 | | `siliconflow/Qwen/Qwen3-235B-A22B` | 131K | | | | | | $0.35 | $1 | | `siliconflow/Qwen/Qwen3-235B-A22B-Instruct-2507` | 262K | | | | | | $0.09 | $0.60 | | `siliconflow/Qwen/Qwen3-235B-A22B-Thinking-2507` | 262K | | | | | | $0.13 | $0.60 | | `siliconflow/Qwen/Qwen3-30B-A3B` | 131K | | | | | | $0.09 | $0.45 | | `siliconflow/Qwen/Qwen3-30B-A3B-Instruct-2507` | 262K | | | | | | $0.09 | $0.30 | | `siliconflow/Qwen/Qwen3-30B-A3B-Thinking-2507` | 262K | | | | | | $0.09 | $0.30 | | `siliconflow/Qwen/Qwen3-32B` | 131K | | | | | | $0.14 | $0.57 | | `siliconflow/Qwen/Qwen3-8B` | 131K | | | | | | $0.06 | $0.06 | | `siliconflow/Qwen/Qwen3-Coder-30B-A3B-Instruct` | 262K | | | | | | $0.07 | $0.28 | | `siliconflow/Qwen/Qwen3-Coder-480B-A35B-Instruct` | 262K | | | | | | $0.25 | $1 | | `siliconflow/Qwen/Qwen3-Next-80B-A3B-Instruct` | 262K | | | | | | $0.14 | $1 | | `siliconflow/Qwen/Qwen3-Next-80B-A3B-Thinking` | 262K | | | | | | $0.14 | $0.57 | | `siliconflow/Qwen/Qwen3-Omni-30B-A3B-Captioner` | 66K | | | | | | $0.10 | $0.40 | | `siliconflow/Qwen/Qwen3-Omni-30B-A3B-Instruct` | 66K | | | | | | $0.10 | $0.40 | | `siliconflow/Qwen/Qwen3-Omni-30B-A3B-Thinking` | 66K | | | | | | $0.10 | $0.40 | | `siliconflow/Qwen/Qwen3-VL-235B-A22B-Instruct` | 262K | | | | | | $0.30 | $2 | | `siliconflow/Qwen/Qwen3-VL-235B-A22B-Thinking` | 262K | | | | | | $0.45 | $4 | | `siliconflow/Qwen/Qwen3-VL-30B-A3B-Instruct` | 262K | | | | | | $0.29 | $1 | | `siliconflow/Qwen/Qwen3-VL-30B-A3B-Thinking` | 262K | | | | | | $0.29 | $1 | | `siliconflow/Qwen/Qwen3-VL-32B-Instruct` | 262K | | | | | | $0.20 | $0.60 | | `siliconflow/Qwen/Qwen3-VL-32B-Thinking` | 262K | | | | | | $0.20 | $2 | | `siliconflow/Qwen/Qwen3-VL-8B-Instruct` | 262K | | | | | | $0.18 | $0.68 | | `siliconflow/Qwen/Qwen3-VL-8B-Thinking` | 262K | | | | | | $0.18 | $2 | | `siliconflow/Qwen/QwQ-32B` | 131K | | | | | | $0.15 | $0.58 | | `siliconflow/stepfun-ai/step3` | 66K | | | | | | $0.57 | $1 | | `siliconflow/tencent/Hunyuan-A13B-Instruct` | 131K | | | | | | $0.14 | $0.57 | | `siliconflow/tencent/Hunyuan-MT-7B` | 33K | | | | | | — | — | | `siliconflow/THUDM/GLM-4-32B-0414` | 33K | | | | | | $0.27 | $0.27 | | `siliconflow/THUDM/GLM-4-9B-0414` | 33K | | | | | | $0.09 | $0.09 | | `siliconflow/THUDM/GLM-4.1V-9B-Thinking` | 66K | | | | | | $0.04 | $0.14 | | `siliconflow/THUDM/GLM-Z1-32B-0414` | 131K | | | | | | $0.14 | $0.57 | | `siliconflow/THUDM/GLM-Z1-9B-0414` | 131K | | | | | | $0.09 | $0.09 | | `siliconflow/zai-org/GLM-4.5` | 131K | | | | | | $0.40 | $2 | | `siliconflow/zai-org/GLM-4.5-Air` | 131K | | | | | | $0.14 | $0.86 | | `siliconflow/zai-org/GLM-4.5V` | 66K | | | | | | $0.14 | $0.86 | | `siliconflow/zai-org/GLM-4.6` | 205K | | | | | | $0.50 | $2 | | `siliconflow/zai-org/GLM-4.6V` | 131K | | | | | | $0.30 | $0.90 | | `siliconflow/zai-org/GLM-4.7` | 205K | | | | | | $0.60 | $2 | ## Advanced Configuration ### Custom Headers ```typescript const agent = new Agent({ id: "custom-agent", name: "custom-agent", model: { url: "https://api.siliconflow.com/v1", id: "siliconflow/ByteDance-Seed/Seed-OSS-36B-Instruct", apiKey: process.env.SILICONFLOW_API_KEY, headers: { "X-Custom-Header": "value" } } }); ``` ### Dynamic Model Selection ```typescript const agent = new Agent({ id: "dynamic-agent", name: "Dynamic Agent", model: ({ requestContext }) => { const useAdvanced = requestContext.task === "complex"; return useAdvanced ? "siliconflow/zai-org/GLM-4.7" : "siliconflow/ByteDance-Seed/Seed-OSS-36B-Instruct"; } }); ```