Panggil seri unggulan V4 DeepSeek 2026 (V4-Pro dan V4-Flash) melalui endpoint terpadu TokenHub /chat/completions. Sepenuhnya OpenAI-compatible — SDK openai resmi berfungsi langsung tanpa konfigurasi tambahan. Streaming, penggunaan tool, dan mode thinking dengan reasoning_content semuanya didukung. Jendela konteks 1M, output maksimum 384K, penagihan per Token berdasarkan harga katalog DeepSeek.
th-xxxxxxxxxxxx...)https://tokenhub.store/api/v1Kirim API Key di header Authorization:
Authorization: Bearer th-your-api-keyPOST/chat/completionsChat completion. Skema sama seperti OpenAI /v1/chat/completions, dengan streaming, tools, mode JSON, dan field thinking khusus DeepSeek.
Harga per 1 juta Token (USD), berdasarkan harga daftar katalog DeepSeek (tanpa diskon promosi). Baik ID kanonik maupun alias deepseek/* diterima. Penagihan menggunakan completion_tokens yang dikembalikan oleh upstream (yang sudah mencakup reasoning_tokens).
| Tingkat | ID Model | Input | Output | Catatan |
|---|---|---|---|---|
| V4-Pro | deepseek-v4-pro | $1.80 | $3.60 | Model unggulan tingkat teratas 2026. Terbaik untuk kualitas reasoning & coding. |
| V4-Flash | deepseek-v4-flash | $0.15 | $0.30 | Model unggulan yang sangat hemat biaya, sekitar 12× lebih murah daripada Pro; pilihan default yang sangat baik untuk produksi. |
| Parameter | Tipe | Wajib | Default | Deskripsi |
|---|---|---|---|---|
| model | string | Wajib | — | ID model DeepSeek V4. Contoh: "deepseek/deepseek-v4-flash". |
| messages | array | Wajib | — | Riwayat chat. Setiap item adalah { role, content }. role ∈ system | user | assistant | tool. |
| max_tokens | integer | Opsional | upstream default | Token output maksimum. Jika dihilangkan, DeepSeek menggunakan default upstream-nya (hingga 384K). Dalam mode thinking, penghitung MENCAKUP reasoning tokens — jangan disetel terlalu kecil. |
| temperature | number | Opsional | 1.0 | Sampling temperature, 0.0–2.0. Semakin rendah = semakin deterministik. DeepSeek merekomendasikan 0.0 untuk kode, 1.3 untuk penulisan kreatif. |
| top_p | number | Opsional | 1.0 | Nucleus sampling. Gunakan temperature ATAU top_p, jangan keduanya. |
| stream | boolean | Opsional | false | Jika true, mengembalikan delta Server-Sent Events (SSE). |
| thinking | object | Opsional | {type:'enabled'} | Khusus DeepSeek. Lewatkan { type: 'disabled' } melalui extra_body untuk melewati fase penalaran agar respons lebih cepat/lebih murah. Default: enabled. |
| reasoning_effort | string | Opsional | medium | Kedalaman thinking: low | medium | high. Semakin tinggi = lebih banyak reasoning tokens, kualitas lebih baik, biaya lebih tinggi. |
| tools | array | Opsional | — | Daftar definisi tool/function untuk penggunaan tool (function calling). |
| tool_choice | string|object | Opsional | auto | Kontrol pemilihan tool: auto | none | required | { type:'function', function:{ name } }. |
| response_format | object | Opsional | — | Mode JSON: { "type": "json_object" } memaksa model untuk mengembalikan JSON yang valid. |
curl https://tokenhub.store/api/v1/chat/completions \
-H "Authorization: Bearer th-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek/deepseek-v4-flash",
"messages": [
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Explain CAP theorem in 3 bullets."}
],
"temperature": 0.3
}'from openai import OpenAI
client = OpenAI(
api_key="th-your-api-key",
base_url="https://tokenhub.store/api/v1",
)
resp = client.chat.completions.create(
model="deepseek/deepseek-v4-flash",
temperature=0.3,
messages=[
{"role": "system", "content": "You are a concise assistant."},
{"role": "user", "content": "Explain CAP theorem in 3 bullets."},
],
)
msg = resp.choices[0].message
# DeepSeek V4 returns the chain-of-thought in a separate field
print("Thinking:", getattr(msg, "reasoning_content", None))
print("Answer: ", msg.content)
print("Usage: ", resp.usage)import OpenAI from "openai";
const client = new OpenAI({
apiKey: "th-your-api-key",
baseURL: "https://tokenhub.store/api/v1",
});
const resp = await client.chat.completions.create({
model: "deepseek/deepseek-v4-flash",
temperature: 0.3,
messages: [
{ role: "system", content: "You are a concise assistant." },
{ role: "user", content: "Explain CAP theorem in 3 bullets." },
],
});
const msg: any = resp.choices[0].message;
console.log("Thinking:", msg.reasoning_content);
console.log("Answer: ", msg.content);
console.log("Usage: ", resp.usage);DeepSeek V4 membuka fase penalaran khusus sebelum menulis jawaban final. Berikut yang perlu Anda ketahui:
Daftar ke TokenHub dan mulai memanggil DeepSeek V4 melalui API OpenAI-compatible kami