SiliconFlow via the OpenAI SDK
SiliconFlow provides an OpenAI-compatible API. SiliconFlow integration is rolling out on TheRouter — this page compares SiliconFlow's published catalog and pricing against models already routable through TheRouter today, such as DeepSeek R1 and Qwen3. Streaming, function calling, and reasoning content passthrough are fully supported for routable models.
SiliconFlow integration is rolling out on TheRouter — the comparison below uses SiliconFlow's published catalog and pricing, alongside models already routable today through the same OpenAI client you use.
Two lines to connect via the OpenAI SDK
The samples below use models already routable through TheRouter today. The only change from a stock OpenAI SDK call is base_url and the model name.
from openai import OpenAI
client = OpenAI(
base_url="https://api.therouter.ai/v1", # ← only change
api_key="YOUR_THEROUTER_KEY",
)
response = client.chat.completions.create(
model="deepseek/deepseek-r1",
messages=[{"role": "user", "content": "Explain the difference between REST and GraphQL"}],
stream=True,
)
for chunk in response:
print(chunk.choices[0].delta.content or "", end="", flush=True)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.therouter.ai/v1", // ← only change
apiKey: process.env.THEROUTER_API_KEY,
});
const response = await client.chat.completions.create({
model: "qwen/qwen3-235b",
messages: [{ role: "user", content: "Review this pull request diff…" }],
stream: true,
});
for await (const chunk of response) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}Base URL: https://api.therouter.ai/v1
API Key: <your TheRouter key>
Model: deepseek/deepseek-r1 # reasoning
qwen/qwen3-235b # frontierSiliconFlow integration: rollout in progress
SiliconFlow integration is rolling out on TheRouter — the comparison here uses SiliconFlow's published catalog and pricing. Check GET https://api.therouter.ai/v1/models for the live, up-to-date list of models routable through TheRouter today.
Why route through TheRouter?
Automatic failover
A provider goes down → TheRouter instantly reroutes to a healthy equivalent. Your code sees 200 OK.
One API key
Anthropic, OpenAI, Google, DeepSeek, Qwen, xAI — all accessed with a single key. No credential rotation across providers.
Spend controls
Set per-team and per-key spending limits. TheRouter tracks every token, every cost, in real time.
No data stored
TheRouter passes requests through without storing prompt or response content.
SiliconFlow OpenAI compatible API — FAQ
Is SiliconFlow's API OpenAI-compatible?
Yes. SiliconFlow implements the OpenAI Chat Completions API format, so a direct SiliconFlow integration only needs a base_url change. SiliconFlow integration is rolling out on TheRouter — the comparison below uses SiliconFlow's published catalog and pricing.
Which models are routable through TheRouter today?
TheRouter's OpenAI-compatible endpoint already routes models such as deepseek/deepseek-r1 and qwen/qwen3-235b directly. See /models for the live, up-to-date catalog rather than any fixed count on this page.
Can I use the official OpenAI Python or Node SDK with TheRouter?
Yes. Pass base_url='https://api.therouter.ai/v1' and your TheRouter API key when constructing the OpenAI client. Model names follow the provider/model format, e.g. deepseek/deepseek-r1 or qwen/qwen3-235b.
Does TheRouter support streaming and function calling?
Yes. TheRouter routes requests with stream=true and tools arrays transparently, and preserves provider-specific fields such as reasoning_content end-to-end.
Why route through TheRouter instead of calling a provider directly?
TheRouter adds automatic failover across providers, a single API key for every routable model, spend controls, and team access management — without any code change.
Get started — free, no card needed
Get your TheRouter API key and run your first OpenAI-compatible request in under 2 minutes.
Get free API key →