Doubao Seed 2.0 Responses API クイックチャット
curl --request POST \
--url https://direct.evolink.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seed-2.0-pro",
"input": "こんにちは、Doubao Seed 2.0の新機能を紹介してください"
}
'import requests
url = "https://direct.evolink.ai/v1/responses"
payload = {
"model": "doubao-seed-2.0-pro",
"input": "こんにちは、Doubao Seed 2.0の新機能を紹介してください"
}
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: 'doubao-seed-2.0-pro', input: 'こんにちは、Doubao Seed 2.0の新機能を紹介してください'})
};
fetch('https://direct.evolink.ai/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://direct.evolink.ai/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' => 'doubao-seed-2.0-pro',
'input' => 'こんにちは、Doubao Seed 2.0の新機能を紹介してください'
]),
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://direct.evolink.ai/v1/responses"
payload := strings.NewReader("{\n \"model\": \"doubao-seed-2.0-pro\",\n \"input\": \"こんにちは、Doubao Seed 2.0の新機能を紹介してください\"\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://direct.evolink.ai/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seed-2.0-pro\",\n \"input\": \"こんにちは、Doubao Seed 2.0の新機能を紹介してください\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://direct.evolink.ai/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\": \"doubao-seed-2.0-pro\",\n \"input\": \"こんにちは、Doubao Seed 2.0の新機能を紹介してください\"\n}"
response = http.request(request)
puts response.read_body{
"id": "resp_02177148667427813c33c36521378d02b2c8389204fa8c3e2f63e",
"object": "response",
"created_at": 1771486674,
"model": "doubao-seed-2-0-code-preview-260215",
"status": "completed",
"output": [
{
"id": "rs_0217****404a",
"type": "reasoning",
"summary": [
{
"text": "<string>",
"type": "summary_text"
}
],
"status": "completed"
}
],
"service_tier": "default",
"usage": {
"input_tokens": 88,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 230,
"output_tokens_details": {
"reasoning_tokens": 211
},
"total_tokens": 318
},
"max_output_tokens": 32768,
"caching": {
"type": "enabled"
},
"store": true,
"expire_at": 1771745874,
"error": {}
}{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": 402,
"message": "Insufficient quota",
"type": "insufficient_quota_error",
"fallback_suggestion": "https://evolink.ai/dashboard/billing"
}
}{
"error": {
"code": 403,
"message": "Access denied for this model",
"type": "permission_error",
"param": "model"
}
}{
"error": {
"code": 404,
"message": "Specified model not found",
"type": "not_found_error",
"param": "model",
"fallback_suggestion": "doubao-seed-2.0-pro"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"fallback_suggestion": "retry after 60 seconds"
}
}{
"error": {
"code": 500,
"message": "Internal server error",
"type": "internal_server_error",
"fallback_suggestion": "try again later"
}
}{
"error": {
"code": 502,
"message": "Upstream AI service unavailable",
"type": "upstream_error",
"fallback_suggestion": "try different model"
}
}{
"error": {
"code": 503,
"message": "Service temporarily unavailable",
"type": "service_unavailable_error",
"fallback_suggestion": "retry after 30 seconds"
}
}Responses API
Doubao Seed 2.0 Responses API - クイックスタート
- Responses API形式でDoubao Seed 2.0シリーズモデルを呼び出し
- サーバーサイドコンテキストストレージに対応、
previous_response_idによるマルチターン会話を実現 - 最小限のパラメータですぐに使い始められる
- 対応モデル:
doubao-seed-2.0-pro、doubao-seed-2.0-lite、doubao-seed-2.0-mini、doubao-seed-2.0-code - より多くの機能が必要ですか?完全なAPIリファレンスをご覧ください
POST
/
v1
/
responses
Doubao Seed 2.0 Responses API クイックチャット
curl --request POST \
--url https://direct.evolink.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seed-2.0-pro",
"input": "こんにちは、Doubao Seed 2.0の新機能を紹介してください"
}
'import requests
url = "https://direct.evolink.ai/v1/responses"
payload = {
"model": "doubao-seed-2.0-pro",
"input": "こんにちは、Doubao Seed 2.0の新機能を紹介してください"
}
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: 'doubao-seed-2.0-pro', input: 'こんにちは、Doubao Seed 2.0の新機能を紹介してください'})
};
fetch('https://direct.evolink.ai/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://direct.evolink.ai/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' => 'doubao-seed-2.0-pro',
'input' => 'こんにちは、Doubao Seed 2.0の新機能を紹介してください'
]),
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://direct.evolink.ai/v1/responses"
payload := strings.NewReader("{\n \"model\": \"doubao-seed-2.0-pro\",\n \"input\": \"こんにちは、Doubao Seed 2.0の新機能を紹介してください\"\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://direct.evolink.ai/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"doubao-seed-2.0-pro\",\n \"input\": \"こんにちは、Doubao Seed 2.0の新機能を紹介してください\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://direct.evolink.ai/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\": \"doubao-seed-2.0-pro\",\n \"input\": \"こんにちは、Doubao Seed 2.0の新機能を紹介してください\"\n}"
response = http.request(request)
puts response.read_body{
"id": "resp_02177148667427813c33c36521378d02b2c8389204fa8c3e2f63e",
"object": "response",
"created_at": 1771486674,
"model": "doubao-seed-2-0-code-preview-260215",
"status": "completed",
"output": [
{
"id": "rs_0217****404a",
"type": "reasoning",
"summary": [
{
"text": "<string>",
"type": "summary_text"
}
],
"status": "completed"
}
],
"service_tier": "default",
"usage": {
"input_tokens": 88,
"input_tokens_details": {
"cached_tokens": 0
},
"output_tokens": 230,
"output_tokens_details": {
"reasoning_tokens": 211
},
"total_tokens": 318
},
"max_output_tokens": 32768,
"caching": {
"type": "enabled"
},
"store": true,
"expire_at": 1771745874,
"error": {}
}{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"error": {
"code": 401,
"message": "Invalid or expired token",
"type": "authentication_error"
}
}{
"error": {
"code": 402,
"message": "Insufficient quota",
"type": "insufficient_quota_error",
"fallback_suggestion": "https://evolink.ai/dashboard/billing"
}
}{
"error": {
"code": 403,
"message": "Access denied for this model",
"type": "permission_error",
"param": "model"
}
}{
"error": {
"code": 404,
"message": "Specified model not found",
"type": "not_found_error",
"param": "model",
"fallback_suggestion": "doubao-seed-2.0-pro"
}
}{
"error": {
"code": 429,
"message": "Rate limit exceeded",
"type": "rate_limit_error",
"fallback_suggestion": "retry after 60 seconds"
}
}{
"error": {
"code": 500,
"message": "Internal server error",
"type": "internal_server_error",
"fallback_suggestion": "try again later"
}
}{
"error": {
"code": 502,
"message": "Upstream AI service unavailable",
"type": "upstream_error",
"fallback_suggestion": "try different model"
}
}{
"error": {
"code": 503,
"message": "Service temporarily unavailable",
"type": "service_unavailable_error",
"fallback_suggestion": "retry after 30 seconds"
}
}BaseURL:デフォルトの BaseURL は
https://direct.evolink.ai で、テキストモデルへの対応が優れており、長時間接続をサポートします。https://api.evolink.ai はマルチモーダルの主力エンドポイントで、テキストモデルに対しては代替アドレスとして使用されます。承認
##すべてのAPIにBearer Token認証が必要です##
APIキーの取得:
APIキー管理ページにアクセスしてAPIキーを取得してください
リクエストヘッダーに追加:
Authorization: Bearer YOUR_API_KEY
ボディ
application/json
チャットモデル名
doubao-seed-2.0-pro: フラッグシップ版、総合能力最強、複雑な推論と高品質生成に最適doubao-seed-2.0-lite: 軽量版、より高速、コストパフォーマンスが高いdoubao-seed-2.0-mini: 超高速版、レスポンス最速、シンプルなタスクに最適doubao-seed-2.0-code: コード専用版、コード生成と理解に最適化
利用可能なオプション:
doubao-seed-2.0-pro, doubao-seed-2.0-lite, doubao-seed-2.0-mini, doubao-seed-2.0-code 例:
"doubao-seed-2.0-pro"
入力コンテンツ(テキスト)、userロールが入力したテキスト情報と同等
例:
"こんにちは、Doubao Seed 2.0の新機能を紹介してください"
レスポンス
レスポンス生成成功
このレスポンスの一意識別子
例:
"resp_02177148667427813c33c36521378d02b2c8389204fa8c3e2f63e"
オブジェクトタイプ、responseに固定
利用可能なオプション:
response 例:
"response"
作成時刻のUnixタイムスタンプ(秒)
例:
1771486674
実際に使用されたモデル名和版本
例:
"doubao-seed-2-0-code-preview-260215"
レスポンスステータス
completed: 生成完了in_progress: 生成中incomplete: 未完了failed: 失敗
利用可能なオプション:
completed, in_progress, incomplete, failed 例:
"completed"
モデル出力コンテンツリスト
- 思考チェーン出力
- メッセージ出力
Show child attributes
Show child attributes
今回のリクエストのサービスティア
例:
"default"
トークン使用統計情報
Show child attributes
Show child attributes
モデル出力の最大トークン数
例:
32768
キャッシュ設定
Show child attributes
Show child attributes
レスポンスが保存されたかどうか
例:
true
ストレージ有効期限(Unixタイムスタンプ)
例:
1771745874
エラー情報、成功時はnull