> ## 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 协议的工具
- **无状态接口**：多轮对话每次都要携带完整历史；带思考的 assistant 内容块需原样回传
- **多模态输入**：支持文本、图片、文档（不支持音频，Lite 的音频输入请使用 Chat Completions 或 Responses 接口）
- **深度思考**：默认开启，可通过 `thinking` 关闭或用 `output_config.effort` 调节深度
- **工具调用**：支持函数调用；Seed 2.1 与 `doubao-seed-evolving` 还支持联网搜索（`web_search_20250305`）
- **结构化输出**：通过 `output_config.format` 输出 JSON Object / JSON Schema
- **自动缓存**：重复的长前缀自动按缓存命中价计费，无需 `cache_control`，命中量以 `usage.cache_read_input_tokens` 为准
- **流式输出**：`stream=true` 时按 Anthropic SSE 事件返回：`message_start` → `content_block_start` / `content_block_delta` / `content_block_stop` → `message_delta`（含最终 usage）→ `message_stop`
- **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-quickstart)

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

> [!NOTE]
>
> **模型差异**：联网搜索（`web_search_20250305`）仅 Seed 2.1 与 `doubao-seed-evolving` 支持；本接口不支持音频输入，`doubao-seed-2-1-lite` 的音频理解请使用 [Chat Completions](https://evolink.ai/docs/cn/api-manual/language-series/doubao-seed-2.0/doubao-seed-2.0-reference.md) 或 [Responses](https://evolink.ai/docs/cn/api-manual/language-series/doubao-seed-2.0/doubao-seed-2.0-responses-reference.md) 接口。


## OpenAPI

````yaml cn/api-manual/language-series/doubao-seed-2.0/doubao-seed-2.0-messages-reference.json POST /v1/messages
openapi: 3.1.0
info:
  title: Seed Messages 完整参数
  description: Seed 系列模型 Messages 接口（Anthropic 兼容格式）的完整 API 参考
  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
        协议的工具

        - **无状态接口**：多轮对话每次都要携带完整历史；带思考的 assistant 内容块需原样回传

        - **多模态输入**：支持文本、图片、文档（不支持音频，Lite 的音频输入请使用 Chat Completions 或 Responses
        接口）

        - **深度思考**：默认开启，可通过 `thinking` 关闭或用 `output_config.effort` 调节深度

        - **工具调用**：支持函数调用；Seed 2.1 与 `doubao-seed-evolving`
        还支持联网搜索（`web_search_20250305`）

        - **结构化输出**：通过 `output_config.format` 输出 JSON Object / JSON Schema

        - **自动缓存**：重复的长前缀自动按缓存命中价计费，无需 `cache_control`，命中量以
        `usage.cache_read_input_tokens` 为准

        - **流式输出**：`stream=true` 时按 Anthropic SSE 事件返回：`message_start` →
        `content_block_start` / `content_block_delta` / `content_block_stop` →
        `message_delta`（含最终 usage）→ `message_stop`

        - **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-quickstart)
      operationId: createMessageSeed
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMessageRequest'
            examples:
              simple:
                summary: 单轮文本对话
                value:
                  model: doubao-seed-2-1-pro
                  max_tokens: 4096
                  messages:
                    - role: user
                      content: 请介绍一下你自己
              system_prompt:
                summary: 使用系统提示词
                value:
                  model: doubao-seed-2-1-pro
                  max_tokens: 4096
                  system: 你是一名严谨的中文技术编辑，用简洁的语言回答。
                  messages:
                    - role: user
                      content: 解释什么是上下文缓存。
              multi_turn:
                summary: 多轮对话（每次携带完整历史）
                value:
                  model: doubao-seed-2-1-turbo
                  max_tokens: 4096
                  messages:
                    - role: user
                      content: 记住暗号是 RED-583。
                    - role: assistant
                      content: 已记住。
                    - role: user
                      content: 暗号是什么？只回复暗号。
              streaming:
                summary: 流式输出
                value:
                  model: doubao-seed-2-1-pro
                  max_tokens: 4096
                  stream: true
                  messages:
                    - role: user
                      content: 写一首关于秋天的四行短诗。
              thinking_off:
                summary: 关闭深度思考
                value:
                  model: doubao-seed-2-1-turbo
                  max_tokens: 1024
                  thinking:
                    type: disabled
                  messages:
                    - role: user
                      content: 把这句话翻译成英文：今天的会议改到下午三点。
              effort:
                summary: 调节思考深度
                value:
                  model: doubao-seed-2-1-pro
                  max_tokens: 8192
                  output_config:
                    effort: low
                  messages:
                    - role: user
                      content: 比较快速排序和归并排序的适用场景。
              vision:
                summary: 图片理解
                value:
                  model: doubao-seed-2-1-pro
                  max_tokens: 4096
                  messages:
                    - role: user
                      content:
                        - type: image
                          source:
                            type: url
                            url: https://www.gstatic.com/webp/gallery/1.jpg
                        - type: text
                          text: 请描述这张图片中的场景和主要元素。
              tool_use:
                summary: 函数调用
                value:
                  model: doubao-seed-2-1-pro
                  max_tokens: 4096
                  messages:
                    - role: user
                      content: 查询北京今天的天气。
                  tools:
                    - name: get_weather
                      description: 查询指定城市的天气
                      input_schema:
                        type: object
                        properties:
                          city:
                            type: string
                            description: 城市名称
                        required:
                          - city
                  tool_choice:
                    type: auto
              tool_result:
                summary: 回传函数执行结果
                value:
                  model: doubao-seed-2-1-pro
                  max_tokens: 4096
                  tools:
                    - name: get_weather
                      description: 查询指定城市的天气
                      input_schema:
                        type: object
                        properties:
                          city:
                            type: string
                        required:
                          - city
                  messages:
                    - role: user
                      content: 查询北京今天的天气。
                    - role: assistant
                      content:
                        - type: thinking
                          thinking: 需要调用天气函数……
                          signature: EqQBCkgIARABGAIi...
                        - type: tool_use
                          id: call_01
                          name: get_weather
                          input:
                            city: 北京
                    - role: user
                      content:
                        - type: tool_result
                          tool_use_id: call_01
                          content: 晴，12~22℃，北风 2 级
              web_search:
                summary: 联网搜索（仅 Seed 2.1 与 Evolving）
                value:
                  model: doubao-seed-2-1-pro
                  max_tokens: 4096
                  messages:
                    - role: user
                      content: 最近一周有哪些重要的科技新闻？
                  tools:
                    - type: web_search_20250305
                      name: web_search
                      max_uses: 2
              structured_output:
                summary: 结构化输出（JSON Schema）
                value:
                  model: doubao-seed-2-1-pro
                  max_tokens: 4096
                  output_config:
                    format:
                      type: json_schema
                      schema:
                        type: object
                        properties:
                          title:
                            type: string
                          tags:
                            type: array
                            items:
                              type: string
                        required:
                          - title
                          - tags
                        additionalProperties: false
                  messages:
                    - role: user
                      content: 为一篇介绍上下文缓存的文章生成标题和 3 个标签。
      responses:
        '200':
          description: 对话生成成功；流式请求返回 Anthropic SSE 事件流
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageResponse'
            text/event-stream:
              schema:
                type: string
                description: >-
                  事件顺序通常为
                  message_start、content_block_*、message_delta、message_stop。
        '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:
    CreateMessageRequest:
      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: 消息列表。多轮对话需携带完整历史，assistant 的 thinking 块需与 signature 一起原样回传
          items:
            $ref: '#/components/schemas/Message'
        system:
          description: 系统提示词，可为字符串或 text 内容块数组
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/TextBlock'
        stream:
          type: boolean
          default: false
          description: 是否以 Anthropic SSE 事件流返回
        thinking:
          type: object
          description: 深度思考开关
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - enabled
                - disabled
              description: |-
                思考模式

                - `enabled`: 开启思考，模型先思考再回答（默认）
                - `disabled`: 关闭思考，模型直接回答

                所有 Seed 模型默认开启思考，思考 token 计入输出用量并按输出计费。
        output_config:
          type: object
          description: 输出配置：思考深度与结构化输出
          properties:
            effort:
              type: string
              enum:
                - none
                - minimal
                - low
                - medium
                - high
                - xhigh
                - max
              description: >-
                思考深度


                - `minimal`: 关闭思考，直接回答

                - `low`: 轻量思考，侧重快速响应

                - `medium`: 均衡模式，兼顾速度与深度

                - `high`: 深度分析，处理复杂问题


                **默认值**：Seed 2.1 与 `doubao-seed-evolving` 为 `high`；Seed 2.0 为
                `medium`。


                **兼容取值**：`none` 按 `minimal` 处理；`xhigh`、`max` 按 `high` 处理。
            format:
              type: object
              description: 结构化输出格式
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - json_object
                    - json_schema
                  description: |-
                    - `json_object`: 返回 JSON 对象，请在提示词中明确要求输出 JSON
                    - `json_schema`: 按 `schema` 约束返回 JSON
                schema:
                  type: object
                  additionalProperties: true
                  description: JSON Schema 定义（type 为 json_schema 时必填）
        temperature:
          type: number
          minimum: 0
          maximum: 2
          description: 采样温度，取值范围 [0, 2]。建议仅调整 temperature 或 top_p 其中之一
        top_p:
          type: number
          minimum: 0
          maximum: 1
          description: 核采样概率阈值，取值范围 [0, 1]
        stop_sequences:
          type: array
          items:
            type: string
          maxItems: 4
          description: |-
            停止序列，模型生成到这些字符串时停止，字符串本身不会输出。最多 4 个。

            开启思考时不支持此参数，需要时请先关闭思考
        tools:
          type: array
          description: >-
            工具列表


            - 自定义函数：`name` + `description` + `input_schema`，所有 Seed 模型支持

            - 联网搜索：`type=web_search_20250305`、`name=web_search`，仅 Seed 2.1 与
            `doubao-seed-evolving` 支持；`doubao-seed-2.0-mini` 声明联网搜索会返回 400


            不支持网页抓取（`web_fetch`）等其它服务端工具，传入会返回 400。联网搜索按实际搜索次数计费，以模型定价为准
          items:
            oneOf:
              - $ref: '#/components/schemas/Tool'
              - $ref: '#/components/schemas/WebSearchTool'
        tool_choice:
          $ref: '#/components/schemas/ToolChoice'
    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'
              - $ref: '#/components/schemas/ToolUseBlock'
              - $ref: '#/components/schemas/ServerToolUseBlock'
              - $ref: '#/components/schemas/WebSearchResultBlock'
          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: 错误时的建议
    Message:
      type: object
      required:
        - role
        - content
      properties:
        role:
          type: string
          enum:
            - user
            - assistant
          description: 消息角色。系统提示词请使用顶层 `system`
        content:
          description: 消息内容，可以是纯文本字符串或内容块数组
          oneOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/ContentBlock'
    TextBlock:
      type: object
      title: 文本
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
          description: 内容块类型，固定为 text
        text:
          type: string
          description: 文本内容
    Tool:
      type: object
      title: 自定义函数
      required:
        - name
        - input_schema
      properties:
        name:
          type: string
          description: 函数名称
        description:
          type: string
          description: 函数用途说明，帮助模型判断何时调用
        input_schema:
          type: object
          additionalProperties: true
          description: JSON Schema 格式的函数参数定义
    WebSearchTool:
      type: object
      title: 联网搜索（仅 Seed 2.1 与 Evolving）
      required:
        - type
        - name
      properties:
        type:
          type: string
          enum:
            - web_search_20250305
          description: 固定为 web_search_20250305
        name:
          type: string
          enum:
            - web_search
          description: 固定为 web_search
        max_uses:
          type: integer
          minimum: 1
          description: 本次请求最多执行的搜索次数
        allowed_domains:
          type: array
          items:
            type: string
          description: 只搜索这些域名
        blocked_domains:
          type: array
          items:
            type: string
          description: 不搜索这些域名
        user_location:
          type: object
          additionalProperties: true
          description: 搜索时参考的地理位置，如国家、地区、城市
    ToolChoice:
      type: object
      required:
        - type
      description: 工具选择策略，配置 tools 后再设置
      properties:
        type:
          type: string
          enum:
            - auto
            - any
            - tool
            - none
          default: auto
          description: |-
            - `auto`: 由模型决定是否调用
            - `any`: 必须调用任一工具
            - `tool`: 必须调用 `name` 指定的工具
            - `none`: 不调用工具
        name:
          type: string
          description: type 为 tool 时，指定要调用的工具名称
        disable_parallel_tool_use:
          type: boolean
          default: false
          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 一起原样回传，保持内容块顺序不变
    ToolUseBlock:
      type: object
      title: 工具调用
      required:
        - type
        - id
        - name
        - input
      properties:
        type:
          type: string
          enum:
            - tool_use
          description: 内容块类型，固定为 tool_use
        id:
          type: string
          description: 工具调用 ID，返回工具结果时通过 tool_use_id 关联
        name:
          type: string
          description: 模型请求调用的函数名称
        input:
          type: object
          additionalProperties: true
          description: 模型为函数生成的参数对象
    ServerToolUseBlock:
      type: object
      title: 联网搜索调用
      properties:
        type:
          type: string
          enum:
            - server_tool_use
          description: 内容块类型，固定为 server_tool_use
        id:
          type: string
          description: 服务端工具调用 ID
        name:
          type: string
          description: 工具名称，联网搜索为 web_search
        input:
          type: object
          additionalProperties: true
          description: 模型生成的搜索参数，如 query
    WebSearchResultBlock:
      type: object
      title: 联网搜索结果
      properties:
        type:
          type: string
          enum:
            - web_search_tool_result
          description: 内容块类型，固定为 web_search_tool_result
        tool_use_id:
          type: string
          description: 对应的 server_tool_use ID
        content:
          description: >-
            搜索结果列表，或搜索失败时的错误对象（`type=web_search_tool_result_error`，含
            `error_code`）
          oneOf:
            - type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - web_search_result
                  title:
                    type: string
                    description: 结果标题
                  url:
                    type: string
                    description: 结果 URL
                  page_age:
                    type: string
                    description: 页面时效
                  encrypted_content:
                    type: string
                    description: 加密内容，多轮对话时原样回传
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - web_search_tool_result_error
                error_code:
                  type: string
                  description: 错误码
    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
        server_tool_use:
          type: object
          description: 服务端工具的实际调用次数（使用联网搜索时返回）
          properties:
            web_search_requests:
              type: integer
              description: 本次请求实际执行的联网搜索次数，按次计费
              example: 1
    ContentBlock:
      description: 内容块：文本、图片、文档、思考、函数调用、函数结果，以及联网搜索的调用与结果（多轮对话回传用）
      oneOf:
        - $ref: '#/components/schemas/TextBlock'
        - $ref: '#/components/schemas/ImageBlock'
        - $ref: '#/components/schemas/DocumentBlock'
        - $ref: '#/components/schemas/ThinkingBlock'
        - $ref: '#/components/schemas/ToolUseBlock'
        - $ref: '#/components/schemas/ToolResultBlock'
        - $ref: '#/components/schemas/ServerToolUseBlock'
        - $ref: '#/components/schemas/WebSearchResultBlock'
    ImageBlock:
      type: object
      title: 图片
      required:
        - type
        - source
      properties:
        type:
          type: string
          enum:
            - image
          description: 内容块类型，固定为 image
        source:
          type: object
          required:
            - type
          description: 图片来源
          properties:
            type:
              type: string
              enum:
                - url
                - base64
              description: |-
                - `url`: 公网可访问的图片 URL
                - `base64`: Base64 编码的图片数据
            url:
              type: string
              description: 图片 URL（type 为 url 时必填）
            media_type:
              type: string
              enum:
                - image/jpeg
                - image/png
                - image/gif
                - image/webp
              description: 图片 MIME 类型（type 为 base64 时必填）
            data:
              type: string
              description: 图片 Base64 数据，不含 `data:` 前缀（type 为 base64 时必填）
    DocumentBlock:
      type: object
      title: 文档
      required:
        - type
        - source
      properties:
        type:
          type: string
          enum:
            - document
          description: 内容块类型，固定为 document
        source:
          type: object
          required:
            - type
          description: 文档来源
          properties:
            type:
              type: string
              enum:
                - url
                - base64
                - text
              description: |-
                - `url`: 公网可访问的文档 URL
                - `base64`: Base64 编码的文档数据
                - `text`: 纯文本文档
            url:
              type: string
              description: 文档 URL（type 为 url 时必填）
            media_type:
              type: string
              description: 文档 MIME 类型，如 `application/pdf`、`text/plain`
            data:
              type: string
              description: 文档数据（type 为 base64 或 text 时必填）
    ToolResultBlock:
      type: object
      title: 函数结果
      required:
        - type
        - tool_use_id
        - content
      properties:
        type:
          type: string
          enum:
            - tool_result
          description: 内容块类型，固定为 tool_result
        tool_use_id:
          type: string
          description: 对应的 tool_use 内容块 ID
        content:
          description: 函数执行结果，可为字符串或文本、图片内容块数组
          oneOf:
            - type: string
            - type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/TextBlock'
                  - $ref: '#/components/schemas/ImageBlock'
        is_error:
          type: boolean
          default: false
          description: 函数执行是否失败
  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.