DeepSeek on RouterHub
DeepSeek V4.1 Flash API pricing and setup
Build apps with DeepSeek using the OpenAI-compatible Chat Completions API, one RouterHub API key, and prepaid credits. Compare published input, output, and cached input rates before choosing your model.
DeepSeek models and prices
| Model | Exact API ID | Input | Output | Cached input |
|---|---|---|---|---|
| DeepSeek V4.1 Flash | deepseek-v4.1-flash | $0.13453 | $0.53812 | $0.0026906 |
Input is the prompt you send; output is the response you receive. Cached input rates apply when the provider reports a cache hit. Prices come from RouterHub's current public catalogue; these are RouterHub rates. No separate subscription is required.
Get an API key
- Create a RouterHub account.
- Add prepaid credits with card or crypto.
- Create an API key and keep it in your local environment.
- Send a short Chat Completions request, then check Usage for its cost.
Send your first DeepSeek API request
Use the exact model ID deepseek-v4.1-flash with https://routerhub.si/v1/chat/completions. Set ROUTERHUB_API_KEY in your local environment. This request uses prepaid credits.
cURL
curl https://routerhub.si/v1/chat/completions \
-H "Authorization: Bearer $ROUTERHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4.1-flash","messages":[{"role":"user","content":"Reply with OK."}]}'Python
Install the OpenAI Python SDK with pip install openai.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["ROUTERHUB_API_KEY"],
base_url="https://routerhub.si/v1",
)
response = client.chat.completions.create(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Reply with OK."}],
)
print(response.choices[0].message.content)Node.js
Install the OpenAI JavaScript SDK with npm install openai.
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.ROUTERHUB_API_KEY,
baseURL: "https://routerhub.si/v1",
});
const response = await client.chat.completions.create({
model: "deepseek-v4.1-flash",
messages: [{ role: "user", content: "Reply with OK." }],
});
console.log(response.choices[0].message.content);Compare models or connect a tool
Compare all GPT, Claude, DeepSeek, and GLM prices · OpenCode setup · All setup guides
Current model IDs, protocols, and prices · API quickstart · OpenAPI reference · This setup guide