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 в
Authorization. В примере по умолчанию уже указаны caching: {"type": "enabled"} и
store: true — схема записи первого вызова для цепочечного явного кэширования.text.formatjson_schema не действует: возвращает 200, игнорируя схему; 3/3 ответа были заключены в блоки кода и не поддались парсингуweb_searchbackend непригоден к использованию: инструмент подключён (элементыweb_search_callотображаются сstatus: completed), но 6/6 поисков завершились ошибкой и не вернули ни одногоresultsmcpвозвращает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 дает 0 токенов рассуждения; другие уровни не монотонны | |
stream | bool | false | Потоковая передача SSE, измеренный TTFB около 2.31s | |
tools | array | — | function работает; см. предупреждение выше для web_search / mcp |
Явный кэш: требуется цепочка
caching приводит к
тому, что cached_tokens остаётся на 0. Явный кэш не сопоставляется по префиксу — вам нужно связать
сессию с previous_response_id.id.
| Round | Call shape | input_tokens | cached_tokens | Задержка |
|---|---|---|---|---|
| 1 (write) | 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). Выбирайте в зависимости от сценария — один префикс, повторно используемый во многих независимых запросах лучше подходит для неявного кэша, тогда как одна сессия с последовательными уточнениями лучше подходит для цепочечного явного кэширования.
Типы элементов вывода
Ответoutput — это массив, который может содержать следующие элементы:
| type | Примечания |
|---|---|
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
Была ли эта страница полезной?