Skip to main content
POST
Responses: DeepSeek V4 Flash text generation (with chained explicit cache)
右側のプレイグラウンドを使って直接テストしてください。AuthorizationBearer sk-your-api-key を入れてください。デフォルトのサンプルにはすでに caching: {"type": "enabled"}store: true が含まれており、連鎖した明示キャッシュ向けの初回呼び出しの書き込み形式になっています。
Responses は Chat Completions に明示キャッシュレイヤーを追加します。機能、料金、 推論制御については、 DeepSeek V4 Flash の概要 をご覧ください。
  • text.format json_schema は無効です: スキーマを無視したまま 200 を返します。3/3 件のレスポンスはコードフェンスで囲まれており、パースに失敗しました
  • web_search バックエンドは使用不可です: ツールは接続済みですが(web_search_call の項目が status: completed として表示されます)、6/6 件の検索でエラーが発生し、results は返されませんでした
  • mcpAccessDenied を返します: アカウント/チャネルレベルの組み込みツール権限です。有効なサーバー URL でも同じ結果になります
  • テキストのみのモデル — 画像を渡すと Model do not support image input が返されます

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

明示的キャッシュ: チェーン接続が必要です

よくある間違い: caching を設定して同じ長いプレフィックスを 2 回再送しても、cached_tokens は 0 のままです。明示的キャッシュはプレフィックス一致ではありません — previous_response_id でセッションをチェーン接続する必要があります。
正しいパターン: 最初の呼び出しでは、キャッシュに書き込むためにドキュメント全体を送信し、その後は前回のidをチェーン接続しながら、新しい質問だけを送ります。 各ラウンドで前回までのコンテキスト全体がヒットします。長いドキュメントに対するフォローアップの質問では、毎回全文を再送するよりもはるかに安価です。

チェーン接続された呼び出しの例

暗黙キャッシュ

caching がなくても、暗黙キャッシュは引き続き適用されます。まったく同じ長いプレフィックスを繰り返すと、99.9%(15,633 → 15,616)でヒットします。用途に応じて選択してください — 多数の独立したリクエストで 1 つのプレフィックスを再利用する場合 は暗黙キャッシュが適しており、1 つのセッションで連続する追加質問を行う場合 は、連鎖させた明示的キャッシュが適しています。

出力アイテムの種類

レスポンス output は、次のアイテムを含む場合がある配列です。

承認

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
input
必須

Input content. Either a string or a standard OpenAI Responses message array. Text only — no images

max_output_tokens
integer
デフォルト:500

Max output tokens, hard ceiling 393,216. Reasoning counts toward this

必須範囲: x <= 393216
store
boolean
デフォルト:true

Whether to store this response. Must be true to chain with previous_response_id

previous_response_id
string

The id of the previous response. Combined with caching, this hits the explicit cache in full

caching
object

Explicit cache switch. Pass {"type": "enabled"} on the first call to write, then chain with previous_response_id to hit

reasoning
object

Reasoning control. Measured: effort=minimal always yields 0 reasoning tokens; the other tiers do not form a monotonic ladder

stream
boolean
デフォルト:false

Stream the response over SSE. Measured TTFB around 2.3 seconds

tools
object[]

Tool list. The function type works; web_search is wired but its backend errors, and mcp returns AccessDenied

レスポンス

Generation succeeded

id
string

Response ID, used as the next call's previous_response_id

model
string
output
object[]

Output item array. May contain reasoning / message / function_call / web_search_call items

caching
object

Explicit cache status echo

usage
object

Usage. input_tokens_details.cached_tokens is the cache hit; output_tokens_details.reasoning_tokens is reasoning spend