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 为缓存命中量
本次请求实际生效的缓存模式
此页面对您有帮助吗?