DeepSeek’ning 2026 yilgi flagman V4 seriyasiga (V4-Pro va V4-Flash) TokenHub’ning yagona /chat/completions endpoint’i orqali murojaat qiling. To‘liq OpenAI-Compatible — rasmiy openai SDK darhol ishlaydi. Streaming, tool use va reasoning_content bilan thinking mode ham qo‘llab-quvvatlanadi. 1M context window, 384K max output, token bo‘yicha billing DeepSeek katalog narxiga asosan.
th-xxxxxxxxxxxx...)https://tokenhub.store/api/v1Authorization header’ida API Key ni yuboring:
Authorization: Bearer th-your-api-keyPOST/chat/completionsChat completion. OpenAI /v1/chat/completions bilan bir xil schema, streaming, tools, JSON mode va DeepSeek’ga xos thinking maydonlari bilan.
Narx 1 million token uchun (USD) hisoblanadi, DeepSeek katalog ro‘yxat narxiga asoslangan (hech qanday promo chegirma qo‘llanmaydi). Ham kanonik ID, ham deepseek/* alias qabul qilinadi. Billing upstream qaytargan completion_tokens bo‘yicha amalga oshiriladi (u allaqachon reasoning_tokens ni o‘z ichiga oladi).
| Daraja | Model ID | Kirish | Chiqish | Izohlar |
|---|---|---|---|---|
| V4-Pro | deepseek-v4-pro | $1.80 | $3.60 | 2026 yilgi eng yuqori darajadagi flagman. Eng yaxshi reasoning va coding sifati. |
| V4-Flash | deepseek-v4-flash | $0.15 | $0.30 | Juda tejamkor flagman, Pro’dan taxminan 12× arzon; production uchun ajoyib standart tanlov. |
| Parametr | Turi | Majburiy | Standart | Tavsif |
|---|---|---|---|---|
| model | string | Majburiy | — | DeepSeek V4 model ID. Masalan: "deepseek/deepseek-v4-flash". |
| messages | array | Majburiy | — | Chat tarixi. Har bir element { role, content } ko‘rinishida. role ∈ system | user | assistant | tool. |
| max_tokens | integer | Ixtiyoriy | upstream default | Maksimal chiqish tokenlari. Agar ko‘rsatilmasa, DeepSeek upstream standart qiymatini ishlatadi (384K gacha). thinking mode’da hisoblagich reasoning tokenlarni HAM o‘z ichiga oladi — uni juda kichik qo‘ymang. |
| temperature | number | Ixtiyoriy | 1.0 | Sampling temperature, 0.0–2.0. Pastroq = yanada deterministik. DeepSeek kod uchun 0.0, kreativ yozuv uchun 1.3 ni tavsiya qiladi. |
| top_p | number | Ixtiyoriy | 1.0 | Nucleus sampling. temperature YOKI top_p dan foydalaning, ikkalasini birga emas. |
| stream | boolean | Ixtiyoriy | false | Agar true bo‘lsa, Server-Sent Events (SSE) delta-larini qaytaradi. |
| thinking | object | Ixtiyoriy | {type:'enabled'} | DeepSeek-ga xos. Tezroq/arzonroq javoblar uchun reasoning bosqichini o‘tkazib yuborish maqsadida extra_body orqali { type: 'disabled' } yuboring. Standart: enabled. |
| reasoning_effort | string | Ixtiyoriy | medium | Thinking chuqurligi: low | medium | high. Yuqoriroq = ko‘proq reasoning tokens, yaxshiroq sifat, yuqoriroq narx. |
| tools | array | Ixtiyoriy | — | Tool use (function calling) uchun tool/function ta’riflari ro‘yxati. |
| tool_choice | string|object | Ixtiyoriy | auto | Tool tanlashni boshqaring: auto | none | required | { type:'function', function:{ name } }. |
| response_format | object | Ixtiyoriy | — | JSON mode: { "type": "json_object" } modelni to‘g‘ri JSON qaytarishga majbur qiladi. |
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 yakuniy javobni yozishdan oldin alohida reasoning bosqichini ochadi. Bilishingiz kerak bo‘lganlar:
TokenHub’ga ro‘yxatdan o‘ting va OpenAI-compatible API orqali DeepSeek V4’dan foydalanishni boshlang