Back to Mastra

SiliconFlow | Models

docs/src/content/en/models/providers/siliconflow.mdx

2025-12-1821.3 KB
Original Source

SiliconFlow

Access 70 SiliconFlow models through Mastra's model router. Authentication is handled automatically using the SILICONFLOW_API_KEY environment variable.

Learn more in the SiliconFlow documentation.

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);
}

:::info

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

:::

Models

<ProviderModelsTable models={[ { "model": "siliconflow/baidu/ERNIE-4.5-300B-A47B", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.28, "outputCost": 1.1 }, { "model": "siliconflow/ByteDance-Seed/Seed-OSS-36B-Instruct", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.21, "outputCost": 0.57 }, { "model": "siliconflow/deepseek-ai/DeepSeek-R1", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 164000, "maxOutput": 164000, "inputCost": 0.5, "outputCost": 2.18 }, { "model": "siliconflow/deepseek-ai/DeepSeek-R1-Distill-Qwen-14B", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.1, "outputCost": 0.1 }, { "model": "siliconflow/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.18, "outputCost": 0.18 }, { "model": "siliconflow/deepseek-ai/DeepSeek-V3", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 164000, "maxOutput": 164000, "inputCost": 0.25, "outputCost": 1 }, { "model": "siliconflow/deepseek-ai/DeepSeek-V3.1", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 164000, "maxOutput": 164000, "inputCost": 0.27, "outputCost": 1 }, { "model": "siliconflow/deepseek-ai/DeepSeek-V3.1-Terminus", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 164000, "maxOutput": 164000, "inputCost": 0.27, "outputCost": 1 }, { "model": "siliconflow/deepseek-ai/DeepSeek-V3.2", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 164000, "maxOutput": 164000, "inputCost": 0.27, "outputCost": 0.42 }, { "model": "siliconflow/deepseek-ai/DeepSeek-V3.2-Exp", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 164000, "maxOutput": 164000, "inputCost": 0.27, "outputCost": 0.41 }, { "model": "siliconflow/deepseek-ai/deepseek-vl2", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 4000, "maxOutput": 4000, "inputCost": 0.15, "outputCost": 0.15 }, { "model": "siliconflow/inclusionAI/Ling-flash-2.0", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.14, "outputCost": 0.57 }, { "model": "siliconflow/inclusionAI/Ling-mini-2.0", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.07, "outputCost": 0.28 }, { "model": "siliconflow/inclusionAI/Ring-flash-2.0", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.14, "outputCost": 0.57 }, { "model": "siliconflow/meta-llama/Meta-Llama-3.1-8B-Instruct", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 33000, "maxOutput": 4000, "inputCost": 0.06, "outputCost": 0.06 }, { "model": "siliconflow/MiniMaxAI/MiniMax-M2.1", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 197000, "maxOutput": 131000, "inputCost": 0.3, "outputCost": 1.2 }, { "model": "siliconflow/moonshotai/Kimi-K2-Instruct", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.58, "outputCost": 2.29 }, { "model": "siliconflow/moonshotai/Kimi-K2-Instruct-0905", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.4, "outputCost": 2 }, { "model": "siliconflow/moonshotai/Kimi-K2-Thinking", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.55, "outputCost": 2.5 }, { "model": "siliconflow/moonshotai/Kimi-K2.5", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.55, "outputCost": 3 }, { "model": "siliconflow/nex-agi/DeepSeek-V3.1-Nex-N1", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.5, "outputCost": 2 }, { "model": "siliconflow/openai/gpt-oss-120b", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 131000, "maxOutput": 8000, "inputCost": 0.05, "outputCost": 0.45 }, { "model": "siliconflow/openai/gpt-oss-20b", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 8000, "inputCost": 0.04, "outputCost": 0.18 }, { "model": "siliconflow/Qwen/Qwen2.5-14B-Instruct", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 33000, "maxOutput": 4000, "inputCost": 0.1, "outputCost": 0.1 }, { "model": "siliconflow/Qwen/Qwen2.5-32B-Instruct", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 33000, "maxOutput": 4000, "inputCost": 0.18, "outputCost": 0.18 }, { "model": "siliconflow/Qwen/Qwen2.5-72B-Instruct", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 33000, "maxOutput": 4000, "inputCost": 0.59, "outputCost": 0.59 }, { "model": "siliconflow/Qwen/Qwen2.5-72B-Instruct-128K", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 4000, "inputCost": 0.59, "outputCost": 0.59 }, { "model": "siliconflow/Qwen/Qwen2.5-7B-Instruct", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 33000, "maxOutput": 4000, "inputCost": 0.05, "outputCost": 0.05 }, { "model": "siliconflow/Qwen/Qwen2.5-Coder-32B-Instruct", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 33000, "maxOutput": 4000, "inputCost": 0.18, "outputCost": 0.18 }, { "model": "siliconflow/Qwen/Qwen2.5-VL-32B-Instruct", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.27, "outputCost": 0.27 }, { "model": "siliconflow/Qwen/Qwen2.5-VL-72B-Instruct", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 4000, "inputCost": 0.59, "outputCost": 0.59 }, { "model": "siliconflow/Qwen/Qwen2.5-VL-7B-Instruct", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 33000, "maxOutput": 4000, "inputCost": 0.05, "outputCost": 0.05 }, { "model": "siliconflow/Qwen/Qwen3-14B", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.07, "outputCost": 0.28 }, { "model": "siliconflow/Qwen/Qwen3-235B-A22B", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.35, "outputCost": 1.42 }, { "model": "siliconflow/Qwen/Qwen3-235B-A22B-Instruct-2507", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.09, "outputCost": 0.6 }, { "model": "siliconflow/Qwen/Qwen3-235B-A22B-Thinking-2507", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.13, "outputCost": 0.6 }, { "model": "siliconflow/Qwen/Qwen3-30B-A3B-Instruct-2507", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.09, "outputCost": 0.3 }, { "model": "siliconflow/Qwen/Qwen3-30B-A3B-Thinking-2507", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 131000, "inputCost": 0.09, "outputCost": 0.3 }, { "model": "siliconflow/Qwen/Qwen3-32B", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.14, "outputCost": 0.57 }, { "model": "siliconflow/Qwen/Qwen3-8B", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.06, "outputCost": 0.06 }, { "model": "siliconflow/Qwen/Qwen3-Coder-30B-A3B-Instruct", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.07, "outputCost": 0.28 }, { "model": "siliconflow/Qwen/Qwen3-Coder-480B-A35B-Instruct", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.25, "outputCost": 1 }, { "model": "siliconflow/Qwen/Qwen3-Next-80B-A3B-Instruct", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.14, "outputCost": 1.4 }, { "model": "siliconflow/Qwen/Qwen3-Next-80B-A3B-Thinking", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.14, "outputCost": 0.57 }, { "model": "siliconflow/Qwen/Qwen3-Omni-30B-A3B-Captioner", "imageInput": false, "audioInput": true, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 66000, "maxOutput": 66000, "inputCost": 0.1, "outputCost": 0.4 }, { "model": "siliconflow/Qwen/Qwen3-Omni-30B-A3B-Instruct", "imageInput": true, "audioInput": true, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 66000, "maxOutput": 66000, "inputCost": 0.1, "outputCost": 0.4 }, { "model": "siliconflow/Qwen/Qwen3-Omni-30B-A3B-Thinking", "imageInput": true, "audioInput": true, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 66000, "maxOutput": 66000, "inputCost": 0.1, "outputCost": 0.4 }, { "model": "siliconflow/Qwen/Qwen3-VL-235B-A22B-Instruct", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.3, "outputCost": 1.5 }, { "model": "siliconflow/Qwen/Qwen3-VL-235B-A22B-Thinking", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.45, "outputCost": 3.5 }, { "model": "siliconflow/Qwen/Qwen3-VL-30B-A3B-Instruct", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.29, "outputCost": 1 }, { "model": "siliconflow/Qwen/Qwen3-VL-30B-A3B-Thinking", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.29, "outputCost": 1 }, { "model": "siliconflow/Qwen/Qwen3-VL-32B-Instruct", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.2, "outputCost": 0.6 }, { "model": "siliconflow/Qwen/Qwen3-VL-32B-Thinking", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.2, "outputCost": 1.5 }, { "model": "siliconflow/Qwen/Qwen3-VL-8B-Instruct", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.18, "outputCost": 0.68 }, { "model": "siliconflow/Qwen/Qwen3-VL-8B-Thinking", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.18, "outputCost": 2 }, { "model": "siliconflow/Qwen/QwQ-32B", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.15, "outputCost": 0.58 }, { "model": "siliconflow/stepfun-ai/Step-3.5-Flash", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 262000, "maxOutput": 262000, "inputCost": 0.1, "outputCost": 0.3 }, { "model": "siliconflow/tencent/Hunyuan-A13B-Instruct", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.14, "outputCost": 0.57 }, { "model": "siliconflow/tencent/Hunyuan-MT-7B", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 33000, "maxOutput": 33000, "inputCost": null, "outputCost": null }, { "model": "siliconflow/THUDM/GLM-4-32B-0414", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 33000, "maxOutput": 33000, "inputCost": 0.27, "outputCost": 0.27 }, { "model": "siliconflow/THUDM/GLM-4-9B-0414", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 33000, "maxOutput": 33000, "inputCost": 0.086, "outputCost": 0.086 }, { "model": "siliconflow/THUDM/GLM-Z1-32B-0414", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.14, "outputCost": 0.57 }, { "model": "siliconflow/THUDM/GLM-Z1-9B-0414", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.086, "outputCost": 0.086 }, { "model": "siliconflow/zai-org/GLM-4.5", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.4, "outputCost": 2 }, { "model": "siliconflow/zai-org/GLM-4.5-Air", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.14, "outputCost": 0.86 }, { "model": "siliconflow/zai-org/GLM-4.5V", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 66000, "maxOutput": 66000, "inputCost": 0.14, "outputCost": 0.86 }, { "model": "siliconflow/zai-org/GLM-4.6", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": false, "contextWindow": 205000, "maxOutput": 205000, "inputCost": 0.5, "outputCost": 1.9 }, { "model": "siliconflow/zai-org/GLM-4.6V", "imageInput": true, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 131000, "maxOutput": 131000, "inputCost": 0.3, "outputCost": 0.9 }, { "model": "siliconflow/zai-org/GLM-4.7", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 205000, "maxOutput": 205000, "inputCost": 0.6, "outputCost": 2.2 }, { "model": "siliconflow/zai-org/GLM-5", "imageInput": false, "audioInput": false, "videoInput": false, "toolUsage": true, "reasoning": true, "contextWindow": 205000, "maxOutput": 205000, "inputCost": 1, "outputCost": 3.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-5"
      : "siliconflow/ByteDance-Seed/Seed-OSS-36B-Instruct";
  }
});