Saltar al contenido principal
POST
/
v1
/
responses
curl --request POST \ --url https://api.evolink.ai/v1/responses \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "model": "doubao-seed-2.0-pro", "input": "Por favor, preséntate" } '
{
  "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",
  "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
    },
    "output_tokens": 230,
    "output_tokens_details": {
      "reasoning_tokens": 211
    },
    "total_tokens": 318
  },
  "caching": {
    "type": "enabled"
  },
  "store": true,
  "expire_at": 1756539922,
  "error": {},
  "incomplete_details": {}
}

Autorizaciones

Authorization
string
header
requerido

##所有接口均需要使用Bearer Token进行认证##

获取 API Key:

访问 API Key 管理页面 获取您的 API Key

使用时在请求头中添加:

Authorization: Bearer YOUR_API_KEY

Cuerpo

application/json
model
enum<string>
predeterminado:doubao-seed-2.0-pro
requerido

对话模型名称

  • doubao-seed-2.0-pro: 旗舰版,综合能力最强
  • doubao-seed-2.0-lite: 轻量版,速度更快
  • doubao-seed-2.0-mini: 极速版,响应最快
  • doubao-seed-2.0-code: 代码专用版
Opciones disponibles:
doubao-seed-2.0-pro,
doubao-seed-2.0-lite,
doubao-seed-2.0-mini,
doubao-seed-2.0-code
Ejemplo:

"doubao-seed-2.0-pro"

input
requerido

输入内容。支持两种格式:

1. 纯文本字符串: 等同于 user 角色输入的文本信息

2. 元素列表 (array): 包含消息、上下文、工具调用等多种输入类型

instructions
string | null

在模型上下文中插入系统消息或开发者指令作为第一条指令

注意:

  • 与 previous_response_id 一起使用时,前一个回复中的指令不会被继承
  • 不可与 caching 缓存能力一起使用
previous_response_id
string | null

上一个模型回复的唯一标识符,用于实现多轮对话

说明:

  • 传入后会引入上一轮请求的输入和回答内容,本次请求的输入 tokens 会相应增加
  • 在多轮连续对话中,建议在每次请求之间加入约 100 毫秒的延迟
expire_at
integer

存储的过期时刻,UTC Unix 时间戳(秒)

说明:

  • 取值范围: (创建时刻, 创建时刻 + 604800],即最多保留 7 天
  • 默认值: 创建时刻 + 259200(3天)
  • 对 store 和 caching 都生效
  • 缓存存储时间计费,不满 1 小时按 1 小时计算
max_output_tokens
integer | null

模型输出最大 token 数,包含模型回答和思维链内容

Ejemplo:

32768

thinking
object

控制模型是否Activar modo de pensamiento profundo

reasoning
object

限制深度思考的工作量,减少可使响应速度更快、token 用量更少

caching
object

是否开启上下文缓存

注意: 不可与 instructions 字段、tools(除 Function Calling 外)字段一起使用

store
boolean | null
predeterminado:true

是否储存生成的模型响应,以便后续通过 API 检索

  • true: 储存当前模型响应
  • false: 不储存
stream
boolean | null
predeterminado:false

响应内容是否流式返回

  • false: 模型生成完所有内容后一次性返回
  • true: 按 SSE 协议逐块返回,以 data: [DONE] 消息结束
temperature
number | null
predeterminado:1

采样温度,控制输出随机性

  • 取值范围: [0, 2]
  • 较低值更确定,较高值更随机
  • 建议仅调整 temperature 或 top_p 其中之一

注意: doubao-seed-2.0-pro 和 doubao-seed-2.0-lite 固定为 1,手动指定会被忽略

Rango requerido: 0 <= x <= 2
top_p
number | null
predeterminado:0.7

核采样概率阈值

  • 取值范围: [0, 1]
  • 建议仅调整 temperature 或 top_p 其中之一

注意: doubao-seed-2.0-pro 和 doubao-seed-2.0-lite 固定为 0.95,手动指定会被忽略

Rango requerido: 0 <= x <= 1
text
object

模型文本输出的格式定义

tools
object[]

模型可以调用的工具列表

支持以下工具类型:

  • function: 自定义函数(Function Calling)
  • web_search: Búsqueda web
  • doubao_app: 豆包助手
  • image_process: 图像处理
  • mcp: MCP 工具
  • knowledge_search: 私域知识库搜索
tool_choice

控制模型是否调用工具

字符串模式:

  • none: 不调用工具
  • required: 必须调用工具
  • auto: 模型自行判断(默认)

对象模式: 指定调用特定工具

Opciones disponibles:
none,
auto,
required
max_tool_calls
integer

最大工具调用轮次(一轮不限次数)

  • 取值范围: [1, 10]
  • Web Search 默认值 3
  • Image Process 默认值 10(不支持修改)
  • Knowledge Search 默认值 3

注意: 该参数为尽力而为机制,最终调用次数受模型推理效果等因素影响

Rango requerido: 1 <= x <= 10
context_management
object

上下文管理策略,帮助模型有效利用上下文窗口

Respuesta

Respuesta generada con éxito

id
string

本次响应的唯一标识

Ejemplo:

"resp_02177148667427813c33c36521378d02b2c8389204fa8c3e2f63e"

object
enum<string>

对象类型,固定为 response

Opciones disponibles:
response
Ejemplo:

"response"

created_at
number

创建时间的 Unix 时间戳(秒)

Ejemplo:

1771486674

model
string

实际使用的模型名称和版本

Ejemplo:

"doubao-seed-2-0-code-preview-260215"

status
enum<string>

响应状态

  • completed: 生成完成
  • in_progress: 生成中
  • incomplete: 未完成
  • failed: 失败
Opciones disponibles:
completed,
in_progress,
incomplete,
failed
Ejemplo:

"completed"

output
(思维链输出 · object | 消息输出 · object | 工具调用输出 · object)[]

模型输出内容列表,包含思维链输出、消息输出、工具调用输出等

service_tier
string

本次请求的服务等级

  • default: 默认服务等级
  • scale: 使用了保障包额度
Ejemplo:

"default"

instructions
string | null

本次请求使用的系统指令

previous_response_id
string | null

引用的上一个响应 ID

max_output_tokens
integer

模型输出最大 token 数

Ejemplo:

32768

temperature
number | null

使用的采样温度

top_p
number | null

使用的 top_p 值

thinking
object

使用的思考模式配置

tools
array | null

使用的工具列表

tool_choice
any | null

使用的工具选择配置

parallel_tool_calls
boolean | null

是否允许并行工具调用

text
object

文本输出格式配置

usage
object

Token 使用统计信息

caching
object

缓存配置

store
boolean

是否存储了响应

expire_at
integer

存储过期时刻(Unix 时间戳)

Ejemplo:

1756539922

error
object

错误信息,成功时为 null

incomplete_details
object

未完成的详细原因