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": "Introduce yourself in one sentence"
}
]
}
'import requests
url = "https://api.apiyi.com/v1/chat/completions"
payload = {
"model": "dola-seed-2-1-turbo-260628",
"messages": [
{
"role": "user",
"content": "Introduce yourself 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: 'dola-seed-2-1-turbo-260628',
messages: [{role: 'user', content: 'Introduce yourself in one sentence'}]
})
};
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' => 'Introduce yourself 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/chat/completions"
payload := strings.NewReader("{\n \"model\": \"dola-seed-2-1-turbo-260628\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\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\": \"Introduce yourself in one sentence\"\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\": \"Introduce yourself in one sentence\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"choices": [
{}
],
"usage": {}
}Seed 2.1 Turbo Chat API リファレンス
Seed 2.1 Turbo (dola-seed-2-1-turbo-260628) Chat Completions API リファレンスとインタラクティブなプレイグラウンド: OpenAI 互換で、thinking の切り替えと tiers 付きです。
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": "Introduce yourself in one sentence"
}
]
}
'import requests
url = "https://api.apiyi.com/v1/chat/completions"
payload = {
"model": "dola-seed-2-1-turbo-260628",
"messages": [
{
"role": "user",
"content": "Introduce yourself 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: 'dola-seed-2-1-turbo-260628',
messages: [{role: 'user', content: 'Introduce yourself in one sentence'}]
})
};
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' => 'Introduce yourself 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/chat/completions"
payload := strings.NewReader("{\n \"model\": \"dola-seed-2-1-turbo-260628\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\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\": \"Introduce yourself in one sentence\"\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\": \"Introduce yourself in one sentence\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"choices": [
{}
],
"usage": {}
}Bearer sk-your-api-key を Authorization に設定します。デフォルトの例では deep thinking が無効(thinking.disabled)になっているため、最初の送信で高速に応答が返ります。"thinking": {"type": "disabled"} をそのまま使ってください。実際に推論が必要なときは reasoning_effort(low / medium / high)に切り替えます。機能、料金、キャッシュについては、Seed 2.1 Turbo の概要で説明しています。- thinking を ON にすると、
max_tokensに余裕を持たせてください(推論は出力バジェットに含まれます)— 3000+ を推奨します - 綴りが間違ったモデル名では 503(利用可能なチャネルがありません)が返り、404 ではありません
パラメータのクイックリファレンス
| パラメータ | 型 | 必須 | デフォルト | 備考 |
|---|---|---|---|---|
model | string | ✓ | — | 固定: dola-seed-2-1-turbo-260628 |
messages | array | ✓ | — | 標準のOpenAIメッセージ配列 |
max_tokens | int | — | 出力予算; 推論オンで3000以上 | |
thinking.type | string | enabled | デフォルトでON; disabledで推論をオフにします | |
reasoning_effort | string | — | low / medium / high; 実測では約226(低)対約960(高)の推論 tokens | |
stream | bool | false | SSEストリーミング; 使用状況を追加するには stream_options.include_usage | |
response_format | object | — | 構造化出力、json_schema + strict をサポート | |
tools | array | — | Function-calling ツール一覧 |
Response Highlights
- thinking をオンにすると、
choices[0].messageにはreasoning_content(完全な推論テキスト)に加えてcontentも含まれます - 推論消費量:
usage.completion_tokens_details.reasoning_tokens - 暗黙的なキャッシュヒット:
usage.prompt_tokens_details.cached_tokens(長い先頭部分の繰り返しは 2 回目のリクエストからヒットします)
承認
API Key from the APIYI console
ボディ
Model ID, fixed to dola-seed-2-1-turbo-260628
dola-seed-2-1-turbo-260628 Conversation messages, standard OpenAI format
Show child attributes
Show child attributes
Max output tokens. Reasoning counts against this too - give it headroom (e.g. 2000+) when thinking is on
Deep-thinking switch. ON by default; pass {"type": "disabled"} to turn it off and cut latency and output tokens sharply
Show child attributes
Show child attributes
Thinking depth tier (do not combine with thinking.disabled). Measured: low ~226, high ~960 reasoning tokens
low, medium, high Stream via SSE. Combine with stream_options.include_usage to get usage in the final chunk
Sampling temperature
Structured output. Supports {"type": "json_schema", "json_schema": {name, strict, schema}}
Function-calling tool list, standard OpenAI format
レスポンス
Chat completion succeeded
このページは役に立ちましたか?