SiliconFlow API: The Complete Guide for AI Engineers (2026)
Everything you need to start building with SiliconFlow — signup, API key, first call in 3 minutes. We cover 200+ models, free tiers, rate limits, common errors, and production tips.
SiliconFlow gives you one OpenAI-compatible endpoint with access to 200+ models — DeepSeek, Qwen, GLM, Kimi, MiniMax, and more. You sign up, grab an API key, point your existing OpenAI SDK at https://api.siliconflow.cn/v1, and your code works. Three models are completely free, no credit card required.
We wrote this guide because, despite SiliconFlow's breadth, the official docs are spread across many pages. This is the single reference we wanted when we first integrated SiliconFlow into our routing layer.
Getting Started in 3 Minutes
Step 1: Create an account. Go to cloud.siliconflow.cn and sign up. SiliconFlow supports SMS, email, GitHub, and Google OAuth login.
Step 2: Get your API key. Navigate to API Keys and click "Create API Key." Copy it — you'll need it in a moment.
Step 3: Make your first call. Install the OpenAI Python SDK if you haven't already:
pip install --upgrade openai
Then run:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_SILICONFLOW_KEY",
base_url="https://api.siliconflow.cn/v1",
)
response = client.chat.completions.create(
model="Qwen/Qwen3-8B", # free model
messages=[{"role": "user", "content": "What is SiliconFlow?"}],
)
print(response.choices[0].message.content)
That's it. You just called a free model. No credit card, no billing setup.
Global endpoint note: SiliconFlow also offers
https://api.siliconflow.com/v1for global access. The.cnendpoint is optimized for China-based traffic.
Available Models: What You Can Run
SiliconFlow hosts models from multiple vendors on a single endpoint. Here are the key model families as of June 2026:
| Vendor | Notable models | Context | Pricing (per 1M tokens) | Notes |
|---|---|---|---|---|
| DeepSeek | DeepSeek-V4-Pro, DeepSeek-V4-Flash, DeepSeek-V3.2, DeepSeek-R1 | Up to 1049K | $0.14–$1.74 input, $0.28–$3.48 output | V4-Flash is the budget pick; R1 for reasoning |
| Qwen | Qwen3-Coder-Plus, Qwen3.6-27B, Qwen3.5-122B-A10B, Qwen3-8B (free) | Up to 262K | $0–$0.30 input, $0–$3.20 output | Qwen3-8B is free; Coder-Plus for code tasks |
| Zhipu | GLM-5.1, GLM-5, GLM-4.7 | Up to 205K | $0.42–$1.40 input, $2.20–$4.40 output | GLM-5.1 is the flagship reasoning model |
| Moonshot | Kimi-K2-Instruct, Kimi-K2.5, Kimi-K2.6 | Up to 262K | $0.40–$0.90 input, $2.00–$4.00 output | K2.6 is the latest thinking agent model |
| MiniMax | MiniMax-M2.5 | 197K | $0.30 input, $1.20 output | Compact but capable multimodal model |
| OpenAI (open-weight) | gpt-oss-120b, gpt-oss-20b | 131K | $0.04–$0.05 input, $0.18–$0.45 output | OpenAI's open-weight models hosted on SiliconFlow |
Prices from siliconflow.com/pricing, retrieved 2026-06-05. Prices are in USD per 1M tokens.
Free Models — Zero Cost, No Credit Card
SiliconFlow offers several models at zero cost after identity verification:
- Qwen3-8B — general-purpose chat, fast, 262K context
- DeepSeek-R1-Distill-Qwen-7B — reasoning distill, good for chain-of-thought
- DeepSeek-OCR — document extraction, converts images to structured text
Free models have fixed rate limits (see the rate limits section below). For higher throughput, SiliconFlow also offers "Pro/" prefixed paid versions of some free models — for example, Pro/Qwen/Qwen2.5-7B-Instruct gives you higher rate limits than the free Qwen/Qwen2.5-7B-Instruct.
OpenAI SDK Setup: base_url, Model Mapping, Streaming
Basic Setup (Python)
from openai import OpenAI
client = OpenAI(
api_key="YOUR_SILICONFLOW_KEY",
base_url="https://api.siliconflow.cn/v1",
)
Model ID Format
SiliconFlow model IDs follow a Vendor/ModelName pattern:
| What you want | Model ID on SiliconFlow |
|---|---|
| DeepSeek V4 Pro | deepseek-ai/DeepSeek-V4-Pro |
| DeepSeek V4 Flash | deepseek-ai/DeepSeek-V4-Flash |
| DeepSeek R1 | Pro/deepseek-ai/DeepSeek-R1 |
| Qwen3 8B (free) | Qwen/Qwen3-8B |
| Qwen3 Coder Plus | Qwen/Qwen3-Coder-Plus (SiliconFlow id) |
| GLM-5 | THUDM/GLM-5 |
Streaming
Streaming works identically to the OpenAI API:
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V4-Flash",
messages=[{"role": "user", "content": "Explain DNS in one paragraph."}],
stream=True,
)
for chunk in response:
if not chunk.choices:
continue
delta = chunk.choices[0].delta
if delta.content:
print(delta.content, end="", flush=True)
# DeepSeek R1 reasoning content
if hasattr(delta, "reasoning_content") and delta.reasoning_content:
print(delta.reasoning_content, end="", flush=True)
Note the reasoning_content field — DeepSeek R1 returns its chain-of-thought reasoning separately from the final answer. SiliconFlow preserves this field end-to-end.
Function Calling (Tool Use)
SiliconFlow supports OpenAI-compatible function calling on select models. You pass tools exactly as you would with OpenAI:
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V3.2",
messages=[{"role": "user", "content": "What's the weather in Beijing?"}],
tools=[
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get weather for a city",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string", "description": "City name"}
},
"required": ["city"],
},
},
}
],
)
Models with function calling support include DeepSeek R1, DeepSeek V3/V3.2, Qwen 2.5 series (7B–72B), and GLM-4 series. Check SiliconFlow's function calling docs for the latest list.
Rate Limits: What to Expect
SiliconFlow measures rate limits across several dimensions:
- RPM — requests per minute
- TPM — tokens per minute
- RPD / TPD — daily equivalents
- IPM / IPD — images per minute / day (for image generation)
By Model Category
| Category | RPM range | TPM range |
|---|---|---|
| Chat (LLM) | 1,000–10,000 | 50,000–5,000,000 |
| Embedding | 2,000–10,000 | 500,000–10,000,000 |
| Reranker | 2,000 | 500,000 |
| Image generation | 2–10 IPM | 400+ IPD |
Usage Levels
Rate limits scale with your monthly spending. SiliconFlow uses a tiered system:
| Level | Monthly spend (RMB) | Effect |
|---|---|---|
| L0 | < ¥50 | Default (new accounts) |
| L1 | ¥50–¥199 | Moderate rate limit increase |
| L2 | ¥200–¥1,999 | Higher limits |
| L3 | ¥2,000–¥4,999 | Production-grade |
| L4 | ¥5,000–¥9,999 | High-throughput |
| L5 | ≥ ¥10,000 | Maximum limits |
Your level is determined by the higher of your current month's and previous month's consumption. Upgrades are instant.
Key detail: Rate limits are per-account, not per-API-key. Creating multiple keys doesn't give you extra capacity. Each model has independent limits — hitting the ceiling on DeepSeek V4 doesn't affect your Qwen calls.
Source: SiliconFlow rate limits docs, retrieved 2026-06-05.
Common Errors and Fixes
429 Too Many Requests
HTTP/1.1 429 Too Many Requests
Request was rejected due to rate limiting.
Fix: Implement exponential backoff. SiliconFlow publishes a rate-limit cookbook with retry logic examples. Alternatively, increase your usage level by spending more, or contact SiliconFlow for a custom rate package.
401 Unauthorized
Your API key is invalid or missing. Double-check:
- The key starts with
sk-and was copied from cloud.siliconflow.cn/account/ak - You're passing it as
api_key, not in a header manually - You haven't accidentally used a DashScope or DeepSeek key
400 Model Not Found
The model ID doesn't match SiliconFlow's naming. Common mistakes:
- Using
deepseek-v4-proinstead ofdeepseek-ai/DeepSeek-V4-Pro(case and vendor prefix matter) - Using a model that was recently deprecated — check SiliconFlow release notes for retirement notices
Streaming Returns Empty Chunks
Some models return empty choices arrays in the first chunk. This is normal — just skip them:
for chunk in response:
if not chunk.choices:
continue
Production Checklist
Before going live with SiliconFlow in production, walk through this checklist:
1. Retry Logic with Exponential Backoff
Don't let a transient 429 crash your app. Wrap calls in retry logic:
import time
from openai import OpenAI, RateLimitError
client = OpenAI(
api_key="YOUR_KEY",
base_url="https://api.siliconflow.cn/v1",
)
def call_with_retry(messages, model, max_retries=3):
for attempt in range(max_retries):
try:
return client.chat.completions.create(
model=model,
messages=messages,
)
except RateLimitError:
wait = 2 ** attempt
time.sleep(wait)
raise Exception("Max retries exceeded")
2. Set Spending Limits
SiliconFlow lets you configure monthly spending caps in your account dashboard. Set one. Runaway loops happen to everyone.
3. Monitor Model Deprecations
SiliconFlow periodically retires older model versions. Subscribe to their release notes or check monthly. Recent example: Qwen/Qwen3-235B-A22B-Instruct-2507 was deprecated on 2026-05-15.
4. Use the Right Endpoint
- China traffic:
https://api.siliconflow.cn/v1— lower latency from mainland China - Global traffic:
https://api.siliconflow.com/v1— better for non-China regions
5. Consider a Routing Layer for Failover
If SiliconFlow goes down, your app goes down — unless you have a fallback. We route SiliconFlow requests through TheRouter, which automatically fails over to other providers (DashScope, DeepSeek direct) when SiliconFlow is unavailable. The setup is a one-line base_url change.
Image, Video, and Audio Models
SiliconFlow isn't just for chat. The platform hosts multimodal models too:
| Category | Example models | Pricing |
|---|---|---|
| Image generation | FLUX.2 [pro], FLUX.1 Kontext, Z-Image-Turbo | $0.005–$0.08/image |
| Video generation | Wan2.2-T2V-A14B, Wan2.2-I2V-A14B | $0.29/video |
| Text-to-Speech | Fish-Speech-1.5, CosyVoice2, IndexTTS-2 | $7.15–$15/M UTF-8 bytes |
These use the same API key and authentication. Image generation endpoints follow the /v1/images/generations pattern; audio follows /v1/audio/speech.
Prices from siliconflow.com/pricing, retrieved 2026-06-05.
Frequently Asked Questions
Is SiliconFlow OpenAI-compatible?
Yes. SiliconFlow exposes /v1/chat/completions, /v1/embeddings, /v1/images/generations, and other standard OpenAI endpoints. The Python and TypeScript OpenAI SDKs work with zero code changes — just set base_url. See SiliconFlow via OpenAI SDK for integration details.
How does SiliconFlow pricing compare to calling DeepSeek or Qwen directly?
It depends on the model. For DeepSeek V4 Pro, SiliconFlow charges $1.74/$3.48 per million tokens (input/output), which is competitive with DeepSeek's direct API. For Qwen models, SiliconFlow may be slightly cheaper than DashScope on some tiers because SiliconFlow bundles its own optimized inference. Always check current prices — they change frequently.
Can I fine-tune models on SiliconFlow?
Yes. SiliconFlow offers fine-tuning as a managed service. You upload training data, pick a base model, and SiliconFlow handles GPU scheduling. Pricing varies by model size and training duration. See SiliconFlow Products for details.
What happens if a model is deprecated?
SiliconFlow announces deprecations in their release notes with advance notice. Deprecated model IDs return 400 errors after the sunset date. Solution: update your model ID to the recommended replacement.
Does SiliconFlow store my data?
According to SiliconFlow's privacy policy, API request data is not stored after processing. For regulated use cases, review their terms of service and privacy policy.
Sources: SiliconFlow Quickstart (retrieved 2026-06-05), SiliconFlow Rate Limits (retrieved 2026-06-05), SiliconFlow Pricing (retrieved 2026-06-05), SiliconFlow Function Calling (retrieved 2026-06-05), SiliconFlow Release Notes (retrieved 2026-06-05).