curl --request POST \
--url https://api.apiyi.com/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-v4-flash-ga-260731",
"input": "Explain the MoE architecture in one sentence."
}
'import requests
url = "https://api.apiyi.com/v1/responses"
payload = {
"model": "deepseek-v4-flash-ga-260731",
"input": "Explain the MoE architecture in one sentence."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'deepseek-v4-flash-ga-260731',
input: 'Explain the MoE architecture in one sentence.'
})
};
fetch('https://api.apiyi.com/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apiyi.com/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'deepseek-v4-flash-ga-260731',
'input' => 'Explain the MoE architecture in one sentence.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apiyi.com/v1/responses"
payload := strings.NewReader("{\n \"model\": \"deepseek-v4-flash-ga-260731\",\n \"input\": \"Explain the MoE architecture in one sentence.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.apiyi.com/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"deepseek-v4-flash-ga-260731\",\n \"input\": \"Explain the MoE architecture in one sentence.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"deepseek-v4-flash-ga-260731\",\n \"input\": \"Explain the MoE architecture in one sentence.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"output": [
{}
],
"caching": {},
"usage": {}
}DeepSeek V4 Flash Responses API リファレンス
DeepSeek V4 Flash GA (deepseek-v4-flash-ga-260731) Responses API リファレンスおよびプレイグラウンド: 各ラウンドで直前のコンテキスト全体にヒットする連鎖型の明示的キャッシュ。
curl --request POST \
--url https://api.apiyi.com/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-v4-flash-ga-260731",
"input": "Explain the MoE architecture in one sentence."
}
'import requests
url = "https://api.apiyi.com/v1/responses"
payload = {
"model": "deepseek-v4-flash-ga-260731",
"input": "Explain the MoE architecture in one sentence."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'deepseek-v4-flash-ga-260731',
input: 'Explain the MoE architecture in one sentence.'
})
};
fetch('https://api.apiyi.com/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apiyi.com/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'deepseek-v4-flash-ga-260731',
'input' => 'Explain the MoE architecture in one sentence.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apiyi.com/v1/responses"
payload := strings.NewReader("{\n \"model\": \"deepseek-v4-flash-ga-260731\",\n \"input\": \"Explain the MoE architecture in one sentence.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.apiyi.com/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"deepseek-v4-flash-ga-260731\",\n \"input\": \"Explain the MoE architecture in one sentence.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"deepseek-v4-flash-ga-260731\",\n \"input\": \"Explain the MoE architecture in one sentence.\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"output": [
{}
],
"caching": {},
"usage": {}
}Bearer sk-your-api-key を入れてください。デフォルトのサンプルにはすでに caching: {"type": "enabled"} と
store: true が含まれており、連鎖した明示キャッシュ向けの初回呼び出しの書き込み形式になっています。text.formatjson_schema は無効です: スキーマを無視したまま 200 を返します。3/3 件のレスポンスはコードフェンスで囲まれており、パースに失敗しましたweb_searchバックエンドは使用不可です: ツールは接続済みですが(web_search_callの項目がstatus: completedとして表示されます)、6/6 件の検索でエラーが発生し、resultsは返されませんでしたmcpはAccessDeniedを返します: アカウント/チャネルレベルの組み込みツール権限です。有効なサーバー URL でも同じ結果になります- テキストのみのモデル — 画像を渡すと
Model do not support image inputが返されます
パラメータのクイックリファレンス
| パラメータ | 型 | 必須 | デフォルト | 注記 |
|---|---|---|---|---|
model | string | ✓ | — | deepseek-v4-flash-ga-260731 に固定 |
input | string / array | ✓ | — | 文字列または標準の Responses メッセージ配列、テキストのみ |
max_output_tokens | int | — | 上限は 393,216 です。推論はこれに加算されます | |
store | bool | true | 連結するには true である必要があります | |
previous_response_id | string | — | 直前の応答の id。caching と組み合わせると明示的キャッシュにヒットします | |
caching.type | string | — | enabled が明示的キャッシュを書き込みます。応答はこのフィールドをエコーします | |
reasoning.effort | string | — | minimal は推論 token を 0 にします。他のティアは単調ではありません | |
stream | bool | false | SSE ストリーミング。計測された TTFB は約 2.31 秒です | |
tools | array | — | function は動作します。web_search / mcp については上記の警告を参照してください |
明示的キャッシュ: チェーン接続が必要です
caching を設定して同じ長いプレフィックスを 2 回再送しても、cached_tokens は 0 のままです。明示的キャッシュはプレフィックス一致ではありません — previous_response_id でセッションをチェーン接続する必要があります。idをチェーン接続しながら、新しい質問だけを送ります。
| ラウンド | 呼び出し形式 | input_tokens | cached_tokens | レイテンシ |
|---|---|---|---|---|
| 1 (書き込み) | caching: enabled + store: true | 15,629 | 0 | 4.10s |
| 2 | + previous_response_id | 15,664 | 15,629 | 5.18s |
| 3 | + previous_response_id | 15,701 | 15,664 | 4.57s |
| 4 | + previous_response_id | 15,738 | 15,701 | 4.54s |
チェーン接続された呼び出しの例
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["APIYI_API_KEY"],
base_url="https://api.apiyi.com/v1",
)
long_doc = open("report.md").read()
# Round 1: write the cache
first = client.responses.create(
model="deepseek-v4-flash-ga-260731",
input=long_doc + "\n\nSummarize the core conclusions of this report.",
max_output_tokens=800,
store=True,
extra_body={"caching": {"type": "enabled"}},
)
print(first.output_text)
# Round 2 onward: send only the new question, chaining the prior id
second = client.responses.create(
model="deepseek-v4-flash-ga-260731",
input="What risks are mentioned in section three?",
previous_response_id=first.id,
max_output_tokens=800,
store=True,
extra_body={"caching": {"type": "enabled"}},
)
print(second.output_text)
print("Cache hit:", second.usage.input_tokens_details.cached_tokens)
暗黙キャッシュ
caching がなくても、暗黙キャッシュは引き続き適用されます。まったく同じ長いプレフィックスを繰り返すと、99.9%(15,633 → 15,616)でヒットします。用途に応じて選択してください — 多数の独立したリクエストで 1 つのプレフィックスを再利用する場合 は暗黙キャッシュが適しており、1 つのセッションで連続する追加質問を行う場合 は、連鎖させた明示的キャッシュが適しています。
出力アイテムの種類
レスポンスoutput は、次のアイテムを含む場合がある配列です。
| 型 | 注記 |
|---|---|
reasoning | 推論コンテンツ(reasoning.effort が minimal でない場合に表示されます) |
message | 最終回答; テキストは content[].text にあります |
function_call | call_id と arguments を伴うツール呼び出し |
web_search_call | 検索呼び出しレコード — 現在は results フィールドを含みません |
承認
API Key obtained from the APIYI console
ボディ
Model ID, fixed to deepseek-v4-flash-ga-260731
deepseek-v4-flash-ga-260731 Input content. Either a string or a standard OpenAI Responses message array. Text only — no images
Max output tokens, hard ceiling 393,216. Reasoning counts toward this
x <= 393216Whether to store this response. Must be true to chain with previous_response_id
The id of the previous response. Combined with caching, this hits the explicit cache in full
Explicit cache switch. Pass {"type": "enabled"} on the first call to write, then chain with previous_response_id to hit
Show child attributes
Show child attributes
Reasoning control. Measured: effort=minimal always yields 0 reasoning tokens; the other tiers do not form a monotonic ladder
Show child attributes
Show child attributes
Stream the response over SSE. Measured TTFB around 2.3 seconds
Tool list. The function type works; web_search is wired but its backend errors, and mcp returns AccessDenied
レスポンス
Generation succeeded
Response ID, used as the next call's previous_response_id
Output item array. May contain reasoning / message / function_call / web_search_call items
Explicit cache status echo
Usage. input_tokens_details.cached_tokens is the cache hit; output_tokens_details.reasoning_tokens is reasoning spend
このページは役に立ちましたか?