curl --request POST \
--url https://api.apiyi.com/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "dola-seed-2-1-turbo-260628",
"input": "用一句话介绍你自己"
}
'import requests
url = "https://api.apiyi.com/v1/responses"
payload = {
"model": "dola-seed-2-1-turbo-260628",
"input": "用一句话介绍你自己"
}
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: 'dola-seed-2-1-turbo-260628', input: '用一句话介绍你自己'})
};
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' => 'dola-seed-2-1-turbo-260628',
'input' => '用一句话介绍你自己'
]),
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\": \"dola-seed-2-1-turbo-260628\",\n \"input\": \"用一句话介绍你自己\"\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\": \"dola-seed-2-1-turbo-260628\",\n \"input\": \"用一句话介绍你自己\"\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\": \"dola-seed-2-1-turbo-260628\",\n \"input\": \"用一句话介绍你自己\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"output": [
{}
],
"usage": {},
"caching": {}
}Seed 2.1 Turbo Responses API 參考
Seed 2.1 Turbo(dola-seed-2-1-turbo-260628)Responses API 參考與線上除錯:原生多輪 previous_response_id 與顯式快取鏈式呼叫。
curl --request POST \
--url https://api.apiyi.com/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "dola-seed-2-1-turbo-260628",
"input": "用一句话介绍你自己"
}
'import requests
url = "https://api.apiyi.com/v1/responses"
payload = {
"model": "dola-seed-2-1-turbo-260628",
"input": "用一句话介绍你自己"
}
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: 'dola-seed-2-1-turbo-260628', input: '用一句话介绍你自己'})
};
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' => 'dola-seed-2-1-turbo-260628',
'input' => '用一句话介绍你自己'
]),
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\": \"dola-seed-2-1-turbo-260628\",\n \"input\": \"用一句话介绍你自己\"\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\": \"dola-seed-2-1-turbo-260628\",\n \"input\": \"用一句话介绍你自己\"\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\": \"dola-seed-2-1-turbo-260628\",\n \"input\": \"用一句话介绍你自己\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"output": [
{}
],
"usage": {},
"caching": {}
}Bearer sk-your-api-key,填好 input 後傳送。響應 output 陣列中 type: "reasoning" 是思考摘要,type: "message" 才是正文。id(resp_ 開頭)作為下一輪 previous_response_id 傳入即可,無需重發歷史訊息。顯式快取、思考控制等機制詳見 Seed 2.1 Turbo 概覽。max_output_tokens太小會被思考吃滿,返回status: "incomplete"且正文為空,建議 1500 起步- 顯式快取
caching: {"type": "enabled"}必須配合previous_response_id鏈式呼叫才會命中;只重複相同字首不命中(連隱式字首快取也會失效)
引數說明速查
| 引數 | 型別 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
model | string | ✓ | — | 固定 dola-seed-2-1-turbo-260628 |
input | string / array | ✓ | — | 字串或訊息陣列(含 function_call_output 等 item) |
max_output_tokens | int | — | 含思考的輸出配額,建議 1500+ | |
reasoning.effort | string | — | low / medium / high,實測 low 約 371、high 約 1317 思考 tokens | |
previous_response_id | string | — | 上一輪響應 id,原生多輪;配合顯式快取整輪命中 | |
caching.type | string | disabled | enabled 開顯式快取(需鏈式呼叫) | |
store | bool | true | 儲存本輪響應供後續引用 | |
stream | bool | false | SSE 事件流(response.created → response.completed) | |
text.format | object | — | 結構化輸出,支援 json_schema + strict | |
tools | array | — | Function Call 工具列表(扁平格式) |
響應要點
status為incomplete時檢查incomplete_details.reason(多為length,即配額被思考吃滿)- 思考消耗看
usage.output_tokens_details.reasoning_tokens - 快取命中看
usage.input_tokens_details.cached_tokens(鏈式第 2 輪實測可整輪命中,延遲約減半) - 響應
caching欄位回顯本次實際生效的快取模式
授權
在 API易控制台获取的 API Key
主體
模型 ID,固定 dola-seed-2-1-turbo-260628
dola-seed-2-1-turbo-260628 输入内容。可为字符串,也可为消息数组([{role, content}, ...],含 function_call_output 等 item)
"用一句话介绍你自己"
最大输出 tokens(含思考)。太小会 incomplete 且正文为空,建议 1500+
思考深度控制。实测 effort low 约 371、high 约 1317 reasoning tokens
Show child attributes
Show child attributes
上一轮响应 id(resp_ 开头),实现原生多轮;配合 caching.enabled 可命中显式缓存
显式缓存开关。enabled 需配合 previous_response_id 链式调用才会命中
Show child attributes
Show child attributes
是否存储本轮响应供后续 previous_response_id 引用
是否流式输出(response.created → response.output_text.delta → response.completed 事件流)
结构化输出。支持 {"format": {"type": "json_schema", name, strict, schema}}
Function Call 工具列表(Responses 扁平格式:{type, name, description, parameters})
回應
生成成功。output 数组含 reasoning item 与 message item
响应 ID(resp_ 开头),可作为下一轮 previous_response_id
completed / incomplete(配额被思考吃满时为 incomplete)
输出 item 数组:reasoning(思考摘要)、message(正文)、function_call 等
用量。output_tokens_details.reasoning_tokens 为思考消耗;input_tokens_details.cached_tokens 为缓存命中量
本次请求实际生效的缓存模式
這個頁面有幫助嗎?