curl --request POST \
--url https://direct.evolink.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seed-2-1-pro",
"max_tokens": 4096,
"messages": [
{
"role": "user",
"content": "自己紹介をしてください"
}
]
}
'{
"id": "0217952345678901234567890abcdef",
"type": "message",
"role": "assistant",
"model": "doubao-seed-2-1-pro",
"content": [
{
"type": "thinking",
"thinking": "短い自己紹介を求められている…",
"signature": "EqQBCkgIARABGAIi..."
},
{
"type": "text",
"text": "こんにちは。Seed シリーズの言語モデルです。推論、文章作成、プログラミングが得意です。"
}
],
"stop_reason": "end_turn",
"stop_sequence": "<string>",
"usage": {
"input_tokens": 25,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0,
"output_tokens": 120,
"server_tool_use": {
"web_search_requests": 1
}
}
}{
"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": 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"
}
}Messages API
Seed Messages — API リファレンス
- Anthropic Messages 形式で Seed を呼び出せます。Claude Code などの対応ツールでも利用できます。
- ステートレスなため、毎回全履歴を送り、assistant の思考ブロックはそのまま返してください。
- テキスト・画像・文書に対応します。Lite の音声入力には Chat Completions または Responses を使用してください。
- 思考は既定で有効です。
thinkingで無効化し、output_config.effortで深さを調整できます。 - 全モデルが関数呼び出しに対応します。Seed 2.1 と
doubao-seed-evolvingはウェブ検索にも対応します。 (web_search_20250305) - JSON Object または JSON Schema 形式の構造化出力に対応します。 (
output_config.format) - 長い共通接頭辞にヒットすると自動でヒット料金が適用されます。
cache_controlは不要です。ヒット数はusage.cache_read_input_tokensで確認できます。 stream=trueでは Anthropic SSE イベントがmessage_start→content_block_start/content_block_delta/content_block_stop→message_delta→message_stopの順に届きます。最終使用量はmessage_deltaに含まれます。- 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
/
messages
curl --request POST \
--url https://direct.evolink.ai/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "doubao-seed-2-1-pro",
"max_tokens": 4096,
"messages": [
{
"role": "user",
"content": "自己紹介をしてください"
}
]
}
'{
"id": "0217952345678901234567890abcdef",
"type": "message",
"role": "assistant",
"model": "doubao-seed-2-1-pro",
"content": [
{
"type": "thinking",
"thinking": "短い自己紹介を求められている…",
"signature": "EqQBCkgIARABGAIi..."
},
{
"type": "text",
"text": "こんにちは。Seed シリーズの言語モデルです。推論、文章作成、プログラミングが得意です。"
}
],
"stop_reason": "end_turn",
"stop_sequence": "<string>",
"usage": {
"input_tokens": 25,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0,
"output_tokens": 120,
"server_tool_use": {
"web_search_requests": 1
}
}
}{
"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": 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 はマルチモーダルの主力エンドポイントで、テキストモデルに対しては代替アドレスとして使用されます。web_search_20250305 に対応するのは Seed 2.1 と doubao-seed-evolving のみです。Messages は音声入力に対応しません。doubao-seed-2-1-lite の音声入力には Chat Completions または Responses を使用してください。承認
##すべての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 で最も低価格。音声入力は Chat Completions と Responses のみ対応 | 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"
全 Seed モデルが name、description、input_schema で定義する関数に対応します。Seed 2.1 と doubao-seed-evolving のウェブ検索には type=web_search_20250305、name=web_search を指定します。doubao-seed-2.0-mini のウェブ検索や web_fetch など他のサーバーツールは 400 を返します。実行した検索ごとにモデルの料金がかかります。
- カスタム関数
- ウェブ検索(Seed 2.1 と Evolving のみ)
Show child attributes
Show child attributes
レスポンス
生成に成功しました。ストリーミングでは Anthropic SSE イベントが返ります。
生成されたコンテンツブロック。思考が有効な場合、通常は thinking の後に text が続きます。本文は type="text" のブロックから読み取ります。
- テキスト
- 思考
- ツール利用
- Web 検索呼び出し
- ウェブ検索結果
Show child attributes
Show child attributes
例:
[
{
"type": "thinking",
"thinking": "短い自己紹介を求められている…",
"signature": "EqQBCkgIARABGAIi..."
},
{
"type": "text",
"text": "こんにちは。Seed シリーズの言語モデルです。推論、文章作成、プログラミングが得意です。"
}
]