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 完整参数
- 使用 Responses API 格式调用 Seed 系列模型
- 服务端上下文存储:通过
previous_response_id实现多轮对话,无需手动传历史消息 - 多模态输入:支持文本 + 图像 + 视频 + 文件(PDF)混合输入;
doubao-seed-2-1-lite还支持音频输入 - 深度思考:默认开启,可关闭或调节思考深度
- 工具调用:支持 Function Calling;Seed 2.1 与
doubao-seed-evolving还支持联网搜索 - 上下文缓存:自动缓存默认生效;可通过
caching开启显式缓存 - 结构化输出:支持 JSON Object / JSON Schema 格式
- 上下文管理:支持 context_management 策略
- 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)会另收缓存存储费,计费方式见 caching 与 expire_at 字段说明。 页面中的两个显式缓存请求示例都省略了 expire_at,按默认 3 天有效期计收存储费。生成一小时有效的缓存请求
发送前运行以下 Python 代码,将输出的 JSON 作为请求体。首次请求无需设置环境变量。续接时,将PREVIOUS_RESPONSE_ID 设为上一轮实际返回的 id,再运行一次。每次都会重新计算 expire_at。
import json
import os
import time
body = {
"model": "doubao-seed-2-1-pro",
"input": "产品手册:电机和电池均保修两年。请记住这条保修政策。",
"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))
授权
##所有接口均需要使用Bearer Token进行认证##
获取 API Key:
访问 API Key 管理页面 获取您的 API Key
使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
application/json
对话模型名称
| 模型 ID | 定位 | 上下文 |
|---|---|---|
doubao-seed-2-1-pro | Seed 2.1 旗舰档,适合复杂推理、长文档与代码库任务(推荐) | 100 万 Token |
doubao-seed-2-1-turbo | Seed 2.1 低价档,覆盖大多数对话、抽取与 Agent 任务 | 25.6 万 Token |
doubao-seed-2-1-lite | Seed 2.1 单价最低的一档,支持音频输入 | 100 万 Token |
doubao-seed-evolving | 按周更新的 Seed 模型,适合评估新能力 | 100 万 Token |
doubao-seed-2.0-pro | 旧模型名,现已重定向到 doubao-seed-2-1-lite | 100 万 Token |
doubao-seed-2.0-lite | 旧模型名,现已重定向到 doubao-seed-2-1-lite | 100 万 Token |
doubao-seed-2.0-mini | Seed 2.0 极速版,适合简单任务 | 25.6 万 Token |
doubao-seed-2.0-code | 旧模型名,现已重定向到 doubao-seed-evolving | 100 万 Token |
注意两代模型 ID 的写法不同:Seed 2.1 写作 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 续接时命中部分按缓存命中价计费;同时按「新写入缓存的 token 数 × 存储小时数」收取缓存存储费,单价以模型定价为准,有效期见 expire_at。每一轮续接都需要再次传 caching: {"type": "enabled"}。
注意: 不可与 instructions 字段、除函数调用外的 tools(包括联网搜索)一起使用,否则返回 400
Show child attributes
Show child attributes
模型文本输出的格式定义
Show child attributes
Show child attributes
响应
响应生成成功