Skip to Content
模型用法豆包 Seed

豆包 Seed 系列

字节跳动的豆包 Seed 文本模型,包括 Seed 2.1 Pro、Seed 2.1 Turbo、Seed Evolving 与 Seed Character。通过 OpenAI 兼容接口调用,除 Seed Character 外同时支持 Anthropic 原生接口,可在 Claude Code 中使用。豆包的生图模型见 Seedream(豆包),视频模型见 Seedance。

常见任务

模型

完整的模型列表与实时价格请参阅模型页 。模型 ID 的前缀为 volcengine/,可省略;写成 bytedance/、doubao/ 前缀或火山方舟带日期的模型名称会返回 404。

常用模型 ID(调用时原样复制)
Seed 2.1 Provolcengine/doubao-seed-2.1-pro256K 上下文,支持图片输入
Seed 2.1 Turbovolcengine/doubao-seed-2.1-turbo256K 上下文,支持图片输入
Seed Evolvingvolcengine/doubao-seed-evolving256K 上下文,支持图片输入
Seed Charactervolcengine/doubao-seed-character默认不思考,不支持 Anthropic 接口

以上模型由火山引擎(volcengine)提供,均支持 Chat Completions 与 Responses 接口。

调用示例

doubao_basic.py
import os from openai import OpenAI client = OpenAI(base_url="https://api.ofox.io/v1", api_key=os.environ["OFOX_API_KEY"]) resp = client.chat.completions.create( model="volcengine/doubao-seed-2.1-pro", messages=[{"role": "user", "content": "用一句话解释什么是幂等性。"}], extra_body={"thinking": {"type": "disabled"}}, ) print(resp.choices[0].message.content)

深度思考

要点Seed 2.1 Pro、Seed 2.1 Turbo 与 Seed Evolving 默认开启深度思考,简单问题也可能耗时数十秒。不需要思考时,请将 thinking 的 type 设为 disabled。
模型默认控制方式
Seed 2.1 Pro、Seed 2.1 Turbo、Seed Evolving开启"thinking": {"type": "disabled"} 关闭;reasoning_effort: "low" 降低思考量
Seed Character关闭不支持 reasoning_effort
  • thinking.type 支持 enabled 与 disabled,传 auto 会返回 400。
  • 实测「用一句话解释什么是幂等性」:Seed 2.1 Pro 默认思考约 1500 token、耗时约 40 秒;Seed Evolving 约 1700 token、约 54 秒。关闭思考后约 2 秒返回。
  • 思考 token 计入 max_tokens。上限设得过小时,content 可能为空,finish_reason 为 length。
  • 思考 token 按输出单价计费,数量见 usage.completion_tokens_details.reasoning_tokens。

读取思考内容:流式响应中位于 delta.reasoning_content;非流式响应中位于 message.reasoning_details,请将各项的 text 依次拼接。

在 Claude Code 中使用

Seed 2.1 Pro、Seed 2.1 Turbo 与 Seed Evolving 支持 Anthropic 原生接口,地址为 https://api.ofox.io/anthropic:

Claude Code 配置值
ANTHROPIC_BASE_URLhttps://api.ofox.io/anthropic
ANTHROPIC_AUTH_TOKEN粘贴你的 OfoxAI API Key
ANTHROPIC_MODELvolcengine/doubao-seed-2.1-pro
  • 通过 Anthropic 接口调用时,不传 thinking 参数则不返回思考内容。需要思考时传 "thinking": {"type": "enabled", "budget_tokens": 2000} 或 {"type": "adaptive"},思考内容以 thinking 块返回。
  • Seed Character 不支持 Anthropic 接口,调用会返回 protocol_not_supported。

Claude Code 的完整配置步骤见 Claude Code 配置。

图片输入与结构化输出

  • 图片输入:以上模型均支持图片输入,使用标准的 image_url 内容块,写法见视觉理解。图片链接需能从公网快速下载,否则会返回 Timeout while downloading url;也可以改用 base64 数据。
  • 结构化输出:response_format 支持 json_schema 与 json_object,写法见结构化输出。
  • 工具调用:使用标准的 tools 参数,返回 tool_calls。

常见报错

HTTP · type报错原文原因处理方法
400 BadRequest包含 Unsupported thinking type for the current model: autothinking.type 传了 auto改用 enabled 或 disabled
400 BadRequest包含 Invalid combination of reasoning_effort and thinking type: low + disabled向 Seed Character 传了 reasoning_effort删除 reasoning_effort
400 BadRequest包含 integer above maximum value, expected a value <= 262144max_tokens 超过上限调小 max_tokens
400 BadRequest包含 Timeout while downloading url图片链接下载超时换用可快速访问的链接,或改用 base64
400 protocol_not_supportedModel 'volcengine/doubao-seed-character' does not support the 'anthropic' protocol on this platform.Seed Character 不支持 Anthropic 接口改用 OpenAI 兼容接口
404 model_not_foundModel 'bytedance/doubao-seed-2.1-pro' not found前缀写错前缀为 volcengine/,从本页复制模型 ID
请求超时—默认开启深度思考,耗时较长关闭思考、使用流式输出,或将客户端超时设置为 600 秒以上

其他通用错误见错误处理。

官方文档

常见问题

豆包的模型 ID 怎么写?

标准写法为 volcengine/doubao-seed-2.1-pro,也可以省略前缀写成 doubao-seed-2.1-pro。写成 bytedance/ 或 doubao/ 前缀会返回 404。

豆包为什么回答这么慢?

Seed 2.1 Pro、Seed 2.1 Turbo 与 Seed Evolving 默认开启深度思考,简单问题也可能思考上千 token、耗时数十秒。不需要思考时传 "thinking": {"type": "disabled"},OpenAI SDK 中放在 extra_body 里。

Claude Code 能用豆包吗?

能。ANTHROPIC_BASE_URL 设为 https://api.ofox.io/anthropic,模型填 volcengine/doubao-seed-2.1-pro。Seed Character 不支持 Anthropic 接口。

豆包能识别图片吗?

能。Seed 2.1 Pro、Seed 2.1 Turbo、Seed Evolving 与 Seed Character 均支持图片输入。

最后更新于