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_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이며, reasoning이 그 수치에 포함됩니다 | |
store | bool | true | 체인하려면 true여야 합니다 | |
previous_response_id | string | — | 이전 응답의 id이며, caching와 함께 사용하면 명시적 캐시에 적중합니다 | |
caching.type | string | — | enabled이 명시적 캐시를 기록하며, 응답은 이 필드를 그대로 반환합니다 | |
reasoning.effort | string | — | minimal은 reasoning token을 0개 생성합니다. 다른 티어는 단조롭지 않습니다 | |
stream | bool | false | SSE 스트리밍이며, 측정된 TTFB는 약 2.31초입니다 | |
tools | array | — | function이 작동합니다. web_search / mcp에 대한 경고는 위를 참조하십시오 |
명시적 캐시: 체인이 필요합니다
caching가 설정된 상태에서 같은 긴 접두사를 두 번 다시 보내면
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). 상황에 맞게 선택하십시오 — 여러 개의 독립적인 요청에 걸쳐 하나의 접두부를 재사용하는 경우에는 암시적 캐시가 적합하고, 하나의 세션에서 연속적인 후속 질문을 주고받는 경우에는 연결된 명시적 캐싱이 적합합니다.
출력 항목 유형
응답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
이 페이지가 도움이 되었나요?