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 Reference
DeepSeek V4 Flash GA (deepseek-v4-flash-ga-260731) Responses API reference and playground: chained explicit caching that hits the entire prior context on every round.
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 in
Authorization. The default example already carries caching: {"type": "enabled"} and
store: true — the first-call write shape for chained explicit caching.text.formatjson_schema has no effect: returns 200 while ignoring the schema; 3/3 responses were wrapped in code fences and failed to parseweb_searchbackend is unusable: the tool is wired (web_search_callitems appear withstatus: completed) but 6/6 searches errored and returned noresultsmcpreturnsAccessDenied: an account/channel-level built-in-tool entitlement — a valid server URL gives the same result- Text-only model — passing images returns
Model do not support image input
Parameter Quick Reference
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
model | string | ✓ | — | Fixed to deepseek-v4-flash-ga-260731 |
input | string / array | ✓ | — | String or standard Responses message array, text only |
max_output_tokens | int | — | Hard ceiling 393,216; reasoning counts toward it | |
store | bool | true | Must be true to chain | |
previous_response_id | string | — | The prior response id; combined with caching it hits the explicit cache | |
caching.type | string | — | enabled writes the explicit cache; the response echoes this field | |
reasoning.effort | string | — | minimal yields 0 reasoning tokens; other tiers are not monotonic | |
stream | bool | false | SSE streaming, measured TTFB around 2.31s | |
tools | array | — | function works; see the warning above for web_search / mcp |
Explicit Cache: Chaining Is Required
caching set leaves
cached_tokens at 0. The explicit cache is not prefix-matched — you must chain the
session with previous_response_id.id.
| Round | Call shape | input_tokens | cached_tokens | Latency |
|---|---|---|---|---|
| 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 |
Chained Call Example
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)
Implicit Cache
Withoutcaching, the implicit cache still applies: repeating an identical long prefix hit
99.9% (15,633 → 15,616). Choose per scenario — one prefix reused across many independent
requests suits the implicit cache, while one session with successive follow-ups suits
chained explicit caching.
Output Item Types
The responseoutput is an array that may contain these items:
| type | Notes |
|---|---|
reasoning | Reasoning content (appears when reasoning.effort is not minimal) |
message | Final answer; text lives in content[].text |
function_call | Tool call with call_id and arguments |
web_search_call | Search call record — currently carries no results field |
Authorizations
API Key obtained from the APIYI console
Body
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
Response
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
Was this page helpful?