> ## Documentation Index
> Fetch the complete documentation index at: https://evolink.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Seed 全模型接口 - Messages 快速开始

> - 使用 Anthropic Messages 格式调用 Seed 系列模型，可直接用于 Claude Code 等兼容 Anthropic 协议的工具
- 同步处理模式，实时返回对话内容
- 最简化参数，快速上手
- 支持模型：`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`
- **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` 不受影响
- 需要更多功能？查看 [完整参数文档](/cn/api-manual/language-series/doubao-seed-2.0/doubao-seed-2.0-messages-reference)

> [!NOTE]
>
> **BaseURL 说明**：默认 BaseURL 为 `https://direct.evolink.ai`，对文本模型支持更好，支持长连接；`https://api.evolink.ai` 是多模态主力地址，对文本模型作为备用地址使用。

> [!NOTE]
>
> **Seed 系列默认开启思考**，响应 `content` 里会先返回 `type="thinking"` 块，这部分计入 output token。因此 `max_tokens` 不宜设得过小，建议不低于 1024，否则可能思考还没结束就被截断、拿不到正文。


## OpenAPI

````yaml cn/api-manual/language-series/doubao-seed-2.0/doubao-seed-2.0-messages-quickstart.json POST /v1/messages
openapi: 3.1.0
info:
  title: Seed Messages 快速开始
  description: 快速上手 Seed 系列模型的 Messages 接口（Anthropic 兼容格式），5 分钟完成第一次对话调用
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://direct.evolink.ai
    description: 生产环境（推荐）
  - url: https://api.evolink.ai
    description: 备用地址
security:
  - bearerAuth: []
tags:
  - name: Messages
    description: Anthropic Messages 兼容接口
