Skip to main content
POST
Chat completion: DeepSeek V4 Flash text generation
右側のプレイグラウンドを使って直接テストできます: AuthorizationBearer sk-your-api-key を入れてください。デフォルトの例ではすでに深い推論(thinking.disabled)が無効になっているため、送信するとすぐに応答が返ります。
このモデルはデフォルトでかなり推論します — 1行の質問でも、最初に数百の reasoning tokens を出力します。デバッグ中は例の "thinking": {"type": "disabled"} をそのまま使ってください。 機能、料金、キャッシュについては、DeepSeek V4 Flash の概要 をご覧ください。
  • 推論がオンの場合は、max_tokens に余裕を持たせてください(推論は出力クォータにカウントされます) — 3000以上を推奨します
  • response_format は効果がありません: json_schema を渡しても、スキーマを完全に無視したまま 200 が返ります。構造化出力には tools を使用してください
  • n は黙って無視されます: n=2 を渡すと、choices にちょうど1要素を含む 200 が返ります
  • テキスト専用モデル — 画像コンテンツブロックを渡すと Model do not support image input が返ります

パラメータ クイックリファレンス

コンテキストと出力の上限

322,055-token の入力は、文書中ほどの needle が正しく取得された状態で 14.77 秒で返されました。

暗黙キャッシュ

パラメータは不要です。まったく同じ長いプレフィックスは、2回目のリクエストでヒットします。 キャッシュされた tokens の課金は、100万あたり $0.028 です。タイムスタンプ、ランダムな ID、その他の可変コンテンツは prompt の末尾に置いてください。これらをプレフィックスに混ぜると、ヒット率はゼロになります。

構造化された出力が必要ですか? tools を使いましょう

choices[0].message.tool_calls[0].function.arguments から JSON 文字列を取得してください — 安定してパースできます。

承認

Authorization
string
header
必須

API Key obtained from the APIYI console

ボディ

application/json
model
enum<string>
デフォルト:deepseek-v4-flash-ga-260731
必須

Model ID, fixed to deepseek-v4-flash-ga-260731

利用可能なオプション:
deepseek-v4-flash-ga-260731
messages
object[]
必須

Message array in standard OpenAI format. Text only — image content blocks are not supported

max_tokens
integer
デフォルト:500

Max output tokens, hard ceiling 393,216. Reasoning counts toward this when thinking is on

必須範囲: x <= 393216
thinking
object

Deep thinking switch. Passing {"type": "disabled"} saved 200+ reasoning tokens on simple tasks in our tests

reasoning_effort
enum<string>

Reasoning depth tier. Only minimal is deterministic (reasoning tokens always 0); low/medium/high/max do not form a monotonic ladder, and within-tier variance exceeds between-tier differences

利用可能なオプション:
minimal,
low,
medium,
high,
max
stream
boolean
デフォルト:false

Stream the response over SSE. Pair with stream_options.include_usage to get usage at the end

temperature
number

Sampling temperature

top_p
number

Nucleus sampling threshold

stop
string[]

Stop sequences, verified to truncate correctly

seed
integer

Random seed

logprobs
boolean

Return token log probabilities, verified to be populated

tools
object[]

Function Call tool list in standard OpenAI format. Tool arguments are genuinely constrained — use this instead of response_format when you need structured output

レスポンス

Completion succeeded

id
string

Request ID

model
string
choices
object[]

Completion results. Besides content, message carries reasoning_content when thinking is on

usage
object

Usage. completion_tokens_details.reasoning_tokens is reasoning spend; prompt_tokens_details.cached_tokens is the implicit cache hit