TokenHub の統一 /chat/completions エンドポイント経由で、DeepSeek の2026年旗艦 V4 シリーズ(V4-Pro と V4-Flash)を呼び出せます。完全な OpenAI-compatible で、公式 openai SDK がそのまま動作します。streaming、ツール使用、reasoning_content を使った思考モードもすべてサポートしています。1M のコンテキストウィンドウ、384K の max output、課金は DeepSeek カタログ価格に基づくトークン単位です。
th-xxxxxxxxxxxx...)https://tokenhub.store/api/v1Authorization ヘッダーに API Key を指定します:
Authorization: Bearer th-your-api-keyPOST/chat/completionsChat completion。OpenAI /v1/chat/completions と同じスキーマで、streaming、tools、JSON mode、DeepSeek 固有の thinking フィールドに対応しています。
料金は 100万 tokens あたりの USD です。DeepSeek のカタログ定価に基づきます(プロモーション割引なし)。正規 ID と deepseek/* エイリアスの両方が利用できます。課金は upstream が返す completion_tokens に基づきます(reasoning_tokens もすでに含まれています)。
| ティア | Model ID | 入力 | 出力 | 備考 |
|---|---|---|---|---|
| V4-Pro | deepseek-v4-pro | $1.80 | $3.60 | 2026年の最上位フラッグシップ。推論とコーディング品質が最も優れています。 |
| V4-Flash | deepseek-v4-flash | $0.15 | $0.30 | 非常にコスト効率の高いフラッグシップで、Pro より約12倍安価です。本番環境のデフォルトに最適です。 |
| パラメータ | 型 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|
| model | string | 必須 | — | DeepSeek V4 の model ID。例: "deepseek/deepseek-v4-flash"。 |
| messages | array | 必須 | — | Chat history。各項目は { role, content } です。role ∈ system | user | assistant | tool。 |
| max_tokens | integer | 任意 | upstream default | 最大出力 tokens。省略した場合、DeepSeek は upstream のデフォルトを使用します(最大 384K)。thinking モードではカウンタに reasoning tokens も含まれるため、小さく設定しすぎないでください。 |
| temperature | number | 任意 | 1.0 | Sampling temperature、0.0〜2.0。低いほど決定的になります。DeepSeek は code には 0.0、創作文章には 1.3 を推奨しています。 |
| top_p | number | 任意 | 1.0 | ヌクレウスサンプリング。temperature または top_p のどちらか一方のみを使用してください。 |
| stream | boolean | 任意 | false | true の場合、Server-Sent Events (SSE) の差分を返します。 |
| thinking | object | 任意 | {type:'enabled'} | DeepSeek 固有です。extra_body 経由で { type: 'disabled' } を渡すと、推論フェーズを省略してより高速・低コストな応答にできます。デフォルト: enabled。 |
| reasoning_effort | string | 任意 | medium | 思考の深さ: low | medium | high。高いほど reasoning tokens が増え、品質は向上しますがコストも上がります。 |
| tools | array | 任意 | — | tool use (function calling) 用の tool/function 定義の一覧です。 |
| tool_choice | string|object | 任意 | auto | tool の選択を制御します: auto | none | required | { type:'function', function:{ name } }。 |
| response_format | object | 任意 | — | JSON mode: { "type": "json_object" } により、model は有効な JSON を返すようになります。 |
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 は最終回答を書く前に専用の reasoning フェーズを開きます。知っておくべき点は次のとおりです:
TokenHub に登録して、OpenAI-compatible API 経由で DeepSeek V4 の呼び出しを始めましょう