curl --request POST \
--url https://direct.evolink.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seed-2-1-pro",
"input": "自己紹介をしてください"
}
'{
"id": "resp_02177148667427813c33c36521378d02b2c8389204fa8c3e2f63e",
"object": "response",
"created_at": 1771486674,
"model": "doubao-seed-2-1-pro",
"status": "completed",
"output": [
{
"id": "rs_0217****404a",
"type": "reasoning",
"summary": [
{
"text": "<string>",
"type": "summary_text"
}
],
"status": "completed"
}
],
"instructions": "<string>",
"previous_response_id": "<string>",
"max_output_tokens": 32768,
"temperature": 123,
"top_p": 123,
"thinking": {},
"tools": "<array>",
"tool_choice": "<unknown>",
"parallel_tool_calls": true,
"text": {},
"usage": {
"input_tokens": 88,
"input_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0,
"audio_cached_tokens": 0
},
"output_tokens": 230,
"output_tokens_details": {
"reasoning_tokens": 211
},
"total_tokens": 318,
"tool_usage": {
"web_search": 1
},
"tool_usage_details": {
"web_search": {
"search_engine": 1
}
}
},
"caching": {
"type": "enabled"
},
"store": true,
"expire_at": 1756539922,
"error": {},
"incomplete_details": {}
}{
"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/credits"
}
}{
"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-1-pro"
}
}{
"error": {
"code": 413,
"message": "File too large",
"type": "request_too_large_error",
"fallback_suggestion": "compress file to under 50MB"
}
}{
"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
Seed Responses — API リファレンス
- Responses API 形式で Seed を呼び出します。
- サーバーにコンテキストを保存し、履歴を再送せず
previous_response_idで会話を続けられます。 - テキスト・画像・動画・PDF を組み合わせられます。
doubao-seed-2-1-liteのみ音声にも対応します。 - 思考は既定で有効です。無効化や深さの調整ができます。
- 全モデルが関数呼び出しに対応します。Seed 2.1 と
doubao-seed-evolvingはウェブ検索にも対応します。 - 自動キャッシュは既定で有効です。明示的キャッシュには
caching、コンテキスト管理にはcontext_managementを使用します。 - JSON Object または JSON Schema 形式の構造化出力に対応します。
- Seed 2.0 の旧モデル名:
doubao-seed-2.0-pro/doubao-seed-2.0-liteは現在doubao-seed-2-1-lite、doubao-seed-2.0-codeはdoubao-seed-evolvingに転送されます。パラメータの動作は新しいモデルに準じます。新規連携では新しいモデル名を使用してください。doubao-seed-2.0-miniは変わりません - クイックスタート
POST
/
v1
/
responses
curl --request POST \
--url https://direct.evolink.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seed-2-1-pro",
"input": "自己紹介をしてください"
}
'{
"id": "resp_02177148667427813c33c36521378d02b2c8389204fa8c3e2f63e",
"object": "response",
"created_at": 1771486674,
"model": "doubao-seed-2-1-pro",
"status": "completed",
"output": [
{
"id": "rs_0217****404a",
"type": "reasoning",
"summary": [
{
"text": "<string>",
"type": "summary_text"
}
],
"status": "completed"
}
],
"instructions": "<string>",
"previous_response_id": "<string>",
"max_output_tokens": 32768,
"temperature": 123,
"top_p": 123,
"thinking": {},
"tools": "<array>",
"tool_choice": "<unknown>",
"parallel_tool_calls": true,
"text": {},
"usage": {
"input_tokens": 88,
"input_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0,
"audio_cached_tokens": 0
},
"output_tokens": 230,
"output_tokens_details": {
"reasoning_tokens": 211
},
"total_tokens": 318,
"tool_usage": {
"web_search": 1
},
"tool_usage_details": {
"web_search": {
"search_engine": 1
}
}
},
"caching": {
"type": "enabled"
},
"store": true,
"expire_at": 1756539922,
"error": {},
"incomplete_details": {}
}{
"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/credits"
}
}{
"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-1-pro"
}
}{
"error": {
"code": 413,
"message": "File too large",
"type": "request_too_large_error",
"fallback_suggestion": "compress file to under 50MB"
}
}{
"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 はマルチモーダルの主力エンドポイントで、テキストモデルに対しては代替アドレスとして使用されます。ウェブ検索は Seed 2.1 と
doubao-seed-evolving のみ対応し、検索元別の実行回数で課金されます。明示的キャッシュには保存料金が別途かかります。caching と expire_at を参照してください。 リクエストメニューの 2 つの明示的キャッシュ例では expire_at を省略しているため、既定の有効期間である 3 日分の保存料金がかかります。有効期限が 1 時間のキャッシュリクエストを作る
送信直前に次の Python コードを実行し、出力された JSON をリクエスト本文に使います。初回はPREVIOUS_RESPONSE_ID を設定しません。続行するときは直前の応答の実際の id をこの環境変数に設定して再実行します。実行のたびに expire_at が再計算されます。
import json
import os
import time
body = {
"model": "doubao-seed-2-1-pro",
"input": "製品マニュアル:モーターとバッテリーの保証期間は 2 年です。この規定を覚えてください。",
"caching": {"type": "enabled"},
"expire_at": int(time.time()) + 3600,
}
previous_id = os.getenv("PREVIOUS_RESPONSE_ID")
if previous_id:
body["previous_response_id"] = previous_id
body["input"] = "保証の対象となる部品は何ですか。"
print(json.dumps(body, ensure_ascii=False))
承認
##すべてのAPIにBearer Token認証が必要です##
APIキーの取得:
APIキー管理ページにアクセスしてAPIキーを取得してください
リクエストヘッダーに追加:
Authorization: Bearer YOUR_API_KEY
ボディ
application/json
モデルの選択
| モデル ID | 用途 | コンテキスト長 |
|---|---|---|
doubao-seed-2-1-pro | 複雑な推論、長文書、コードベースに適した推奨の最上位モデル | 100 万トークン |
doubao-seed-2-1-turbo | 対話、データ抽出、エージェント処理向けの低価格モデル | 25.6 万トークン |
doubao-seed-2-1-lite | Seed 2.1 で最も低価格。音声入力に対応 | 100 万トークン |
doubao-seed-evolving | 新機能の評価向けに毎週更新 | 100 万トークン |
doubao-seed-2.0-pro | 旧モデル名。現在は doubao-seed-2-1-lite に転送されます | 100 万トークン |
doubao-seed-2.0-lite | 旧モデル名。現在は doubao-seed-2-1-lite に転送されます | 100 万トークン |
doubao-seed-2.0-mini | 簡単なタスク向けの Seed 2.0 最速モデル | 25.6 万トークン |
doubao-seed-2.0-code | 旧モデル名。現在は doubao-seed-evolving に転送されます | 100 万トークン |
Seed 2.1 のモデル ID はハイフン(2-1)、Seed 2.0 はピリオド(2.0)を使います。
利用可能なオプション:
doubao-seed-2-1-pro, doubao-seed-2-1-turbo, doubao-seed-2-1-lite, doubao-seed-evolving, doubao-seed-2.0-pro, doubao-seed-2.0-lite, doubao-seed-2.0-mini, doubao-seed-2.0-code 例:
"doubao-seed-2-1-pro"
省略または disabled で自動キャッシュを使用します。直近のリクエストと共通の接頭辞にヒット料金が適用される場合があります。保存料はかからず、ヒットは保証されません。
{"type": "enabled"} で現在の入力を明示的に保存します。previous_response_id で続ける各ターンでも caching: {"type": "enabled"} を指定してください。ヒット分にはヒット料金が適用されます。保存料は expire_at までの新規保存トークン数 × 保存時間(時間単位)で別途計算し、モデル単価を適用します。
instructions や関数以外のツール(ウェブ検索を含む)との併用は 400 を返します。
Show child attributes
Show child attributes
モデルテキスト出力の形式定義
Show child attributes
Show child attributes
レスポンス
レスポンス生成成功