对话补全:Seed 2.1 Turbo 文本生成
curl --request POST \
--url https://api.apiyi.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "dola-seed-2-1-turbo-260628",
"messages": [
{
"role": "user",
"content": "用一句话介绍你自己"
}
]
}
'import requests
url = "https://api.apiyi.com/v1/chat/completions"
payload = {
"model": "dola-seed-2-1-turbo-260628",
"messages": [
{
"role": "user",
"content": "用一句话介绍你自己"
}
]
}
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',
messages: [{role: 'user', content: '用一句话介绍你自己'}]
})
};
fetch('https://api.apiyi.com/v1/chat/completions', 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/chat/completions",
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',
'messages' => [
[
'role' => 'user',
'content' => '用一句话介绍你自己'
]
]
]),
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/chat/completions"
payload := strings.NewReader("{\n \"model\": \"dola-seed-2-1-turbo-260628\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"用一句话介绍你自己\"\n }\n ]\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/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"dola-seed-2-1-turbo-260628\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"用一句话介绍你自己\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/chat/completions")
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 \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"用一句话介绍你自己\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"choices": [
{}
],
"usage": {}
}Seed 2.1 Turbo
Seed 2.1 Turbo Chat API 參考
Seed 2.1 Turbo(dola-seed-2-1-turbo-260628)Chat Completions API 參考與線上除錯:OpenAI 相容格式,支援思考開關與分檔。
POST
/
v1
/
chat
/
completions
对话补全:Seed 2.1 Turbo 文本生成
curl --request POST \
--url https://api.apiyi.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "dola-seed-2-1-turbo-260628",
"messages": [
{
"role": "user",
"content": "用一句话介绍你自己"
}
]
}
'import requests
url = "https://api.apiyi.com/v1/chat/completions"
payload = {
"model": "dola-seed-2-1-turbo-260628",
"messages": [
{
"role": "user",
"content": "用一句话介绍你自己"
}
]
}
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',
messages: [{role: 'user', content: '用一句话介绍你自己'}]
})
};
fetch('https://api.apiyi.com/v1/chat/completions', 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/chat/completions",
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',
'messages' => [
[
'role' => 'user',
'content' => '用一句话介绍你自己'
]
]
]),
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/chat/completions"
payload := strings.NewReader("{\n \"model\": \"dola-seed-2-1-turbo-260628\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"用一句话介绍你自己\"\n }\n ]\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/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"dola-seed-2-1-turbo-260628\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"用一句话介绍你自己\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/chat/completions")
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 \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"用一句话介绍你自己\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"choices": [
{}
],
"usage": {}
}右側 Playground 可直接除錯:在 Authorization 填
Bearer sk-your-api-key,預設示例已關閉深度思考(thinking.disabled),點擊發送即可快速看到響應。模型預設開啟深度思考,簡單問題也會先輸出數百 tokens 思考內容。除錯建議保持示例中的
"thinking": {"type": "disabled"};需要思考時改用 reasoning_effort(low / medium / high)。模型能力、定價、快取機制詳見 Seed 2.1 Turbo 概覽。- 開啟思考時
max_tokens要給足(思考內容計入輸出配額),建議 3000+ - 模型名拼寫錯誤返回 503(無可用渠道)而非 404
引數說明速查
| 引數 | 型別 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
model | string | ✓ | — | 固定 dola-seed-2-1-turbo-260628 |
messages | array | ✓ | — | OpenAI 標準訊息陣列 |
max_tokens | int | — | 輸出配額,開思考時建議 3000+ | |
thinking.type | string | enabled | 預設開啟;disabled 關閉思考 | |
reasoning_effort | string | — | low / medium / high,實測 low 約 226、high 約 960 思考 tokens | |
stream | bool | false | SSE 流式,配 stream_options.include_usage 拿用量 | |
response_format | object | — | 結構化輸出,支援 json_schema + strict | |
tools | array | — | Function Call 工具列表 |
響應要點
- 開思考時
choices[0].message除content外還有reasoning_content(思考全文) - 思考消耗看
usage.completion_tokens_details.reasoning_tokens - 隱式快取命中看
usage.prompt_tokens_details.cached_tokens(相同長字首第 2 次請求即命中)
授權
在 API易控制台获取的 API Key
主體
application/json
模型 ID,固定 dola-seed-2-1-turbo-260628
可用選項:
dola-seed-2-1-turbo-260628 对话消息数组,OpenAI 标准格式
Show child attributes
Show child attributes
最大输出 tokens。开启思考时思考内容也计入,建议给足(如 2000+)
深度思考开关。模型默认开启;传 {"type": "disabled"} 可关闭,显著降低延迟与输出 tokens
Show child attributes
Show child attributes
思考深度分档(与 thinking.disabled 不同时使用)。实测 low 约 226、high 约 960 reasoning tokens
可用選項:
low, medium, high 是否流式输出(SSE)。配合 stream_options.include_usage 可在末尾获取用量
采样温度
结构化输出。支持 {"type": "json_schema", "json_schema": {name, strict, schema}}
Function Call 工具列表,OpenAI 标准格式
這個頁面有幫助嗎?
⌘I