paths:
  /v1/messages:
    post:
      tags:
        - Messages
      summary: Seed Messages 快速对话
      description: >-
        - 使用 Anthropic Messages 格式调用 Seed 系列模型，可直接用于 Claude Code 等兼容 Anthropic
        协议的工具

        - 同步处理模式，实时返回对话内容

        - 最简化参数，快速上手

        -
        支持模型：`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`

        - **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`
        不受影响

        - 需要更多功能？查看
        [完整参数文档](/cn/api-manual/language-series/doubao-seed-2.0/doubao-seed-2.0-messages-reference)
      operationId: createMessageQuickSeed
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageQuickRequest'
      responses:
        '200':
          description: 对话生成成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
        '400':
          description: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 400
                  message: Invalid request parameters
                  type: invalid_request_error
        '401':
          description: 未认证、Token无效或过期
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 401
                  message: Invalid or expired token
                  type: authentication_error
        '402':
          description: 配额不足、需要充值
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 402
                  message: Insufficient quota
                  type: insufficient_quota_error
                  fallback_suggestion: https://evolink.ai/dashboard/credits
        '403':
          description: 无权限访问
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 403
                  message: Access denied for this model
                  type: permission_error
                  param: model
        '404':
          description: 资源不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 404
                  message: Specified model not found
                  type: not_found_error
                  param: model
                  fallback_suggestion: doubao-seed-2-1-pro
        '429':
          description: 请求频率超限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 429
                  message: Rate limit exceeded
                  type: rate_limit_error
                  fallback_suggestion: retry after 60 seconds
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 500
                  message: Internal server error
                  type: internal_server_error
                  fallback_suggestion: try again later
        '502':
          description: 模型服务暂时异常
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 502
                  message: Upstream AI service unavailable
                  type: upstream_error
                  fallback_suggestion: try different model
        '503':
          description: 服务暂时不可用
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: 503
                  message: Service temporarily unavailable
                  type: service_unavailable_error
                  fallback_suggestion: retry after 30 seconds
components:
  schemas:
    MessageQuickRequest:
      type: object
      required:
        - model
        - max_tokens
        - messages
      properties:
        model:
          type: string
          description: >-
            要调用的模型


            | 模型 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 单价最低的一档。音频输入仅限 Chat Completions
            和 Responses | 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`（点号）。
          enum:
            - 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
          default: doubao-seed-2-1-pro
          example: doubao-seed-2-1-pro
        max_tokens:
          type: integer
          minimum: 1
          example: 4096
          description: >-
            本次生成允许输出的最大 token 数，包含思考内容与正文。


            开启思考时请预留足够预算（建议不低于 1024）；预算耗尽时 `stop_reason` 为
            `max_tokens`，可能只有思考内容、没有正文
        messages:
          type: array
          minItems: 1
          description: 对话消息列表
          items:
            $ref: '#/components/schemas/MessageSimple'
          example:
            - role: user
              content: 你好，请用三句话介绍一下你自己
    MessageResponse:
      type: object
      properties:
        id:
          type: string
          description: 响应的唯一标识
          example: 0217952345678901234567890abcdef
        type:
          type: string
          enum:
            - message
          description: 对象类型，固定为 message
        role:
          type: string
          enum:
            - assistant
          description: 固定为 assistant
        model:
          type: string
          description: 本次请求使用的模型
          example: doubao-seed-2-1-pro
        content:
          type: array
          description: >-
            模型生成的内容块。开启思考时通常先返回 `thinking` 块，再返回 `text` 块；读取正文请遍历 `type="text"`
            的块
          items:
            oneOf:
              - $ref: '#/components/schemas/TextBlock'
              - $ref: '#/components/schemas/ThinkingBlock'
          example:
            - type: thinking
              thinking: 用户想要一句简短的自我介绍……
              signature: EqQBCkgIARABGAIi...
            - type: text
              text: 你好！我是 Seed 系列大语言模型，擅长推理、写作和代码。
        stop_reason:
          type: string
          description: |-
            停止原因

            - `end_turn`: 正常结束
            - `max_tokens`: 达到 max_tokens 上限
            - `stop_sequence`: 命中停止序列
            - `tool_use`: 模型请求调用函数
          enum:
            - end_turn
            - max_tokens
            - stop_sequence
            - tool_use
          example: end_turn
        stop_sequence:
          type:
            - string
            - 'null'
          description: 命中的停止序列，未命中时为 null
        usage:
          $ref: '#/components/schemas/MessageUsage'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              description: HTTP状态错误代码
            message:
              type: string
              description: 错误描述信息
            type:
              type: string
              description: 错误类型
            param:
              type: string
              description: 相关参数名称
            fallback_suggestion:
              type: string
              description: 错误时的建议
    MessageSimple:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
          description: 消息角色
        content:
          type: string
          description: 消息内容（纯文本）
    TextBlock:
      type: object
      title: 文本
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
          description: 内容块类型，固定为 text
        text:
          type: string
          description: 文本内容
    ThinkingBlock:
      type: object
      title: 思考
      required:
        - type
        - thinking
      properties:
        type:
          type: string
          enum:
            - thinking
          description: 内容块类型，固定为 thinking
        thinking:
          type: string
          description: 模型的思考内容。多轮对话时与 signature 一起原样回传
        signature:
          type: string
          description: 思考内容的签名。多轮对话时必须与 thinking 一起原样回传，保持内容块顺序不变
    MessageUsage:
      type: object
      description: Token 使用统计信息
      properties:
        input_tokens:
          type: integer
          description: 未命中缓存的输入 token 数量（不含 `cache_read_input_tokens`）
          example: 25
        cache_read_input_tokens:
          type: integer
          description: >-
            命中缓存的输入 token 数量，按缓存命中价计费。完整输入 = `input_tokens` +
            `cache_read_input_tokens`
          example: 0
        cache_creation_input_tokens:
          type: integer
          description: 固定返回 0，本接口不单独收取缓存写入费
          example: 0
        output_tokens:
          type: integer
          description: 输出 token 数量，包含思考内容
          example: 120
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        ##所有接口均需要使用Bearer Token进行认证##

        **获取 API Key：**

        访问 [API Key 管理页面](https://evolink.ai/dashboard/keys) 获取您的 API Key

        **使用时在请求头中添加：**
        ```
        Authorization: Bearer YOUR_API_KEY
        ```

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.