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

# 创建消息

> 发送包含文本和/或图片内容的结构化输入消息列表，模型将生成对话中的下一条消息。

Messages API 既可用于单次查询，也可用于无状态的多轮对话。

详见[用户指南](https://platform.claude.com/docs/en/get-started)中关于 Messages API 的介绍



## OpenAPI

````yaml /openapi/zh/anthropic-messages.json post /v1/messages
openapi: 3.1.0
info:
  title: Anthropic Messages
  version: v1
  description: 用 Anthropic Messages 协议调用 Claude 模型：对话、流式输出、图片理解、工具调用、自适应思考和提示缓存。
servers:
  - url: https://api.dreamto.ai
security:
  - apiKeyAuth: []
  - bearerAuth: []
tags:
  - name: Messages
paths:
  /v1/messages:
    post:
      tags:
        - Messages
      summary: 创建消息
      description: >-
        发送包含文本和/或图片内容的结构化输入消息列表，模型将生成对话中的下一条消息。


        Messages API 既可用于单次查询，也可用于无状态的多轮对话。


        详见[用户指南](https://platform.claude.com/docs/en/get-started)中关于 Messages
        API 的介绍
      operationId: createMessage
      parameters:
        - name: anthropic-version
          in: header
          required: false
          description: >-
            要使用的 Claude API 版本。


            关于版本控制及版本历史，请参阅[此处](https://platform.claude.com/docs/en/api/versioning)。
          schema:
            type: string
          example: '2023-06-01'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMessageRequest'
            examples:
              基础对话:
                summary: 基础对话
                description: '`max_tokens` 必填，表示最多生成多少 Token。'
                value:
                  model: claude-sonnet-5-5
                  max_tokens: 1024
                  messages:
                    - role: user
                      content: 用三句话介绍一下量子计算。
              系统提示与多轮对话:
                summary: 系统提示与多轮对话
                description: 系统提示放在顶层的 `system`，`messages` 里 `user` 与 `assistant` 交替。
                value:
                  model: claude-sonnet-5-5
                  max_tokens: 1024
                  system: 你是一个简洁、专业的助手。
                  messages:
                    - role: user
                      content: 帮我想一个咖啡店的名字。
                    - role: assistant
                      content: 「晨光咖啡」怎么样？
                    - role: user
                      content: 再给这个名字配一句标语。
              流式输出:
                summary: 流式输出
                description: >-
                  `stream: true` 时返回 SSE
                  事件：`message_start`、`content_block_delta` … `message_stop`。
                value:
                  model: claude-sonnet-5-5
                  max_tokens: 1024
                  stream: true
                  messages:
                    - role: user
                      content: 写一首关于秋天的四行诗。
              图片理解:
                summary: 图片理解
                description: 用 `image` 内容块传入图片，`source` 可以是 URL 或 Base64。
                value:
                  model: claude-sonnet-5-5
                  max_tokens: 1024
                  messages:
                    - role: user
                      content:
                        - type: image
                          source:
                            type: url
                            url: https://your-cdn.example.com/photo.jpg
                        - type: text
                          text: 这张图片里有什么？
              工具调用:
                summary: 工具调用
                description: >-
                  模型需要外部数据时返回 `tool_use` 内容块（`stop_reason` 为 `tool_use`）；执行后用
                  `tool_result` 内容块把结果传回。
                value:
                  model: claude-sonnet-5-5
                  max_tokens: 1024
                  tools:
                    - name: get_weather
                      description: 查询指定城市的实时天气
                      input_schema:
                        type: object
                        properties:
                          city:
                            type: string
                            description: 城市名，例如：杭州
                          unit:
                            type: string
                            enum:
                              - celsius
                              - fahrenheit
                        required:
                          - city
                  messages:
                    - role: user
                      content: 杭州今天天气怎么样？
              自适应思考:
                summary: 自适应思考
                description: >-
                  `thinking.type: adaptive` 让模型自己决定思考多少，`output_config.effort`
                  调节投入程度。
                value:
                  model: claude-opus-5-5
                  max_tokens: 4096
                  thinking:
                    type: adaptive
                  output_config:
                    effort: high
                  messages:
                    - role: user
                      content: 证明：任意五个整数中，必有三个数之和能被 3 整除。
      responses:
        '200':
          description: >-
            非流式请求返回 Message 对象；`stream` 为 `true` 时返回 SSE
            事件流（`text/event-stream`），每个事件都是一个 `RawMessageStreamEvent`。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
            text/event-stream:
              schema:
                $ref: '#/components/schemas/RawMessageStreamEvent'
        '400':
          description: 请求无效：JSON 格式错误、缺少必填字段，或参数不被所选模型支持。按 `message` 修改后重试。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: invalid_request
                      http_status: 400
                      message: Invalid request.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: invalid_request_error
        '401':
          description: API Key 缺失或无效。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: unauthorized
                      http_status: 401
                      message: Unauthorized.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: authentication_error
        '402':
          description: 账户余额不足，充值后重试。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: insufficient_balance
                      http_status: 402
                      message: Insufficient balance.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: insufficient_balance_error
        '403':
          description: 当前 API Key 无权使用该模型。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: forbidden
                      http_status: 403
                      message: Access denied.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: permission_error
        '404':
          description: 模型不存在或尚未开放。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: not_found
                      http_status: 404
                      message: The requested model was not found.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: invalid_request_error
        '429':
          description: 请求频率超过限制，退避后重试。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: rate_limit_exceeded
                      http_status: 429
                      message: Rate limit exceeded. Please try again later.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: rate_limit_error
        '500':
          description: 服务内部错误，稍后重试。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: api_error
                      http_status: 500
                      message: Internal server error.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: api_error
        '503':
          description: 服务暂时不可用或处理超时，稍后重试。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
              examples:
                example:
                  value:
                    error:
                      code: service_unavailable
                      http_status: 503
                      message: Service temporarily unavailable. Please try again later.
                      request_id: req_3f9a1c2b7d4e5f60718293a4
                      type: api_error
components:
  schemas:
    CreateMessageRequest:
      type: object
      properties:
        max_tokens:
          type: number
          description: >-
            停止前最多生成的 Token 数。


            注意，模型可能会在达到该上限_之前_停止。此参数仅指定生成 Token 数的绝对上限。


            设为 `0`
            可在不生成响应的情况下填充[提示缓存](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#pre-warming-the-cache)。


            不同模型对此参数的最大值不同，详见[模型](https://platform.claude.com/docs/en/about-claude/models/overview)。
          minimum: 0
        messages:
          type: array
          items:
            $ref: '#/components/schemas/MessageParam'
          description: >-
            输入消息。


            我们的模型经过训练，可处理 `user` 与 `assistant` 交替进行的对话轮次。创建新的 `Message` 时，通过
            `messages` 参数指定之前的对话轮次，模型随后生成对话中的下一条 `Message`。请求中连续的 `user` 或
            `assistant` 轮次会被合并为单个轮次。


            每条输入消息都必须是包含 `role` 和 `content` 的对象。你可以只指定一条 `user` 角色的消息，也可以包含多条
            `user` 和 `assistant` 消息。


            如果最后一条消息使用 `assistant`
            角色，响应内容将紧接着该消息的内容继续生成。这可用于约束模型的部分响应，称为预填充（prefill）。在不支持预填充的模型上，创建以不完整
            `assistant` 响应结尾的消息会返回 400
            错误。参见[不支持预填充](https://platform.claude.com/docs/en/api/errors#prefill-not-supported)。


            单条 `user` 消息示例：


            ```json

            [{"role": "user", "content": "Hello, Claude"}]

            ```


            多轮对话示例：


            ```json

            [
              {"role": "user", "content": "Hello there."},
              {"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},
              {"role": "user", "content": "Can you explain LLMs in plain English?"},
            ]

            ```


            对于支持预填充的模型，包含 Claude 部分预填充响应的示例：


            ```json

            [
              {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
              {"role": "assistant", "content": "The best answer is ("},
            ]

            ```


            每条输入消息的 `content` 可以是单个 `string`，也可以是内容块数组，每个块都有特定的 `type`。`content`
            使用 `string` 是包含单个 `"text"` 类型内容块的数组的简写。以下输入消息是等价的：


            ```json

            {"role": "user", "content": "Hello, Claude"}

            ```


            ```json

            {"role": "user", "content": [{"type": "text", "text": "Hello,
            Claude"}]}

            ```


            参见[输入示例](https://platform.claude.com/docs/en/build-with-claude/working-with-messages)。


            注意，如果要包含[系统提示词](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role)，可以使用顶层的
            `system` 参数。


            单个请求最多包含 100,000 条消息。
        model:
          type: string
          description: >-
            要使用的模型 ID，例如
            `claude-sonnet-5-5`。可用模型见[模型介绍](/llm/anthropic-messages)。
          example: claude-sonnet-5-5
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 顶层缓存控制会自动为请求中最后一个可缓存块添加 cache_control 标记。
        container:
          anyOf:
            - $ref: '#/components/schemas/MessageCreateParamsContainer'
            - type: 'null'
          description: 用于跨请求复用的容器标识符。
        diagnostics:
          anyOf:
            - $ref: '#/components/schemas/DiagnosticsParam'
            - type: 'null'
          description: >-
            请求级诊断。提供 `previous_message_id` 后，响应中将包含
            `diagnostics.cache_miss_reason`，用于说明与该先前请求相比提示缓存出现差异的原因。
        inference_geo:
          anyOf:
            - type: string
            - type: 'null'
          description: 指定推理处理的地理区域。未指定时使用工作区的 `default_inference_geo`。
        metadata:
          allOf:
            - $ref: '#/components/schemas/Metadata'
          description: 描述请求元数据的对象。
        output_config:
          allOf:
            - $ref: '#/components/schemas/OutputConfig'
          description: 模型输出的配置选项，例如输出格式。
        service_tier:
          type: string
          enum:
            - auto
            - standard_only
          description: >-
            决定本次请求使用优先容量（如可用）还是标准容量。


            Anthropic 为 API
            请求提供不同级别的服务，详见[服务层级](https://platform.claude.com/docs/en/api/service-tiers)。
        speed:
          anyOf:
            - type: string
              enum:
                - standard
                - fast
            - type: 'null'
          description: >-
            本次请求的推理速度模式。`"fast"` 启用高每秒输出 Token 数的推理。


            部分模型对任何 `speed` 值都需要 `fast-mode-2026-02-01` beta
            请求头。适用的模型请参阅[快速模式](https://platform.claude.com/docs/en/build-with-claude/fast-mode)。
        stop_sequences:
          type: array
          items:
            type: string
          description: >-
            使模型停止生成的自定义文本序列。


            模型通常会在自然完成其轮次时停止，此时响应的 `stop_reason` 为 `"end_turn"`。


            如果希望模型在遇到自定义文本字符串时停止生成，可以使用 `stop_sequences` 参数。如果模型遇到其中某个自定义序列，响应的
            `stop_reason` 值将为 `"stop_sequence"`，响应的 `stop_sequence`
            值将包含匹配到的停止序列。
        stream:
          type: boolean
          description: >-
            是否使用服务器发送事件（SSE）以增量方式流式返回响应。为 `true` 时，SDK 返回原始事件流。


            在 TypeScript、Python 和 Ruby SDK 中，推荐使用 `messages.stream()`
            进行流式传输。它会自动设置 `stream`，并将事件累积为最终消息。各语言示例请参阅[使用 SDK
            进行流式传输](https://platform.claude.com/docs/en/build-with-claude/streaming#streaming-with-sdks)。
        system:
          anyOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/TextBlockParam'
          description: >-
            系统提示词。


            系统提示词用于向 Claude
            提供上下文和指令，例如指定特定目标或角色。参见[系统提示词指南](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices#give-claude-a-role)。
        thinking:
          allOf:
            - $ref: '#/components/schemas/ThinkingConfigParam'
          description: >-
            Claude 思考的配置。


            使用 `{"type": "adaptive"}` 时，由 Claude 决定何时思考以及思考多少。使用 `{"type":
            "enabled"}`（手动扩展思考）时，需要设置至少 1,024 的 `budget_tokens`。思考 Token 计入
            `max_tokens` 限制。


            可接受哪些 `type` 值，以及省略 `thinking`
            时的行为，均取决于模型。各模型的行为请参阅[思考](https://platform.claude.com/docs/en/build-with-claude/thinking#configuring-thinking)。
        tool_choice:
          allOf:
            - $ref: '#/components/schemas/ToolChoice'
          description: 模型应如何使用所提供的工具。模型可以使用指定工具、使用任一可用工具、自行决定，或完全不使用工具。
        tools:
          type: array
          items:
            $ref: '#/components/schemas/ToolUnion'
          description: >-
            模型可使用的工具定义。


            如果在 API 请求中包含 `tools`，模型可能会返回 `tool_use`
            内容块，表示模型对这些工具的使用。你可以使用模型生成的工具输入运行这些工具，然后可选地通过 `tool_result`
            内容块将结果返回给模型。


            工具分为两类：**客户端工具**和**服务端工具**。下文描述的行为适用于客户端工具。对于[服务端工具](https://platform.claude.com/docs/en/agents-and-tools/tool-use/server-tools)，请参阅各自的文档，因为每种工具都有自己的行为（例如[网页搜索工具](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool)）。


            每个工具定义包括：


            * `name`：工具名称。

            * `description`：工具描述，可选但强烈建议提供。

            * `input_schema`：工具 `input` 结构的 [JSON
            Schema](https://json-schema.org/draft/2020-12)，模型会在 `tool_use`
            输出内容块中按此结构生成输入。


            例如，如果你将 `tools` 定义为：


            ```json

            [
              {
                "name": "get_stock_price",
                "description": "Get the current stock price for a given ticker symbol.",
                "input_schema": {
                  "type": "object",
                  "properties": {
                    "ticker": {
                      "type": "string",
                      "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
                    }
                  },
                  "required": ["ticker"]
                }
              }
            ]

            ```


            然后询问模型“What's the S&P 500 at today?”，模型可能会在响应中生成如下 `tool_use` 内容块：


            ```json

            [
              {
                "type": "tool_use",
                "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
                "name": "get_stock_price",
                "input": { "ticker": "^GSPC" }
              }
            ]

            ```


            然后你可以以 `{"ticker": "^GSPC"}` 作为输入运行 `get_stock_price` 工具，并在随后的
            `user` 消息中将以下内容返回给模型：


            ```json

            [
              {
                "type": "tool_result",
                "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV",
                "content": "259.75 USD"
              }
            ]

            ```


            工具可用于包含运行客户端工具和函数的工作流，更广泛地说，也可用于任何需要模型输出特定 JSON 结构的场景。


            更多详情请参阅[指南](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview)。
      required:
        - max_tokens
        - messages
        - model
    Message:
      type: object
      properties:
        type:
          type: string
          const: message
          description: |-
            对象类型。

            对于消息，始终为 `"message"`。
        id:
          type: string
          description: |-
            对象的唯一标识符。

            ID 的格式和长度可能会随时间变化。
        container:
          anyOf:
            - $ref: '#/components/schemas/Container'
            - type: 'null'
          description: |-
            本次请求所使用容器的信息。

            如果使用了容器工具（例如代码执行），该值不为 null。
        content:
          type: array
          items:
            $ref: '#/components/schemas/ContentBlock'
          description: >-
            模型生成的内容。


            这是一个内容块数组，每个块都有一个决定其结构的 `type`。


            示例：


            ```json

            [{"type": "text", "text": "Hi, I'm Claude."}]

            ```


            如果请求输入的 `messages` 以 `assistant` 轮次结尾，响应的 `content`
            将直接从最后一个轮次继续。你可以借此约束模型的输出。


            例如，如果输入的 `messages` 为：


            ```json

            [
              {"role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun"},
              {"role": "assistant", "content": "The best answer is ("}
            ]

            ```


            则响应的 `content` 可能为：


            ```json

            [{"type": "text", "text": "B)"}]

            ```
        diagnostics:
          anyOf:
            - $ref: '#/components/schemas/Diagnostics'
            - type: 'null'
          description: 请求级诊断。当请求未提供 `diagnostics`，或提供了但未检测到提示缓存差异时为 `null`。
        model:
          allOf:
            - $ref: '#/components/schemas/Model'
          description: |-
            用于补全提示词的模型。

            更多详情和可选项请参阅[模型](https://docs.anthropic.com/en/docs/models-overview)。
        role:
          type: string
          const: assistant
          description: |-
            所生成消息的对话角色。

            始终为 `"assistant"`。
        stop_details:
          anyOf:
            - $ref: '#/components/schemas/RefusalStopDetails'
            - type: 'null'
          description: |-
            关于模型输出为何停止的结构化信息。

            当 `stop_reason` 没有额外细节需要报告时为 `null`。
        stop_reason:
          anyOf:
            - $ref: '#/components/schemas/StopReason'
            - type: 'null'
          description: >-
            停止的原因。


            可能为以下值之一：


            * `"end_turn"`：模型到达自然停止点

            * `"max_tokens"`：超出了请求的 `max_tokens` 或模型的最大值

            * `"stop_sequence"`：生成了你提供的某个自定义 `stop_sequences`

            * `"tool_use"`：模型调用了一个或多个工具

            * `"pause_turn"`：暂停了一个长时间运行的轮次。你可以在后续请求中原样回传该响应，让模型继续。

            * `"refusal"`：流式分类器介入以处理潜在的策略违规

            * `"model_context_window_exceeded"`：超出了模型的上下文窗口


            在非流式模式下，该值始终不为 null。在流式模式下，该值在 `message_start` 事件中为 null，其他情况下不为
            null。
        stop_sequence:
          anyOf:
            - type: string
            - type: 'null'
          description: |-
            生成了哪个自定义停止序列（如有）。

            如果生成了你的某个自定义停止序列，该值将为非 null 字符串。
        usage:
          allOf:
            - $ref: '#/components/schemas/Usage'
          description: >-
            计费和速率限制用量。


            Anthropic 的 API 按 Token 数计费并实施速率限制，因为 Token 代表了我们系统的底层成本。


            在底层，API 会将请求转换为适合模型的格式，模型的输出随后经过解析阶段才成为 API 响应。因此，`usage` 中的 Token
            数不会与 API 请求或响应中可见的内容一一对应。


            例如，即使 Claude 返回空字符串响应，`output_tokens` 也不为零。


            请求的输入 Token 总数为 `input_tokens`、`cache_creation_input_tokens` 和
            `cache_read_input_tokens` 之和。
      required:
        - type
        - id
        - container
        - content
        - diagnostics
        - model
        - role
        - stop_details
        - stop_reason
        - stop_sequence
        - usage
    RawMessageStreamEvent:
      anyOf:
        - $ref: '#/components/schemas/RawMessageStartEvent'
        - $ref: '#/components/schemas/RawMessageDeltaEvent'
        - $ref: '#/components/schemas/RawMessageStopEvent'
        - $ref: '#/components/schemas/RawContentBlockStartEvent'
        - $ref: '#/components/schemas/RawContentBlockDeltaEvent'
        - $ref: '#/components/schemas/RawContentBlockStopEvent'
    GatewayError:
      type: object
      description: 错误响应。
      properties:
        error:
          type: object
          description: 错误信息。
          properties:
            code:
              type: string
              description: >-
                错误码，例如
                `invalid_request`、`unauthorized`、`insufficient_balance`、`rate_limit_exceeded`。个别由模型侧直接返回的参数错误里，这里是数字形式的状态码。
            http_status:
              type: integer
              description: 与响应的 HTTP 状态码相同；个别由模型侧直接返回的错误不带这个字段。
            message:
              type: string
              description: 错误描述（英文）。程序逻辑请依据状态码和 `code` 判断，不要依赖这段文字。
            request_id:
              type: string
              description: 本次请求的 ID，与响应头 `X-Request-Id` 相同，反馈问题时请提供；个别错误不带这个字段，请以响应头为准。
            type:
              type: string
              description: >-
                错误大类，例如
                `invalid_request_error`、`authentication_error`、`rate_limit_error`、`api_error`；个别错误不带这个字段。
          required:
            - code
            - message
      required:
        - error
    MessageParam:
      anyOf:
        - $ref: '#/components/schemas/UserMessageParam'
        - $ref: '#/components/schemas/AssistantMessageParam'
        - $ref: '#/components/schemas/SystemMessageParam'
    CacheControlEphemeral:
      type: object
      properties:
        type:
          type: string
          const: ephemeral
        ttl:
          type: string
          enum:
            - 5m
            - 1h
          description: >-
            缓存控制断点的存活时间（TTL）。


            可选值如下：


            - `5m`：5 分钟

            - `1h`：1 小时


            默认为
            `5m`。详见[提示缓存定价](https://platform.claude.com/docs/en/build-with-claude/prompt-caching)。
      required:
        - type
    MessageCreateParamsContainer:
      anyOf:
        - $ref: '#/components/schemas/ContainerParams'
        - type: string
    DiagnosticsParam:
      type: object
      properties:
        previous_message_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            该客户端上一次 /v1/messages 响应中的
            `id`（`msg_...`）。服务端会将该请求的提示词指纹与本次请求进行比较，并在提示缓存前缀无法复用时返回
            `diagnostics.cache_miss_reason`。首轮请求可传入 `null`，以便在没有可比较的先前消息时启用该功能。
          maxLength: 256
    Metadata:
      type: object
      properties:
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            与请求关联的用户的外部标识符。


            应为 UUID、哈希值或其他不透明标识符。Anthropic 可能使用此 ID
            帮助检测滥用行为。请勿包含任何身份信息，例如姓名、电子邮件地址或电话号码。
          maxLength: 512
    OutputConfig:
      type: object
      properties:
        effort:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
                - xhigh
                - max
            - type: 'null'
          description: |-
            模型在生成响应时应投入的努力程度。较高的努力程度可能带来更深入的分析，但耗时更长。

            有效值为 `low`、`medium`、`high`、`xhigh`、`max`。
        format:
          anyOf:
            - $ref: '#/components/schemas/JSONOutputFormat'
            - type: 'null'
          description: >-
            用于指定 Claude 响应输出格式的
            Schema。参见[结构化输出](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
    TextBlockParam:
      type: object
      properties:
        type:
          type: string
          const: text
        text:
          type: string
          minLength: 1
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        citations:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/TextCitationParam'
            - type: 'null'
      required:
        - type
        - text
    ThinkingConfigParam:
      anyOf:
        - $ref: '#/components/schemas/ThinkingConfigEnabled'
        - $ref: '#/components/schemas/ThinkingConfigDisabled'
        - $ref: '#/components/schemas/ThinkingConfigBetweenTools'
        - $ref: '#/components/schemas/ThinkingConfigAdaptive'
    ToolChoice:
      anyOf:
        - $ref: '#/components/schemas/ToolChoiceAuto'
        - $ref: '#/components/schemas/ToolChoiceAny'
        - $ref: '#/components/schemas/ToolChoiceTool'
        - $ref: '#/components/schemas/ToolChoiceNone'
    ToolUnion:
      anyOf:
        - $ref: '#/components/schemas/Tool'
        - $ref: '#/components/schemas/ToolBash20250124'
        - $ref: '#/components/schemas/CodeExecutionTool20250522'
        - $ref: '#/components/schemas/CodeExecutionTool20250825'
        - $ref: '#/components/schemas/CodeExecutionTool20260120'
        - $ref: '#/components/schemas/CodeExecutionTool20260521'
        - $ref: '#/components/schemas/BrowserToolset20260801'
        - $ref: '#/components/schemas/MemoryTool20250818'
        - $ref: '#/components/schemas/ComputerToolset20260801'
        - $ref: '#/components/schemas/ToolTextEditor20250124'
        - $ref: '#/components/schemas/ToolTextEditor20250429'
        - $ref: '#/components/schemas/ToolTextEditor20250728'
        - $ref: '#/components/schemas/WebSearchTool20250305'
        - $ref: '#/components/schemas/WebFetchTool20250910'
        - $ref: '#/components/schemas/WebSearchTool20260209'
        - $ref: '#/components/schemas/WebFetchTool20260209'
        - $ref: '#/components/schemas/WebFetchTool20260309'
        - $ref: '#/components/schemas/WebSearchTool20260318'
        - $ref: '#/components/schemas/WebFetchTool20260318'
        - $ref: '#/components/schemas/ToolSearchToolBm25_20251119'
        - $ref: '#/components/schemas/ToolSearchToolRegex20251119'
    Container:
      type: object
      properties:
        id:
          type: string
          description: 本次请求所使用容器的标识符
        expires_at:
          type: string
          description: 容器的过期时间。
          format: date-time
        skills:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/ContainerSkill'
            - type: 'null'
          description: 容器中已加载的技能
      required:
        - id
        - expires_at
        - skills
    ContentBlock:
      anyOf:
        - $ref: '#/components/schemas/TextBlock'
        - $ref: '#/components/schemas/ThinkingBlock'
        - $ref: '#/components/schemas/RedactedThinkingBlock'
        - $ref: '#/components/schemas/ToolUseBlock'
        - $ref: '#/components/schemas/ServerToolUseBlock'
        - $ref: '#/components/schemas/WebSearchToolResultBlock'
        - $ref: '#/components/schemas/WebFetchToolResultBlock'
        - $ref: '#/components/schemas/CodeExecutionToolResultBlock'
        - $ref: '#/components/schemas/BashCodeExecutionToolResultBlock'
        - $ref: '#/components/schemas/TextEditorCodeExecutionToolResultBlock'
        - $ref: '#/components/schemas/ToolSearchToolResultBlock'
        - $ref: '#/components/schemas/ContainerUploadBlock'
    Diagnostics:
      type: object
      properties:
        cache_miss_reason:
          anyOf:
            - $ref: '#/components/schemas/CacheMissReason'
            - type: 'null'
          description: >-
            解释提示缓存为何无法完全复用 `diagnostics.previous_message_id` 所标识请求的前缀。`null`
            表示诊断仍在进行中——响应在后台比较完成之前就已序列化。
      required:
        - cache_miss_reason
    Model:
      anyOf:
        - type: string
          const: claude-fable-5-2
          description: 专为编程、企业工作流和科学领域中最具挑战性的工作打造
        - type: string
          const: claude-haiku-5-5
          description: 适用于高吞吐、实时任务的最快模型
        - type: string
          const: claude-sonnet-5-5
          description: 适用于编程和智能体的高效模型
        - type: string
          const: claude-opus-5-5
          description: 强大的智能，适用于编程、知识工作和长时间运行的智能体
        - type: string
    RefusalStopDetails:
      type: object
      properties:
        type:
          type: string
          const: refusal
        category:
          anyOf:
            - type: string
              enum:
                - cyber
                - bio
                - frontier_llm
                - reasoning_extraction
                - general_harms
              description: >-
                **可选值：**

                - `cyber`：该请求可能助长网络危害，例如开发恶意软件或漏洞利用。正当的网络安全工作也可能触发此类别。

                - `bio`：该请求可能助长生物危害，例如危险的实验室方法。有益的生命科学工作也可能触发此类别。

                - `frontier_llm`：该请求可能协助开发竞争性 AI 模型，这受到 [Anthropic
                商业条款](https://www.anthropic.com/legal/commercial-terms)的限制。正当的机器学习工作也可能触发此类别。

                -
                `reasoning_extraction`：该请求要求模型在响应文本中复现其内部推理。如需以结构化形式获取推理内容，请改用[自适应思考](https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking)。

                - `general_harms`：该请求可能与已被认定为有害的领域相关。正当工作有时也可能触发此类别。
            - type: 'null'
          description: |-
            触发拒绝的策略类别。

            当拒绝无法对应到具名类别时为 `null`。
        explanation:
          anyOf:
            - type: string
            - type: 'null'
          description: |-
            拒绝的人类可读说明。

            该文本不保证稳定。当该类别没有可用说明时为 `null`。
      required:
        - type
        - category
        - explanation
    StopReason:
      type: string
      enum:
        - end_turn
        - max_tokens
        - stop_sequence
        - tool_use
        - pause_turn
        - refusal
        - model_context_window_exceeded
    Usage:
      type: object
      properties:
        cache_creation:
          anyOf:
            - $ref: '#/components/schemas/CacheCreation'
            - type: 'null'
          description: 按 TTL 划分的缓存 Token 明细
        cache_creation_input_tokens:
          anyOf:
            - type: number
            - type: 'null'
          description: 用于创建缓存条目的输入 Token 数。
          minimum: 0
        cache_read_input_tokens:
          anyOf:
            - type: number
            - type: 'null'
          description: 从缓存中读取的输入 Token 数。
          minimum: 0
        inference_geo:
          anyOf:
            - type: string
            - type: 'null'
          description: 本次请求执行推理的地理区域。
        input_tokens:
          type: number
          description: 使用的输入 Token 数。
          minimum: 0
        output_tokens:
          type: number
          description: 使用的输出 Token 数。
          minimum: 0
        output_tokens_details:
          anyOf:
            - $ref: '#/components/schemas/OutputTokensDetails'
            - type: 'null'
          description: >-
            按类别划分的输出 Token 明细。


            `output_tokens` 仍是用于计费的、包含全部类别的权威总数。该对象提供只读的分解数据，用于可观测性——例如，计费的输出
            Token 中有多少用于内部推理（这些推理在返回给你之前可能已被摘要）。
        server_tool_use:
          anyOf:
            - $ref: '#/components/schemas/ServerToolUsage'
            - type: 'null'
          description: 服务端工具请求次数。
        service_tier:
          anyOf:
            - type: string
              enum:
                - standard
                - priority
                - batch
            - type: 'null'
          description: 请求使用的是 priority、standard 还是 batch 层级。
        speed:
          anyOf:
            - type: string
              enum:
                - standard
                - fast
            - type: 'null'
          description: 本次请求使用的推理速度模式。
      required:
        - cache_creation
        - cache_creation_input_tokens
        - cache_read_input_tokens
        - inference_geo
        - input_tokens
        - output_tokens
        - output_tokens_details
        - server_tool_use
        - service_tier
        - speed
    RawMessageStartEvent:
      type: object
      properties:
        type:
          type: string
          const: message_start
        message:
          $ref: '#/components/schemas/Message'
      required:
        - type
        - message
    RawMessageDeltaEvent:
      type: object
      properties:
        type:
          type: string
          const: message_delta
        delta:
          type: object
          properties:
            container:
              anyOf:
                - $ref: '#/components/schemas/Container'
                - type: 'null'
              description: |-
                本次请求所使用容器的信息。

                如果使用了容器工具（例如代码执行），该值不为 null。
            stop_details:
              anyOf:
                - $ref: '#/components/schemas/RefusalStopDetails'
                - type: 'null'
              description: |-
                关于模型输出为何停止的结构化信息。

                当 `stop_reason` 没有额外细节需要报告时为 `null`。
            stop_reason:
              anyOf:
                - $ref: '#/components/schemas/StopReason'
                - type: 'null'
            stop_sequence:
              anyOf:
                - type: string
                - type: 'null'
          required:
            - container
            - stop_details
            - stop_reason
            - stop_sequence
        usage:
          allOf:
            - $ref: '#/components/schemas/MessageDeltaUsage'
          description: >-
            计费和速率限制用量。


            Anthropic 的 API 按 Token 数计费并实施速率限制，因为 Token 代表了我们系统的底层成本。


            在底层，API 会将请求转换为适合模型的格式，模型的输出随后经过解析阶段才成为 API 响应。因此，`usage` 中的 Token
            数不会与 API 请求或响应中可见的内容一一对应。


            例如，即使 Claude 返回空字符串响应，`output_tokens` 也不为零。


            请求的输入 Token 总数为 `input_tokens`、`cache_creation_input_tokens` 和
            `cache_read_input_tokens` 之和。
      required:
        - type
        - delta
        - usage
    RawMessageStopEvent:
      type: object
      properties:
        type:
          type: string
          const: message_stop
      required:
        - type
    RawContentBlockStartEvent:
      type: object
      properties:
        type:
          type: string
          const: content_block_start
        content_block:
          anyOf:
            - $ref: '#/components/schemas/TextBlock'
            - $ref: '#/components/schemas/ThinkingBlock'
            - $ref: '#/components/schemas/RedactedThinkingBlock'
            - $ref: '#/components/schemas/ToolUseBlock'
            - $ref: '#/components/schemas/ServerToolUseBlock'
            - $ref: '#/components/schemas/WebSearchToolResultBlock'
            - $ref: '#/components/schemas/WebFetchToolResultBlock'
            - $ref: '#/components/schemas/CodeExecutionToolResultBlock'
            - $ref: '#/components/schemas/BashCodeExecutionToolResultBlock'
            - $ref: '#/components/schemas/TextEditorCodeExecutionToolResultBlock'
            - $ref: '#/components/schemas/ToolSearchToolResultBlock'
            - $ref: '#/components/schemas/ContainerUploadBlock'
        index:
          type: number
      required:
        - type
        - content_block
        - index
    RawContentBlockDeltaEvent:
      type: object
      properties:
        type:
          type: string
          const: content_block_delta
        delta:
          $ref: '#/components/schemas/RawContentBlockDelta'
        index:
          type: number
      required:
        - type
        - delta
        - index
    RawContentBlockStopEvent:
      type: object
      properties:
        type:
          type: string
          const: content_block_stop
        index:
          type: number
      required:
        - type
        - index
    UserMessageParam:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/MessageContentParam'
        role:
          type: string
          const: user
      required:
        - content
        - role
    AssistantMessageParam:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/MessageContentParam'
        role:
          type: string
          const: assistant
      required:
        - content
        - role
    SystemMessageParam:
      type: object
      properties:
        content:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/Blocks'
        role:
          type: string
          const: system
      required:
        - content
        - role
    ContainerParams:
      type: object
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          description: 容器 ID
        skills:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/SkillParams'
            - type: 'null'
          description: 要在容器中加载的技能列表
          maxItems: 20
      description: 包含待加载技能的容器参数。
    JSONOutputFormat:
      type: object
      properties:
        type:
          type: string
          const: json_schema
        schema:
          type: object
          additionalProperties: true
          description: 该格式的 JSON Schema
      required:
        - type
        - schema
    TextCitationParam:
      anyOf:
        - $ref: '#/components/schemas/CitationCharLocationParam'
        - $ref: '#/components/schemas/CitationPageLocationParam'
        - $ref: '#/components/schemas/CitationContentBlockLocationParam'
        - $ref: '#/components/schemas/CitationWebSearchResultLocationParam'
        - $ref: '#/components/schemas/CitationSearchResultLocationParam'
    ThinkingConfigEnabled:
      type: object
      properties:
        type:
          type: string
          const: enabled
        budget_tokens:
          type: number
          description: >-
            决定 Claude 在内部推理过程中可使用的 Token 数。更大的预算可以让模型对复杂问题进行更深入的分析，从而提升响应质量。


            必须 ≥1024 且小于 `max_tokens`。


            详见[扩展思考](https://platform.claude.com/docs/en/build-with-claude/extended-thinking)。
          minimum: 1024
        display:
          anyOf:
            - type: string
              enum:
                - summarized
                - omitted
            - type: 'null'
          description: >-
            控制思考内容在响应中的呈现方式。设为 `summarized` 时，思考内容正常返回。设为 `omitted`
            时，思考内容会被隐去，但仍返回签名以保证多轮对话的连续性。默认值取决于模型；参见[控制思考内容的显示](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display)。
      required:
        - type
        - budget_tokens
    ThinkingConfigDisabled:
      type: object
      properties:
        type:
          type: string
          const: disabled
      required:
        - type
    ThinkingConfigBetweenTools:
      type: object
      properties:
        type:
          type: string
          const: between_tools
      required:
        - type
    ThinkingConfigAdaptive:
      type: object
      properties:
        type:
          type: string
          const: adaptive
        display:
          anyOf:
            - type: string
              enum:
                - summarized
                - omitted
            - type: 'null'
          description: >-
            控制思考内容在响应中的呈现方式。设为 `summarized` 时，思考内容正常返回。设为 `omitted`
            时，思考内容会被隐去，但仍返回签名以保证多轮对话的连续性。默认值取决于模型；参见[控制思考内容的显示](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display)。
      required:
        - type
    ToolChoiceAuto:
      type: object
      properties:
        type:
          type: string
          const: auto
        disable_parallel_tool_use:
          type: boolean
          description: |-
            是否禁用并行工具使用。

            默认为 `false`。设为 `true` 时，模型最多输出一个工具使用。
      required:
        - type
      description: 由模型自动决定是否使用工具。
    ToolChoiceAny:
      type: object
      properties:
        type:
          type: string
          const: any
        disable_parallel_tool_use:
          type: boolean
          description: |-
            是否禁用并行工具使用。

            默认为 `false`。设为 `true` 时，模型将恰好输出一个工具使用。
      required:
        - type
      description: 模型将使用任一可用工具。
    ToolChoiceTool:
      type: object
      properties:
        type:
          type: string
          const: tool
        name:
          type: string
          description: 要使用的工具名称。
        disable_parallel_tool_use:
          type: boolean
          description: |-
            是否禁用并行工具使用。

            默认为 `false`。设为 `true` 时，模型将恰好输出一个工具使用。
      required:
        - type
        - name
      description: 模型将使用 `tool_choice.name` 指定的工具。
    ToolChoiceNone:
      type: object
      properties:
        type:
          type: string
          const: none
      required:
        - type
      description: 不允许模型使用工具。
    Tool:
      type: object
      properties:
        type:
          anyOf:
            - type: string
              const: custom
            - type: 'null'
        input_schema:
          type: object
          properties:
            type:
              type: string
              const: object
            properties:
              anyOf:
                - type: object
                  additionalProperties: true
                - type: 'null'
            required:
              anyOf:
                - type: array
                  items:
                    type: string
                - type: 'null'
          required:
            - type
          description: |-
            该工具输入的 [JSON Schema](https://json-schema.org/draft/2020-12)。

            用于定义工具所接受、且模型将生成的 `input` 的结构。
        name:
          type: string
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
          minLength: 1
          maxLength: 128
          pattern: ^[a-zA-Z0-9_-]{1,128}$
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        description:
          type: string
          description: >-
            该工具功能的描述。


            工具描述应尽可能详细。模型对工具是什么以及如何使用了解得越多，表现就越好。你可以使用自然语言描述来强调工具输入 JSON Schema
            中的重要方面。
        eager_input_streaming:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            为该工具启用即时（eager）输入流式传输。为 true
            时，工具输入参数会在生成过程中以增量方式流式输出，并即时推断类型，而不是缓冲完整的 JSON 输出。为 false 时，即使启用了
            fine-grained-tool-streaming beta，该工具的流式传输也会被禁用。为 null（默认）时，根据 beta
            请求头采用默认行为。
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: true
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
      required:
        - input_schema
        - name
    ToolBash20250124:
      type: object
      properties:
        type:
          type: string
          const: bash_20250124
        name:
          type: string
          const: bash
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: true
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
      required:
        - type
        - name
    CodeExecutionTool20250522:
      type: object
      properties:
        type:
          type: string
          const: code_execution_20250522
        name:
          type: string
          const: code_execution
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
      required:
        - type
        - name
    CodeExecutionTool20250825:
      type: object
      properties:
        type:
          type: string
          const: code_execution_20250825
        name:
          type: string
          const: code_execution
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
      required:
        - type
        - name
    CodeExecutionTool20260120:
      type: object
      properties:
        type:
          type: string
          const: code_execution_20260120
        name:
          type: string
          const: code_execution
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
      required:
        - type
        - name
      description: >-
        代码执行工具的 `tools` 条目，版本为 `code_execution_20260120`。该版本在
        `code_execution_20250825` 的基础上增加了 REPL 状态持久化。


        REPL 状态持久化适用于程序化工具调用。启用后，Python 解释器状态（例如变量绑定）会在复用同一容器的多个请求之间保留。


        各工具版本新增的功能详见[代码执行工具指南](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#tool-versions)。
    CodeExecutionTool20260521:
      type: object
      properties:
        type:
          type: string
          const: code_execution_20260521
        name:
          type: string
          const: code_execution
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
      required:
        - type
        - name
      description: 支持 REPL 状态持久化的代码执行工具。
    BrowserToolset20260801:
      type: object
      properties:
        type:
          type: string
          const: browser_toolset_20260801
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        configs:
          anyOf:
            - $ref: '#/components/schemas/BrowserToolsetConfigs'
            - type: 'null'
          description: 按成员名称作为键的稀疏覆盖配置。缺省、null 和 {} 三者等价；凡未出现某成员的键，即使用该成员的默认配置。
      required:
        - type
      description: >-
        浏览器工具集：单个 `tools[]` 条目（不带 `name`），用于声明浏览器工具系列。提供给模型的是该系列的工具，其中通过
        `configs` 禁用的成员会从 Schema 中移除。
    MemoryTool20250818:
      type: object
      properties:
        type:
          type: string
          const: memory_20250818
        name:
          type: string
          const: memory
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: true
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
      required:
        - type
        - name
    ComputerToolset20260801:
      type: object
      properties:
        type:
          type: string
          const: computer_toolset_20260801
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        configs:
          anyOf:
            - $ref: '#/components/schemas/ComputerToolsetConfigs'
            - type: 'null'
          description: 按成员名称作为键的稀疏覆盖配置。缺省、null 和 {} 三者等价；凡未出现某成员的键，即使用该成员的默认配置。
      required:
        - type
      description: >-
        计算机工具集：单个 `tools[]` 条目（不带 `name`），用于声明计算机工具系列。提供给模型的是该系列的工具，其中通过
        `configs` 禁用的成员会从 Schema 中移除。所有成员默认启用，包括 zoom。单工具选项 `display_number` 和
        `enable_zoom` 不是工具集条目的字段——工具集条目只包含 `type`、`configs` 和
        `cache_control`；zoom 通过 `configs.zoom.enabled` 控制。
    ToolTextEditor20250124:
      type: object
      properties:
        type:
          type: string
          const: text_editor_20250124
        name:
          type: string
          const: str_replace_editor
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: true
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
      required:
        - type
        - name
    ToolTextEditor20250429:
      type: object
      properties:
        type:
          type: string
          const: text_editor_20250429
        name:
          type: string
          const: str_replace_based_edit_tool
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: true
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
      required:
        - type
        - name
    ToolTextEditor20250728:
      type: object
      properties:
        type:
          type: string
          const: text_editor_20250728
        name:
          type: string
          const: str_replace_based_edit_tool
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: true
        max_characters:
          anyOf:
            - type: number
            - type: 'null'
          description: 查看文件时显示的最大字符数。未指定时默认显示完整文件。
          minimum: 1
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
      required:
        - type
        - name
    WebSearchTool20250305:
      type: object
      properties:
        type:
          type: string
          const: web_search_20250305
        name:
          type: string
          const: web_search
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 如果提供，结果中只会包含这些域名。不能与 `blocked_domains` 同时使用。
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 如果提供，这些域名永远不会出现在结果中。不能与 `allowed_domains` 同时使用。
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          description: 在一次 API 请求中该工具可被使用的最大次数。
          minimum: 1
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
        user_location:
          anyOf:
            - $ref: '#/components/schemas/UserLocation'
            - type: 'null'
          description: 用户位置参数，用于提供更相关的搜索结果。
      required:
        - type
        - name
    WebFetchTool20250910:
      type: object
      properties:
        type:
          type: string
          const: web_fetch_20250910
        name:
          type: string
          const: web_fetch
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 允许抓取的域名列表
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 禁止抓取的域名列表
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        citations:
          anyOf:
            - $ref: '#/components/schemas/CitationsConfigParam'
            - type: 'null'
          description: 已抓取文档的引用配置。引用默认关闭。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        max_content_tokens:
          anyOf:
            - type: number
            - type: 'null'
          description: 将网页文本内容放入上下文时可使用的最大 Token 数。该限制为近似值，不适用于 PDF 等二进制内容。
          minimum: 1
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          description: 在一次 API 请求中该工具可被使用的最大次数。
          minimum: 1
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
        url_sources:
          anyOf:
            - $ref: '#/components/schemas/WebFetchURLSources'
            - type: 'null'
          description: 哪些来源可以向该工具可抓取的 URL 集合提供 URL。省略表示所有来源。
      required:
        - type
        - name
    WebSearchTool20260209:
      type: object
      properties:
        type:
          type: string
          const: web_search_20260209
        name:
          type: string
          const: web_search
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 如果提供，结果中只会包含这些域名。不能与 `blocked_domains` 同时使用。
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 如果提供，这些域名永远不会出现在结果中。不能与 `allowed_domains` 同时使用。
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          description: 在一次 API 请求中该工具可被使用的最大次数。
          minimum: 1
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
        user_location:
          anyOf:
            - $ref: '#/components/schemas/UserLocation'
            - type: 'null'
          description: 用户位置参数，用于提供更相关的搜索结果。
      required:
        - type
        - name
    WebFetchTool20260209:
      type: object
      properties:
        type:
          type: string
          const: web_fetch_20260209
        name:
          type: string
          const: web_fetch
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 允许抓取的域名列表
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 禁止抓取的域名列表
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        citations:
          anyOf:
            - $ref: '#/components/schemas/CitationsConfigParam'
            - type: 'null'
          description: 已抓取文档的引用配置。引用默认关闭。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        max_content_tokens:
          anyOf:
            - type: number
            - type: 'null'
          description: 将网页文本内容放入上下文时可使用的最大 Token 数。该限制为近似值，不适用于 PDF 等二进制内容。
          minimum: 1
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          description: 在一次 API 请求中该工具可被使用的最大次数。
          minimum: 1
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
        url_sources:
          anyOf:
            - $ref: '#/components/schemas/WebFetchURLSources'
            - type: 'null'
          description: 哪些来源可以向该工具可抓取的 URL 集合提供 URL。省略表示所有来源。
      required:
        - type
        - name
    WebFetchTool20260309:
      type: object
      properties:
        type:
          type: string
          const: web_fetch_20260309
        name:
          type: string
          const: web_fetch
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 允许抓取的域名列表
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 禁止抓取的域名列表
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        citations:
          anyOf:
            - $ref: '#/components/schemas/CitationsConfigParam'
            - type: 'null'
          description: 已抓取文档的引用配置。引用默认关闭。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        max_content_tokens:
          anyOf:
            - type: number
            - type: 'null'
          description: 将网页文本内容放入上下文时可使用的最大 Token 数。该限制为近似值，不适用于 PDF 等二进制内容。
          minimum: 1
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          description: 在一次 API 请求中该工具可被使用的最大次数。
          minimum: 1
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
        url_sources:
          anyOf:
            - $ref: '#/components/schemas/WebFetchURLSources'
            - type: 'null'
          description: 哪些来源可以向该工具可抓取的 URL 集合提供 URL。省略表示所有来源。
        use_cache:
          type: boolean
          description: 是否使用缓存内容。设为 false 可绕过缓存并抓取最新内容。仅在用户明确要求最新内容或抓取快速变化的来源时才设为 false。
      required:
        - type
        - name
      description: 带有 use_cache 参数的网页抓取工具，可用于绕过缓存内容。
    WebSearchTool20260318:
      type: object
      properties:
        type:
          type: string
          const: web_search_20260318
        name:
          type: string
          const: web_search
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 如果提供，结果中只会包含这些域名。不能与 `blocked_domains` 同时使用。
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 如果提供，这些域名永远不会出现在结果中。不能与 `allowed_domains` 同时使用。
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          description: 在一次 API 请求中该工具可被使用的最大次数。
          minimum: 1
        response_inclusion:
          type: string
          enum:
            - full
            - excluded
          description: >-
            当该工具的结果已被同一轮次中已完成的 code_execution 调用使用时，其结果块在 API 响应中的呈现方式。'full'
            返回完整内容（默认）。'excluded' 则完全移除嵌套的 server_tool_use
            及结果块对。直接调用的结果，或在完成前暂停的 code_execution 调用的结果，始终完整返回，以便在下一轮次中回传。
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
        user_location:
          anyOf:
            - $ref: '#/components/schemas/UserLocation'
            - type: 'null'
          description: 用户位置参数，用于提供更相关的搜索结果。
      required:
        - type
        - name
    WebFetchTool20260318:
      type: object
      properties:
        type:
          type: string
          const: web_fetch_20260318
        name:
          type: string
          const: web_fetch
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 允许抓取的域名列表
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: 禁止抓取的域名列表
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        citations:
          anyOf:
            - $ref: '#/components/schemas/CitationsConfigParam'
            - type: 'null'
          description: 已抓取文档的引用配置。引用默认关闭。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        max_content_tokens:
          anyOf:
            - type: number
            - type: 'null'
          description: 将网页文本内容放入上下文时可使用的最大 Token 数。该限制为近似值，不适用于 PDF 等二进制内容。
          minimum: 1
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          description: 在一次 API 请求中该工具可被使用的最大次数。
          minimum: 1
        response_inclusion:
          type: string
          enum:
            - full
            - excluded
          description: >-
            当该工具的结果已被同一轮次中已完成的 code_execution 调用使用时，其结果块在 API 响应中的呈现方式。'full'
            返回完整内容（默认）。'excluded' 则完全移除嵌套的 server_tool_use
            及结果块对。直接调用的结果，或在完成前暂停的 code_execution 调用的结果，始终完整返回，以便在下一轮次中回传。
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
        url_sources:
          anyOf:
            - $ref: '#/components/schemas/WebFetchURLSources'
            - type: 'null'
          description: 哪些来源可以向该工具可抓取的 URL 集合提供 URL。省略表示所有来源。
        use_cache:
          type: boolean
          description: 是否使用缓存内容。设为 false 可绕过缓存并抓取最新内容。仅在用户明确要求最新内容或抓取快速变化的来源时才设为 false。
      required:
        - type
        - name
    ToolSearchToolBm25_20251119:
      type: object
      properties:
        type:
          type: string
          enum:
            - tool_search_tool_bm25_20251119
            - tool_search_tool_bm25
        name:
          type: string
          const: tool_search_tool_bm25
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
      required:
        - type
        - name
    ToolSearchToolRegex20251119:
      type: object
      properties:
        type:
          type: string
          enum:
            - tool_search_tool_regex_20251119
            - tool_search_tool_regex
        name:
          type: string
          const: tool_search_tool_regex
          description: |-
            工具名称。

            模型以及 `tool_use` 块中通过该名称调用工具。
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        defer_loading:
          type: boolean
          description: 为 true 时，该工具不会包含在初始系统提示词中，仅在通过工具搜索以 tool_reference 返回时才加载。
        strict:
          type: boolean
          description: 为 true 时，保证对工具名称和输入进行 Schema 校验
      required:
        - type
        - name
    ContainerSkill:
      type: object
      properties:
        type:
          type: string
          enum:
            - anthropic
            - custom
          description: 技能类型：'anthropic'（内置）或 'custom'（用户自定义）
        skill_id:
          type: string
          description: 技能 ID
          minLength: 1
          maxLength: 64
        version:
          type: string
          description: 解析后的版本：对于自定义技能为技能版本 ID。
          minLength: 1
          maxLength: 64
      required:
        - type
        - skill_id
        - version
    TextBlock:
      type: object
      properties:
        type:
          type: string
          const: text
        citations:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/TextCitation'
            - type: 'null'
          description: >-
            支撑该文本块的引用。


            返回的引用类型取决于被引用文档的类型。引用 PDF 时返回 `page_location`，引用纯文本时返回
            `char_location`，引用内容文档时返回 `content_block_location`。
        text:
          type: string
      required:
        - type
        - citations
        - text
    ThinkingBlock:
      type: object
      properties:
        type:
          type: string
          const: thinking
        signature:
          type: string
          description: >-
            在将该思考块回传给 API 时，用于验证其由 Claude 生成的值。


            这是一个不透明字段，不应解读或解析。将思考块回传给 API 时（在扩展思考中使用工具时必须回传），请完全按原样回传，并保持该字段不变。


            详见[扩展思考](https://platform.claude.com/docs/en/build-with-claude/extended-thinking)。
        thinking:
          type: string
          description: 该块中 Claude 思考过程的文本。
      required:
        - type
        - signature
        - thinking
    RedactedThinkingBlock:
      type: object
      properties:
        type:
          type: string
          const: redacted_thinking
        data:
          type: string
          description: >-
            该已脱敏思考块的内容，当模型的部分思考内容因安全原因被隐去时返回。该字段不透明且已加密，不含可读内容。


            在继续多轮对话时，请将 `redacted_thinking` 块原样回传给 API。


            详见[扩展思考](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#redacted-thinking-blocks)。
      required:
        - type
        - data
    ToolUseBlock:
      type: object
      properties:
        type:
          type: string
          const: tool_use
        id:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        caller:
          anyOf:
            - $ref: '#/components/schemas/DirectCaller'
            - $ref: '#/components/schemas/ServerToolCaller'
            - $ref: '#/components/schemas/ServerToolCaller20260120'
          default: '{"type":"direct"}'
        input:
          type: object
          additionalProperties: true
        name:
          type: string
          minLength: 1
        toolset_name:
          anyOf:
            - type: string
            - type: 'null'
          description: 对于工具集成员的 tool_use，表示其所属的工具集系列。
          minLength: 1
          maxLength: 64
          pattern: ^[a-zA-Z0-9_-]+$
      required:
        - type
        - id
        - caller
        - input
        - name
    ServerToolUseBlock:
      type: object
      properties:
        type:
          type: string
          const: server_tool_use
        id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        caller:
          anyOf:
            - $ref: '#/components/schemas/DirectCaller'
            - $ref: '#/components/schemas/ServerToolCaller'
            - $ref: '#/components/schemas/ServerToolCaller20260120'
          default: '{"type":"direct"}'
        input:
          type: object
          additionalProperties: true
        name:
          type: string
          enum:
            - web_search
            - web_fetch
            - code_execution
            - bash_code_execution
            - text_editor_code_execution
            - tool_search_tool_regex
            - tool_search_tool_bm25
      required:
        - type
        - id
        - caller
        - input
        - name
    WebSearchToolResultBlock:
      type: object
      properties:
        type:
          type: string
          const: web_search_tool_result
        caller:
          anyOf:
            - $ref: '#/components/schemas/DirectCaller'
            - $ref: '#/components/schemas/ServerToolCaller'
            - $ref: '#/components/schemas/ServerToolCaller20260120'
          default: '{"type":"direct"}'
        content:
          $ref: '#/components/schemas/WebSearchToolResultBlockContent'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - caller
        - content
        - tool_use_id
    WebFetchToolResultBlock:
      type: object
      properties:
        type:
          type: string
          const: web_fetch_tool_result
        caller:
          anyOf:
            - $ref: '#/components/schemas/DirectCaller'
            - $ref: '#/components/schemas/ServerToolCaller'
            - $ref: '#/components/schemas/ServerToolCaller20260120'
          default: '{"type":"direct"}'
        content:
          anyOf:
            - $ref: '#/components/schemas/WebFetchToolResultErrorBlock'
            - $ref: '#/components/schemas/WebFetchBlock'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - caller
        - content
        - tool_use_id
    CodeExecutionToolResultBlock:
      type: object
      properties:
        type:
          type: string
          const: code_execution_tool_result
        content:
          $ref: '#/components/schemas/CodeExecutionToolResultBlockContent'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - content
        - tool_use_id
    BashCodeExecutionToolResultBlock:
      type: object
      properties:
        type:
          type: string
          const: bash_code_execution_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/BashCodeExecutionToolResultError'
            - $ref: '#/components/schemas/BashCodeExecutionResultBlock'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - content
        - tool_use_id
    TextEditorCodeExecutionToolResultBlock:
      type: object
      properties:
        type:
          type: string
          const: text_editor_code_execution_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/TextEditorCodeExecutionToolResultError'
            - $ref: '#/components/schemas/TextEditorCodeExecutionViewResultBlock'
            - $ref: '#/components/schemas/TextEditorCodeExecutionCreateResultBlock'
            - $ref: >-
                #/components/schemas/TextEditorCodeExecutionStrReplaceResultBlock
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - content
        - tool_use_id
    ToolSearchToolResultBlock:
      type: object
      properties:
        type:
          type: string
          const: tool_search_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/ToolSearchToolResultError'
            - $ref: '#/components/schemas/ToolSearchToolSearchResultBlock'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - content
        - tool_use_id
    ContainerUploadBlock:
      type: object
      properties:
        type:
          type: string
          const: container_upload
        file_id:
          type: string
      required:
        - type
        - file_id
      description: 已上传到容器的文件的响应模型。
    CacheMissReason:
      anyOf:
        - $ref: '#/components/schemas/CacheMissModelChanged'
        - $ref: '#/components/schemas/CacheMissSystemChanged'
        - $ref: '#/components/schemas/CacheMissToolsChanged'
        - $ref: '#/components/schemas/CacheMissMessagesChanged'
        - $ref: '#/components/schemas/CacheMissPreviousMessageNotFound'
        - $ref: '#/components/schemas/CacheMissUnavailable'
    CacheCreation:
      type: object
      properties:
        ephemeral_1h_input_tokens:
          type: number
          description: 用于创建 1 小时缓存条目的输入 Token 数。
          default: 0
          minimum: 0
        ephemeral_5m_input_tokens:
          type: number
          description: 用于创建 5 分钟缓存条目的输入 Token 数。
          default: 0
          minimum: 0
      required:
        - ephemeral_1h_input_tokens
        - ephemeral_5m_input_tokens
    OutputTokensDetails:
      type: object
      properties:
        thinking_tokens:
          type: number
          description: >-
            模型作为内部推理生成的输出 Token 数，包括思考块分隔符 Token。


            该值反映模型产生的原始推理，而非响应体中返回的（可能更短的）思考摘要文本。它可能与模型实际生成的数量相差少量 Token。始终 ≤
            `output_tokens`；`output_tokens - thinking_tokens` 约等于非推理输出。
          default: 0
          minimum: 0
      required:
        - thinking_tokens
    ServerToolUsage:
      type: object
      properties:
        web_fetch_requests:
          type: number
          description: 网页抓取工具请求次数。
          default: 0
          minimum: 0
        web_search_requests:
          type: number
          description: 网页搜索工具请求次数。
          default: 0
          minimum: 0
      required:
        - web_fetch_requests
        - web_search_requests
    MessageDeltaUsage:
      type: object
      properties:
        cache_creation_input_tokens:
          anyOf:
            - type: number
            - type: 'null'
          description: 用于创建缓存条目的累计输入 Token 数。
          minimum: 0
        cache_read_input_tokens:
          anyOf:
            - type: number
            - type: 'null'
          description: 从缓存中读取的累计输入 Token 数。
          minimum: 0
        input_tokens:
          anyOf:
            - type: number
            - type: 'null'
          description: 使用的累计输入 Token 数。
          minimum: 0
        output_tokens:
          type: number
          description: 使用的累计输出 Token 数。
        output_tokens_details:
          anyOf:
            - $ref: '#/components/schemas/OutputTokensDetails'
            - type: 'null'
          description: >-
            按类别划分的输出 Token 明细。


            `output_tokens` 仍是用于计费的、包含全部类别的权威总数。该对象提供只读的分解数据，用于可观测性——例如，计费的输出
            Token 中有多少用于内部推理（这些推理在返回给你之前可能已被摘要）。
        server_tool_use:
          anyOf:
            - $ref: '#/components/schemas/ServerToolUsage'
            - type: 'null'
          description: 服务端工具请求次数。
      required:
        - cache_creation_input_tokens
        - cache_read_input_tokens
        - input_tokens
        - output_tokens
        - output_tokens_details
        - server_tool_use
    RawContentBlockDelta:
      anyOf:
        - $ref: '#/components/schemas/TextDelta'
        - $ref: '#/components/schemas/InputJSONDelta'
        - $ref: '#/components/schemas/CitationsDelta'
        - $ref: '#/components/schemas/ThinkingDelta'
        - $ref: '#/components/schemas/SignatureDelta'
    MessageContentParam:
      anyOf:
        - type: string
        - type: array
          items:
            $ref: '#/components/schemas/ContentBlockParam'
    Blocks:
      type: array
      items:
        $ref: '#/components/schemas/TextBlockParam'
    SkillParams:
      type: object
      properties:
        type:
          type: string
          enum:
            - anthropic
            - custom
          description: 技能类型：'anthropic'（内置）或 'custom'（用户自定义）
        skill_id:
          type: string
          description: 技能 ID
          minLength: 1
          maxLength: 64
        version:
          type: string
          description: 技能版本，或使用 'latest' 表示最新版本
          minLength: 1
          maxLength: 64
      required:
        - type
        - skill_id
    CitationCharLocationParam:
      type: object
      properties:
        type:
          type: string
          const: char_location
        cited_text:
          type: string
        document_index:
          type: number
          minimum: 0
        document_title:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 500
        end_char_index:
          type: number
        start_char_index:
          type: number
          minimum: 0
      required:
        - type
        - cited_text
        - document_index
        - document_title
        - end_char_index
        - start_char_index
    CitationPageLocationParam:
      type: object
      properties:
        type:
          type: string
          const: page_location
        cited_text:
          type: string
        document_index:
          type: number
          minimum: 0
        document_title:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 500
        end_page_number:
          type: number
        start_page_number:
          type: number
          minimum: 1
      required:
        - type
        - cited_text
        - document_index
        - document_title
        - end_page_number
        - start_page_number
    CitationContentBlockLocationParam:
      type: object
      properties:
        type:
          type: string
          const: content_block_location
        cited_text:
          type: string
          description: >-
            被引用块范围的完整文本（拼接而成）。


            始终等于 `content[start_block_index:end_block_index]`
            内容拼接后的结果。文本块是最小的可引用单元；该字段绝不会是单个块的子字符串。不计入输出 Token，在后续轮次中回传时也不计入输入
            Token。
        document_index:
          type: number
          minimum: 0
        document_title:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 500
        end_block_index:
          type: number
          description: >-
            被引用块范围在来源 `content` 数组中的结束索引（从 0 开始，不含该位置）。


            始终大于 `start_block_index`；单块引用满足 `end_block_index = start_block_index
            + 1`。
        start_block_index:
          type: number
          description: 第一个被引用块在来源 `content` 数组中的索引（从 0 开始）。
          minimum: 0
      required:
        - type
        - cited_text
        - document_index
        - document_title
        - end_block_index
        - start_block_index
    CitationWebSearchResultLocationParam:
      type: object
      properties:
        type:
          type: string
          const: web_search_result_location
        cited_text:
          type: string
        encrypted_index:
          type: string
        title:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 512
        url:
          type: string
          minLength: 1
      required:
        - type
        - cited_text
        - encrypted_index
        - title
        - url
    CitationSearchResultLocationParam:
      type: object
      properties:
        type:
          type: string
          const: search_result_location
        cited_text:
          type: string
          description: >-
            被引用块范围的完整文本（拼接而成）。


            始终等于 `content[start_block_index:end_block_index]`
            内容拼接后的结果。文本块是最小的可引用单元；该字段绝不会是单个块的子字符串。不计入输出 Token，在后续轮次中回传时也不计入输入
            Token。
        end_block_index:
          type: number
          description: >-
            被引用块范围在来源 `content` 数组中的结束索引（从 0 开始，不含该位置）。


            始终大于 `start_block_index`；单块引用满足 `end_block_index = start_block_index
            + 1`。
        search_result_index:
          type: number
          description: |-
            被引用的搜索结果在请求中所有 `search_result` 内容块中的索引（从 0 开始），按其在各条消息和工具结果中出现的顺序计数。

            与 `document_index` 分开计数；服务端网页搜索结果不计入此计数。
          minimum: 0
        source:
          type: string
        start_block_index:
          type: number
          description: 第一个被引用块在来源 `content` 数组中的索引（从 0 开始）。
          minimum: 0
        title:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - cited_text
        - end_block_index
        - search_result_index
        - source
        - start_block_index
        - title
    BrowserToolsetConfigs:
      type: object
      properties:
        type:
          anyOf:
            - $ref: '#/components/schemas/BrowserTypeConfig'
            - type: 'null'
          description: '`type` 的配置覆盖项。'
        close_tab:
          anyOf:
            - $ref: '#/components/schemas/BrowserCloseTabConfig'
            - type: 'null'
          description: '`close_tab` 的配置覆盖项。'
        double_click:
          anyOf:
            - $ref: '#/components/schemas/BrowserDoubleClickConfig'
            - type: 'null'
          description: '`double_click` 的配置覆盖项。'
        file_upload:
          anyOf:
            - $ref: '#/components/schemas/BrowserFileUploadConfig'
            - type: 'null'
          description: '`file_upload` 的配置覆盖项。'
        find:
          anyOf:
            - $ref: '#/components/schemas/BrowserFindConfig'
            - type: 'null'
          description: '`find` 的配置覆盖项。'
        form_input:
          anyOf:
            - $ref: '#/components/schemas/BrowserFormInputConfig'
            - type: 'null'
          description: '`form_input` 的配置覆盖项。'
        get_page_text:
          anyOf:
            - $ref: '#/components/schemas/BrowserGetPageTextConfig'
            - type: 'null'
          description: '`get_page_text` 的配置覆盖项。'
        hold_key:
          anyOf:
            - $ref: '#/components/schemas/BrowserHoldKeyConfig'
            - type: 'null'
          description: '`hold_key` 的配置覆盖项。'
        hover:
          anyOf:
            - $ref: '#/components/schemas/BrowserHoverConfig'
            - type: 'null'
          description: '`hover` 的配置覆盖项。'
        javascript_exec:
          anyOf:
            - $ref: '#/components/schemas/BrowserJavascriptExecConfig'
            - type: 'null'
          description: '`javascript_exec` 的配置覆盖项。'
        key:
          anyOf:
            - $ref: '#/components/schemas/BrowserKeyConfig'
            - type: 'null'
          description: '`key` 的配置覆盖项。'
        left_click:
          anyOf:
            - $ref: '#/components/schemas/BrowserLeftClickConfig'
            - type: 'null'
          description: '`left_click` 的配置覆盖项。'
        left_click_drag:
          anyOf:
            - $ref: '#/components/schemas/BrowserLeftClickDragConfig'
            - type: 'null'
          description: '`left_click_drag` 的配置覆盖项。'
        left_mouse_down:
          anyOf:
            - $ref: '#/components/schemas/BrowserLeftMouseDownConfig'
            - type: 'null'
          description: '`left_mouse_down` 的配置覆盖项。'
        left_mouse_up:
          anyOf:
            - $ref: '#/components/schemas/BrowserLeftMouseUpConfig'
            - type: 'null'
          description: '`left_mouse_up` 的配置覆盖项。'
        list_tabs:
          anyOf:
            - $ref: '#/components/schemas/BrowserListTabsConfig'
            - type: 'null'
          description: '`list_tabs` 的配置覆盖项。'
        middle_click:
          anyOf:
            - $ref: '#/components/schemas/BrowserMiddleClickConfig'
            - type: 'null'
          description: '`middle_click` 的配置覆盖项。'
        mouse_move:
          anyOf:
            - $ref: '#/components/schemas/BrowserMouseMoveConfig'
            - type: 'null'
          description: '`mouse_move` 的配置覆盖项。'
        navigate:
          anyOf:
            - $ref: '#/components/schemas/BrowserNavigateConfig'
            - type: 'null'
          description: '`navigate` 的配置覆盖项。'
        new_tab:
          anyOf:
            - $ref: '#/components/schemas/BrowserNewTabConfig'
            - type: 'null'
          description: '`new_tab` 的配置覆盖项。'
        read_console:
          anyOf:
            - $ref: '#/components/schemas/BrowserReadConsoleConfig'
            - type: 'null'
          description: '`read_console` 的配置覆盖项。'
        read_network:
          anyOf:
            - $ref: '#/components/schemas/BrowserReadNetworkConfig'
            - type: 'null'
          description: '`read_network` 的配置覆盖项。'
        read_page:
          anyOf:
            - $ref: '#/components/schemas/BrowserReadPageConfig'
            - type: 'null'
          description: '`read_page` 的配置覆盖项。'
        right_click:
          anyOf:
            - $ref: '#/components/schemas/BrowserRightClickConfig'
            - type: 'null'
          description: '`right_click` 的配置覆盖项。'
        screenshot:
          anyOf:
            - $ref: '#/components/schemas/BrowserScreenshotConfig'
            - type: 'null'
          description: '`screenshot` 的配置覆盖项。'
        scroll:
          anyOf:
            - $ref: '#/components/schemas/BrowserScrollConfig'
            - type: 'null'
          description: '`scroll` 的配置覆盖项。'
        scroll_to:
          anyOf:
            - $ref: '#/components/schemas/BrowserScrollToConfig'
            - type: 'null'
          description: '`scroll_to` 的配置覆盖项。'
        switch_tab:
          anyOf:
            - $ref: '#/components/schemas/BrowserSwitchTabConfig'
            - type: 'null'
          description: '`switch_tab` 的配置覆盖项。'
        triple_click:
          anyOf:
            - $ref: '#/components/schemas/BrowserTripleClickConfig'
            - type: 'null'
          description: '`triple_click` 的配置覆盖项。'
        wait:
          anyOf:
            - $ref: '#/components/schemas/BrowserWaitConfig'
            - type: 'null'
          description: '`wait` 的配置覆盖项。'
        zoom:
          anyOf:
            - $ref: '#/components/schemas/BrowserZoomConfig'
            - type: 'null'
          description: '`zoom` 的配置覆盖项。'
    ComputerToolsetConfigs:
      type: object
      properties:
        type:
          anyOf:
            - $ref: '#/components/schemas/ComputerTypeConfig'
            - type: 'null'
          description: '`type` 的配置覆盖项。'
        cursor_position:
          anyOf:
            - $ref: '#/components/schemas/ComputerCursorPositionConfig'
            - type: 'null'
          description: '`cursor_position` 的配置覆盖项。'
        double_click:
          anyOf:
            - $ref: '#/components/schemas/ComputerDoubleClickConfig'
            - type: 'null'
          description: '`double_click` 的配置覆盖项。'
        hold_key:
          anyOf:
            - $ref: '#/components/schemas/ComputerHoldKeyConfig'
            - type: 'null'
          description: '`hold_key` 的配置覆盖项。'
        key:
          anyOf:
            - $ref: '#/components/schemas/ComputerKeyConfig'
            - type: 'null'
          description: '`key` 的配置覆盖项。'
        left_click:
          anyOf:
            - $ref: '#/components/schemas/ComputerLeftClickConfig'
            - type: 'null'
          description: '`left_click` 的配置覆盖项。'
        left_click_drag:
          anyOf:
            - $ref: '#/components/schemas/ComputerLeftClickDragConfig'
            - type: 'null'
          description: '`left_click_drag` 的配置覆盖项。'
        left_mouse_down:
          anyOf:
            - $ref: '#/components/schemas/ComputerLeftMouseDownConfig'
            - type: 'null'
          description: '`left_mouse_down` 的配置覆盖项。'
        left_mouse_up:
          anyOf:
            - $ref: '#/components/schemas/ComputerLeftMouseUpConfig'
            - type: 'null'
          description: '`left_mouse_up` 的配置覆盖项。'
        middle_click:
          anyOf:
            - $ref: '#/components/schemas/ComputerMiddleClickConfig'
            - type: 'null'
          description: '`middle_click` 的配置覆盖项。'
        mouse_move:
          anyOf:
            - $ref: '#/components/schemas/ComputerMouseMoveConfig'
            - type: 'null'
          description: '`mouse_move` 的配置覆盖项。'
        right_click:
          anyOf:
            - $ref: '#/components/schemas/ComputerRightClickConfig'
            - type: 'null'
          description: '`right_click` 的配置覆盖项。'
        screenshot:
          anyOf:
            - $ref: '#/components/schemas/ComputerScreenshotConfig'
            - type: 'null'
          description: '`screenshot` 的配置覆盖项。'
        scroll:
          anyOf:
            - $ref: '#/components/schemas/ComputerScrollConfig'
            - type: 'null'
          description: '`scroll` 的配置覆盖项。'
        triple_click:
          anyOf:
            - $ref: '#/components/schemas/ComputerTripleClickConfig'
            - type: 'null'
          description: '`triple_click` 的配置覆盖项。'
        wait:
          anyOf:
            - $ref: '#/components/schemas/ComputerWaitConfig'
            - type: 'null'
          description: '`wait` 的配置覆盖项。'
        zoom:
          anyOf:
            - $ref: '#/components/schemas/ComputerZoomConfig'
            - type: 'null'
          description: '`zoom` 的配置覆盖项。'
    UserLocation:
      type: object
      properties:
        type:
          type: string
          const: approximate
        city:
          anyOf:
            - type: string
            - type: 'null'
          description: 用户所在城市。
          minLength: 1
          maxLength: 255
        country:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            用户所在国家/地区的两位字母 [ISO
            国家代码](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)。
          minLength: 2
          maxLength: 2
        region:
          anyOf:
            - type: string
            - type: 'null'
          description: 用户所在地区。
          minLength: 1
          maxLength: 255
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          description: 用户的 [IANA 时区](https://nodatime.org/TimeZones)。
          minLength: 1
          maxLength: 255
      required:
        - type
    CitationsConfigParam:
      type: object
      properties:
        enabled:
          type: boolean
    WebFetchURLSources:
      type: object
      properties:
        client_tool_results:
          anyOf:
            - $ref: '#/components/schemas/WebFetchURLSourceAll'
            - $ref: '#/components/schemas/WebFetchURLSourceNone'
            - $ref: '#/components/schemas/WebFetchURLSourceOnly'
            - $ref: '#/components/schemas/WebFetchURLSourceExcept'
          description: >-
            哪些客户端工具的结果可提供可抓取的 URL："all"、"none"，或由 tools[] 中客户端工具名称组成的 only 或
            except 列表。
        server_tool_results:
          anyOf:
            - $ref: '#/components/schemas/WebFetchURLSourceAll'
            - $ref: '#/components/schemas/WebFetchURLSourceNone'
            - $ref: '#/components/schemas/WebFetchURLSourceOnly'
            - $ref: '#/components/schemas/WebFetchURLSourceExcept'
          description: >-
            哪些服务端工具的结果可提供可抓取的 URL："all"、"none"，或由 tools[] 中服务端工具名称组成的 only 或
            except 列表；只有 web_search 和 web_fetch 的结果才会提供 URL。
        user_input:
          anyOf:
            - $ref: '#/components/schemas/WebFetchURLSourceAll'
            - $ref: '#/components/schemas/WebFetchURLSourceNone'
          description: 用户消息中的 URL 是否可被抓取："all" 或 "none"。
    TextCitation:
      anyOf:
        - $ref: '#/components/schemas/CitationCharLocation'
        - $ref: '#/components/schemas/CitationPageLocation'
        - $ref: '#/components/schemas/CitationContentBlockLocation'
        - $ref: '#/components/schemas/CitationsWebSearchResultLocation'
        - $ref: '#/components/schemas/CitationsSearchResultLocation'
    DirectCaller:
      type: object
      properties:
        type:
          type: string
          const: direct
      required:
        - type
      description: 由模型直接发起的工具调用。
    ServerToolCaller:
      type: object
      properties:
        type:
          type: string
          const: code_execution_20250825
        tool_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - tool_id
      description: 由服务端工具生成的工具调用。
    ServerToolCaller20260120:
      type: object
      properties:
        type:
          type: string
          const: code_execution_20260120
        tool_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - tool_id
    WebSearchToolResultBlockContent:
      anyOf:
        - $ref: '#/components/schemas/WebSearchToolResultError'
        - type: array
          items:
            $ref: '#/components/schemas/WebSearchResultBlock'
    WebFetchToolResultErrorBlock:
      type: object
      properties:
        type:
          type: string
          const: web_fetch_tool_result_error
        error_code:
          $ref: '#/components/schemas/WebFetchToolResultErrorCode'
      required:
        - type
        - error_code
    WebFetchBlock:
      type: object
      properties:
        type:
          type: string
          const: web_fetch_result
        content:
          $ref: '#/components/schemas/DocumentBlock'
        retrieved_at:
          anyOf:
            - type: string
            - type: 'null'
          description: 获取内容时的 ISO 8601 时间戳
        url:
          type: string
          description: 所抓取内容的 URL
      required:
        - type
        - content
        - retrieved_at
        - url
    CodeExecutionToolResultBlockContent:
      anyOf:
        - $ref: '#/components/schemas/CodeExecutionToolResultError'
        - $ref: '#/components/schemas/CodeExecutionResultBlock'
        - $ref: '#/components/schemas/EncryptedCodeExecutionResultBlock'
    BashCodeExecutionToolResultError:
      type: object
      properties:
        type:
          type: string
          const: bash_code_execution_tool_result_error
        error_code:
          $ref: '#/components/schemas/BashCodeExecutionToolResultErrorCode'
      required:
        - type
        - error_code
    BashCodeExecutionResultBlock:
      type: object
      properties:
        type:
          type: string
          const: bash_code_execution_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/BashCodeExecutionOutputBlock'
        return_code:
          type: number
        stderr:
          type: string
        stdout:
          type: string
      required:
        - type
        - content
        - return_code
        - stderr
        - stdout
    TextEditorCodeExecutionToolResultError:
      type: object
      properties:
        type:
          type: string
          const: text_editor_code_execution_tool_result_error
        error_code:
          $ref: '#/components/schemas/TextEditorCodeExecutionToolResultErrorCode'
        error_message:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - error_code
        - error_message
    TextEditorCodeExecutionViewResultBlock:
      type: object
      properties:
        type:
          type: string
          const: text_editor_code_execution_view_result
        content:
          type: string
        file_type:
          type: string
          enum:
            - text
            - image
            - pdf
        num_lines:
          anyOf:
            - type: number
            - type: 'null'
        start_line:
          anyOf:
            - type: number
            - type: 'null'
        total_lines:
          anyOf:
            - type: number
            - type: 'null'
      required:
        - type
        - content
        - file_type
        - num_lines
        - start_line
        - total_lines
    TextEditorCodeExecutionCreateResultBlock:
      type: object
      properties:
        type:
          type: string
          const: text_editor_code_execution_create_result
        is_file_update:
          type: boolean
      required:
        - type
        - is_file_update
    TextEditorCodeExecutionStrReplaceResultBlock:
      type: object
      properties:
        type:
          type: string
          const: text_editor_code_execution_str_replace_result
        lines:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        new_lines:
          anyOf:
            - type: number
            - type: 'null'
        new_start:
          anyOf:
            - type: number
            - type: 'null'
        old_lines:
          anyOf:
            - type: number
            - type: 'null'
        old_start:
          anyOf:
            - type: number
            - type: 'null'
      required:
        - type
        - lines
        - new_lines
        - new_start
        - old_lines
        - old_start
    ToolSearchToolResultError:
      type: object
      properties:
        type:
          type: string
          const: tool_search_tool_result_error
        error_code:
          $ref: '#/components/schemas/ToolSearchToolResultErrorCode'
        error_message:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - error_code
        - error_message
    ToolSearchToolSearchResultBlock:
      type: object
      properties:
        type:
          type: string
          const: tool_search_tool_search_result
        tool_references:
          type: array
          items:
            $ref: '#/components/schemas/ToolReferenceBlock'
      required:
        - type
        - tool_references
    CacheMissModelChanged:
      type: object
      properties:
        type:
          type: string
          const: model_changed
        cache_missed_input_tokens:
          type: number
          description: 如果前缀与上一次请求匹配，本可从缓存中读取的输入 Token 近似数量。
      required:
        - type
        - cache_missed_input_tokens
      description: >-
        一种 `cache_miss_reason`，表示请求的 `model` 或 `speed` 与上一次请求不同。


        各原因对应的调整方法请参阅[缓存诊断指南](https://platform.claude.com/docs/en/build-with-claude/cache-diagnostics#cache-miss-reason-types)。
    CacheMissSystemChanged:
      type: object
      properties:
        type:
          type: string
          const: system_changed
        cache_missed_input_tokens:
          type: number
          description: 如果前缀与上一次请求匹配，本可从缓存中读取的输入 Token 近似数量。
      required:
        - type
        - cache_missed_input_tokens
      description: >-
        一种 `cache_miss_reason`，表示请求的 `system` 与上一次请求不同。


        各原因对应的调整方法请参阅[缓存诊断指南](https://platform.claude.com/docs/en/build-with-claude/cache-diagnostics#cache-miss-reason-types)。
    CacheMissToolsChanged:
      type: object
      properties:
        type:
          type: string
          const: tools_changed
        cache_missed_input_tokens:
          type: number
          description: 如果前缀与上一次请求匹配，本可从缓存中读取的输入 Token 近似数量。
      required:
        - type
        - cache_missed_input_tokens
      description: >-
        一种 `cache_miss_reason`，表示请求的 `tools` 与上一次请求不同，例如工具被添加、移除或重新排序。


        各原因对应的调整方法请参阅[缓存诊断指南](https://platform.claude.com/docs/en/build-with-claude/cache-diagnostics#cache-miss-reason-types)。
    CacheMissMessagesChanged:
      type: object
      properties:
        type:
          type: string
          const: messages_changed
        cache_missed_input_tokens:
          type: number
          description: 如果前缀与上一次请求匹配，本可从缓存中读取的输入 Token 近似数量。
      required:
        - type
        - cache_missed_input_tokens
      description: >-
        一种 `cache_miss_reason`，表示请求的 `messages`
        在较早的条目上与上一次请求不同，而不仅仅是追加了新条目。`model`、`system` 和 `tools` 均一致。


        各原因对应的调整方法请参阅[缓存诊断指南](https://platform.claude.com/docs/en/build-with-claude/cache-diagnostics#cache-miss-reason-types)。
    CacheMissPreviousMessageNotFound:
      type: object
      properties:
        type:
          type: string
          const: previous_message_not_found
      required:
        - type
      description: >-
        一种 `cache_miss_reason`，表示 API 中没有 `diagnostics.previous_message_id`
        所引用请求的存储记录。


        这并不意味着本次请求发生了变化。


        各原因对应的调整方法请参阅[缓存诊断指南](https://platform.claude.com/docs/en/build-with-claude/cache-diagnostics#cache-miss-reason-types)。
    CacheMissUnavailable:
      type: object
      properties:
        type:
          type: string
          const: unavailable
      required:
        - type
      description: >-
        一种 `cache_miss_reason`，表示 API 无法给出诊断。请求本身已正常处理。


        这包括请求的 `model`、`system` 和 `tools` 与上一次请求一致，但其他影响提示词的参数（例如 `thinking` 或
        `tool_choice`）不同的情况。


        各原因对应的调整方法请参阅[缓存诊断指南](https://platform.claude.com/docs/en/build-with-claude/cache-diagnostics#cache-miss-reason-types)。
    TextDelta:
      type: object
      properties:
        type:
          type: string
          const: text_delta
        text:
          type: string
      required:
        - type
        - text
    InputJSONDelta:
      type: object
      properties:
        type:
          type: string
          const: input_json_delta
        partial_json:
          type: string
      required:
        - type
        - partial_json
    CitationsDelta:
      type: object
      properties:
        type:
          type: string
          const: citations_delta
        citation:
          anyOf:
            - $ref: '#/components/schemas/CitationCharLocation'
            - $ref: '#/components/schemas/CitationPageLocation'
            - $ref: '#/components/schemas/CitationContentBlockLocation'
            - $ref: '#/components/schemas/CitationsWebSearchResultLocation'
            - $ref: '#/components/schemas/CitationsSearchResultLocation'
      required:
        - type
        - citation
    ThinkingDelta:
      type: object
      properties:
        type:
          type: string
          const: thinking_delta
        thinking:
          type: string
          description: >-
            该内容块增量的 `thinking` 文本。将连续 `thinking_delta` 事件的 `thinking`
            值拼接起来，即可得到该块完整的 `thinking` 值。
      required:
        - type
        - thinking
    SignatureDelta:
      type: object
      properties:
        type:
          type: string
          const: signature_delta
        signature:
          type: string
          description: >-
            该思考块的 `signature`：一个不透明值，在将该块回传给 API 时用于验证其由 Claude 生成。通过
            `signature_delta` 事件下发，紧接在该块的 `content_block_stop` 事件之前。
      required:
        - type
        - signature
    ContentBlockParam:
      anyOf:
        - $ref: '#/components/schemas/TextBlockParam'
        - $ref: '#/components/schemas/ImageBlockParam'
        - $ref: '#/components/schemas/DocumentBlockParam'
        - $ref: '#/components/schemas/SearchResultBlockParam'
        - $ref: '#/components/schemas/ThinkingBlockParam'
        - $ref: '#/components/schemas/RedactedThinkingBlockParam'
        - $ref: '#/components/schemas/ToolUseBlockParam'
        - $ref: '#/components/schemas/ToolResultBlockParam'
        - $ref: '#/components/schemas/ServerToolUseBlockParam'
        - $ref: '#/components/schemas/WebSearchToolResultBlockParam'
        - $ref: '#/components/schemas/WebFetchToolResultBlockParam'
        - $ref: '#/components/schemas/CodeExecutionToolResultBlockParam'
        - $ref: '#/components/schemas/BashCodeExecutionToolResultBlockParam'
        - $ref: '#/components/schemas/TextEditorCodeExecutionToolResultBlockParam'
        - $ref: '#/components/schemas/ToolSearchToolResultBlockParam'
        - $ref: '#/components/schemas/ContainerUploadBlockParam'
    BrowserTypeConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserCloseTabConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserDoubleClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserFileUploadConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserFindConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserFormInputConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserGetPageTextConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserHoldKeyConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserHoverConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserJavascriptExecConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserKeyConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserLeftClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserLeftClickDragConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserLeftMouseDownConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserLeftMouseUpConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserListTabsConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserMiddleClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserMouseMoveConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserNavigateConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserNewTabConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserReadConsoleConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserReadNetworkConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserReadPageConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserRightClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserScreenshotConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserScrollConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserScrollToConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserSwitchTabConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserTripleClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserWaitConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    BrowserZoomConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerTypeConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerCursorPositionConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerDoubleClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerHoldKeyConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerKeyConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerLeftClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerLeftClickDragConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerLeftMouseDownConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerLeftMouseUpConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerMiddleClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerMouseMoveConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerRightClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerScreenshotConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerScrollConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerTripleClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerWaitConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    ComputerZoomConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
          description: 延迟加载该成员。在工具集中所有已启用的成员上，该值必须解析为相同的值。
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            是否向模型提供该成员。默认值因成员而异，参见工具集文档。enabled 解析为 false 的成员不会出现在提供给模型的 Schema
            中。
    WebFetchURLSourceAll:
      type: object
      properties:
        type:
          type: string
          const: all
      required:
        - type
      description: '`url_sources` 的一种变体，表示来源完整参与：工具过滤器对应来源的所有结果，或全部用户输入。'
    WebFetchURLSourceNone:
      type: object
      properties:
        type:
          type: string
          const: none
      required:
        - type
      description: '`url_sources` 的一种变体，表示来源不参与：工具过滤器对应来源的任何结果都不参与，或不使用任何用户输入。'
    WebFetchURLSourceOnly:
      type: object
      properties:
        type:
          type: string
          const: only
        tools:
          type: array
          items:
            $ref: '#/components/schemas/WebFetchURLSourceToolReference'
      required:
        - type
        - tools
      description: 工具过滤器的一种变体，表示仅指定工具的结果参与。
    WebFetchURLSourceExcept:
      type: object
      properties:
        type:
          type: string
          const: except
        tools:
          type: array
          items:
            $ref: '#/components/schemas/WebFetchURLSourceToolReference'
      required:
        - type
        - tools
      description: 工具过滤器的一种变体，表示除指定工具外的所有结果均参与。
    CitationCharLocation:
      type: object
      properties:
        type:
          type: string
          const: char_location
        cited_text:
          type: string
        document_index:
          type: number
          minimum: 0
        document_title:
          anyOf:
            - type: string
            - type: 'null'
        end_char_index:
          type: number
        file_id:
          anyOf:
            - type: string
            - type: 'null'
        start_char_index:
          type: number
          minimum: 0
      required:
        - type
        - cited_text
        - document_index
        - document_title
        - end_char_index
        - file_id
        - start_char_index
    CitationPageLocation:
      type: object
      properties:
        type:
          type: string
          const: page_location
        cited_text:
          type: string
        document_index:
          type: number
          minimum: 0
        document_title:
          anyOf:
            - type: string
            - type: 'null'
        end_page_number:
          type: number
        file_id:
          anyOf:
            - type: string
            - type: 'null'
        start_page_number:
          type: number
          minimum: 1
      required:
        - type
        - cited_text
        - document_index
        - document_title
        - end_page_number
        - file_id
        - start_page_number
    CitationContentBlockLocation:
      type: object
      properties:
        type:
          type: string
          const: content_block_location
        cited_text:
          type: string
          description: >-
            被引用块范围的完整文本（拼接而成）。


            始终等于 `content[start_block_index:end_block_index]`
            内容拼接后的结果。文本块是最小的可引用单元；该字段绝不会是单个块的子字符串。不计入输出 Token，在后续轮次中回传时也不计入输入
            Token。
        document_index:
          type: number
          minimum: 0
        document_title:
          anyOf:
            - type: string
            - type: 'null'
        end_block_index:
          type: number
          description: >-
            被引用块范围在来源 `content` 数组中的结束索引（从 0 开始，不含该位置）。


            始终大于 `start_block_index`；单块引用满足 `end_block_index = start_block_index
            + 1`。
        file_id:
          anyOf:
            - type: string
            - type: 'null'
        start_block_index:
          type: number
          description: 第一个被引用块在来源 `content` 数组中的索引（从 0 开始）。
          minimum: 0
      required:
        - type
        - cited_text
        - document_index
        - document_title
        - end_block_index
        - file_id
        - start_block_index
    CitationsWebSearchResultLocation:
      type: object
      properties:
        type:
          type: string
          const: web_search_result_location
        cited_text:
          type: string
        encrypted_index:
          type: string
        title:
          anyOf:
            - type: string
            - type: 'null'
          maxLength: 512
        url:
          type: string
      required:
        - type
        - cited_text
        - encrypted_index
        - title
        - url
    CitationsSearchResultLocation:
      type: object
      properties:
        type:
          type: string
          const: search_result_location
        cited_text:
          type: string
          description: >-
            被引用块范围的完整文本（拼接而成）。


            始终等于 `content[start_block_index:end_block_index]`
            内容拼接后的结果。文本块是最小的可引用单元；该字段绝不会是单个块的子字符串。不计入输出 Token，在后续轮次中回传时也不计入输入
            Token。
        end_block_index:
          type: number
          description: >-
            被引用块范围在来源 `content` 数组中的结束索引（从 0 开始，不含该位置）。


            始终大于 `start_block_index`；单块引用满足 `end_block_index = start_block_index
            + 1`。
        search_result_index:
          type: number
          description: |-
            被引用的搜索结果在请求中所有 `search_result` 内容块中的索引（从 0 开始），按其在各条消息和工具结果中出现的顺序计数。

            与 `document_index` 分开计数；服务端网页搜索结果不计入此计数。
          minimum: 0
        source:
          type: string
        start_block_index:
          type: number
          description: 第一个被引用块在来源 `content` 数组中的索引（从 0 开始）。
          minimum: 0
        title:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - cited_text
        - end_block_index
        - search_result_index
        - source
        - start_block_index
        - title
    WebSearchToolResultError:
      type: object
      properties:
        type:
          type: string
          const: web_search_tool_result_error
        error_code:
          $ref: '#/components/schemas/WebSearchToolResultErrorCode'
      required:
        - type
        - error_code
    WebSearchResultBlock:
      type: object
      properties:
        type:
          type: string
          const: web_search_result
        encrypted_content:
          type: string
        page_age:
          anyOf:
            - type: string
            - type: 'null'
        title:
          type: string
        url:
          type: string
      required:
        - type
        - encrypted_content
        - page_age
        - title
        - url
    WebFetchToolResultErrorCode:
      type: string
      enum:
        - invalid_tool_input
        - url_too_long
        - url_not_allowed
        - url_not_in_prior_context
        - url_not_accessible
        - unsupported_content_type
        - too_many_requests
        - max_uses_exceeded
        - unavailable
        - content_too_large
    DocumentBlock:
      type: object
      properties:
        type:
          type: string
          const: document
        citations:
          anyOf:
            - $ref: '#/components/schemas/CitationsConfig'
            - type: 'null'
          description: 文档的引用配置
        source:
          anyOf:
            - $ref: '#/components/schemas/Base64PDFSource'
            - $ref: '#/components/schemas/PlainTextSource'
        title:
          anyOf:
            - type: string
            - type: 'null'
          description: 文档标题
      required:
        - type
        - citations
        - source
        - title
    CodeExecutionToolResultError:
      type: object
      properties:
        type:
          type: string
          const: code_execution_tool_result_error
        error_code:
          $ref: '#/components/schemas/CodeExecutionToolResultErrorCode'
      required:
        - type
        - error_code
    CodeExecutionResultBlock:
      type: object
      properties:
        type:
          type: string
          const: code_execution_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/CodeExecutionOutputBlock'
        return_code:
          type: number
        stderr:
          type: string
        stdout:
          type: string
      required:
        - type
        - content
        - return_code
        - stderr
        - stdout
    EncryptedCodeExecutionResultBlock:
      type: object
      properties:
        type:
          type: string
          const: encrypted_code_execution_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/CodeExecutionOutputBlock'
        encrypted_stdout:
          type: string
        return_code:
          type: number
        stderr:
          type: string
      required:
        - type
        - content
        - encrypted_stdout
        - return_code
        - stderr
      description: >-
        Claude 通过代码执行工具运行的 Python 代码的输出和退出码，其中标准输出为加密形式。


        当代码调用了网页搜索工具时，API 会返回此块来代替 `code_execution_result`。


        关于程序化工具调用的更多信息，请参阅[程序化工具调用指南](https://platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling)。
    BashCodeExecutionToolResultErrorCode:
      type: string
      enum:
        - invalid_tool_input
        - unavailable
        - too_many_requests
        - execution_time_exceeded
        - output_file_too_large
    BashCodeExecutionOutputBlock:
      type: object
      properties:
        type:
          type: string
          const: bash_code_execution_output
        file_id:
          type: string
      required:
        - type
        - file_id
    TextEditorCodeExecutionToolResultErrorCode:
      type: string
      enum:
        - invalid_tool_input
        - unavailable
        - too_many_requests
        - execution_time_exceeded
        - file_not_found
    ToolSearchToolResultErrorCode:
      type: string
      enum:
        - invalid_tool_input
        - unavailable
        - too_many_requests
        - execution_time_exceeded
    ToolReferenceBlock:
      type: object
      properties:
        type:
          type: string
          const: tool_reference
        tool_name:
          type: string
          minLength: 1
          maxLength: 256
          pattern: ^[a-zA-Z0-9_-]{1,256}$
      required:
        - type
        - tool_name
    ImageBlockParam:
      type: object
      properties:
        type:
          type: string
          const: image
        source:
          anyOf:
            - $ref: '#/components/schemas/Base64ImageSource'
            - $ref: '#/components/schemas/URLImageSource'
            - $ref: '#/components/schemas/FileImageSource'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        transformations:
          anyOf:
            - $ref: '#/components/schemas/ImageTransformationsParam'
            - type: 'null'
          description: >-
            配置服务端在模型查看该图片之前对其应用的变换。每个键表示服务端需要对图片进行变换的一种条件，其值选择所应用的变换。省略的键保持默认行为，空对象等同于省略该字段。
      required:
        - type
        - source
    DocumentBlockParam:
      type: object
      properties:
        type:
          type: string
          const: document
        source:
          anyOf:
            - $ref: '#/components/schemas/Base64PDFSource'
            - $ref: '#/components/schemas/PlainTextSource'
            - $ref: '#/components/schemas/ContentBlockSource'
            - $ref: '#/components/schemas/URLPDFSource'
            - $ref: '#/components/schemas/FileDocumentSource'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        citations:
          anyOf:
            - $ref: '#/components/schemas/CitationsConfigParam'
            - type: 'null'
        context:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
        title:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 500
      required:
        - type
        - source
    SearchResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: search_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/TextBlockParam'
        source:
          type: string
        title:
          type: string
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        citations:
          $ref: '#/components/schemas/CitationsConfigParam'
      required:
        - type
        - content
        - source
        - title
    ThinkingBlockParam:
      type: object
      properties:
        type:
          type: string
          const: thinking
        signature:
          type: string
          description: |-
            该思考块的 `signature` 值，须与 API 在先前响应中返回的值完全一致。用于验证该块由 Claude 生成。

            思考块必须保持原样并按原始顺序回传；块被修改将导致 400 `invalid_request_error`。
        thinking:
          type: string
          description: API 返回的该块的 `thinking` 文本。
      required:
        - type
        - signature
        - thinking
    RedactedThinkingBlockParam:
      type: object
      properties:
        type:
          type: string
          const: redacted_thinking
        data:
          type: string
          description: 该已脱敏思考块的 `data` 值，须与 API 在先前响应中返回的值完全一致。该值不透明且已加密，请原样回传。
      required:
        - type
        - data
    ToolUseBlockParam:
      type: object
      properties:
        type:
          type: string
          const: tool_use
        id:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        input:
          type: object
          additionalProperties: true
        name:
          type: string
          minLength: 1
          maxLength: 200
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        caller:
          anyOf:
            - $ref: '#/components/schemas/DirectCaller'
            - $ref: '#/components/schemas/ServerToolCaller'
            - $ref: '#/components/schemas/ServerToolCaller20260120'
        toolset_name:
          anyOf:
            - type: string
            - type: 'null'
          description: 对于工具集成员的 tool_use，表示该成员所属的工具集系列。
          minLength: 1
          maxLength: 64
          pattern: ^[a-zA-Z0-9_-]+$
      required:
        - type
        - id
        - input
        - name
    ToolResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: tool_result
        tool_use_id:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        content:
          anyOf:
            - type: string
            - type: array
              items:
                anyOf:
                  - $ref: '#/components/schemas/TextBlockParam'
                  - $ref: '#/components/schemas/ImageBlockParam'
                  - $ref: '#/components/schemas/SearchResultBlockParam'
                  - $ref: '#/components/schemas/DocumentBlockParam'
                  - $ref: '#/components/schemas/ToolReferenceBlockParam'
                  - $ref: '#/components/schemas/BrowserStateBlockParam'
        is_error:
          type: boolean
        toolset_name:
          anyOf:
            - type: string
            - type: 'null'
          description: 对于工具集成员的 tool_result，表示与之配对的 tool_use 所属的工具集系列。
          minLength: 1
          maxLength: 64
          pattern: ^[a-zA-Z0-9_-]+$
      required:
        - type
        - tool_use_id
    ServerToolUseBlockParam:
      type: object
      properties:
        type:
          type: string
          const: server_tool_use
        id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        input:
          type: object
          additionalProperties: true
        name:
          type: string
          enum:
            - web_search
            - web_fetch
            - code_execution
            - bash_code_execution
            - text_editor_code_execution
            - tool_search_tool_regex
            - tool_search_tool_bm25
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        caller:
          anyOf:
            - $ref: '#/components/schemas/DirectCaller'
            - $ref: '#/components/schemas/ServerToolCaller'
            - $ref: '#/components/schemas/ServerToolCaller20260120'
      required:
        - type
        - id
        - input
        - name
    WebSearchToolResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: web_search_tool_result
        content:
          $ref: '#/components/schemas/WebSearchToolResultBlockParamContent'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        caller:
          anyOf:
            - $ref: '#/components/schemas/DirectCaller'
            - $ref: '#/components/schemas/ServerToolCaller'
            - $ref: '#/components/schemas/ServerToolCaller20260120'
      required:
        - type
        - content
        - tool_use_id
    WebFetchToolResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: web_fetch_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/WebFetchToolResultErrorBlockParam'
            - $ref: '#/components/schemas/WebFetchBlockParam'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        caller:
          anyOf:
            - $ref: '#/components/schemas/DirectCaller'
            - $ref: '#/components/schemas/ServerToolCaller'
            - $ref: '#/components/schemas/ServerToolCaller20260120'
      required:
        - type
        - content
        - tool_use_id
    CodeExecutionToolResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: code_execution_tool_result
        content:
          $ref: '#/components/schemas/CodeExecutionToolResultBlockParamContent'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
      required:
        - type
        - content
        - tool_use_id
    BashCodeExecutionToolResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: bash_code_execution_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/BashCodeExecutionToolResultErrorParam'
            - $ref: '#/components/schemas/BashCodeExecutionResultBlockParam'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
      required:
        - type
        - content
        - tool_use_id
    TextEditorCodeExecutionToolResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: text_editor_code_execution_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/TextEditorCodeExecutionToolResultErrorParam'
            - $ref: '#/components/schemas/TextEditorCodeExecutionViewResultBlockParam'
            - $ref: >-
                #/components/schemas/TextEditorCodeExecutionCreateResultBlockParam
            - $ref: >-
                #/components/schemas/TextEditorCodeExecutionStrReplaceResultBlockParam
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
      required:
        - type
        - content
        - tool_use_id
    ToolSearchToolResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: tool_search_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/ToolSearchToolResultErrorParam'
            - $ref: '#/components/schemas/ToolSearchToolSearchResultBlockParam'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
      required:
        - type
        - content
        - tool_use_id
    ContainerUploadBlockParam:
      type: object
      properties:
        type:
          type: string
          const: container_upload
        file_id:
          type: string
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
      required:
        - type
        - file_id
      description: 表示要上传到容器的文件的内容块。通过该块上传的文件将出现在容器的输入目录中。
    WebFetchURLSourceToolReference:
      type: object
      properties:
        type:
          type: string
          const: tool_reference
        name:
          type: string
      required:
        - type
        - name
    WebSearchToolResultErrorCode:
      type: string
      enum:
        - invalid_tool_input
        - unavailable
        - max_uses_exceeded
        - too_many_requests
        - query_too_long
        - request_too_large
    CitationsConfig:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
      required:
        - enabled
    Base64PDFSource:
      type: object
      properties:
        type:
          type: string
          const: base64
        data:
          type: string
          format: byte
        media_type:
          type: string
          const: application/pdf
      required:
        - type
        - data
        - media_type
    PlainTextSource:
      type: object
      properties:
        type:
          type: string
          const: text
        data:
          type: string
        media_type:
          type: string
          const: text/plain
      required:
        - type
        - data
        - media_type
    CodeExecutionToolResultErrorCode:
      type: string
      enum:
        - invalid_tool_input
        - unavailable
        - too_many_requests
        - execution_time_exceeded
    CodeExecutionOutputBlock:
      type: object
      properties:
        type:
          type: string
          const: code_execution_output
        file_id:
          type: string
      required:
        - type
        - file_id
    Base64ImageSource:
      type: object
      properties:
        type:
          type: string
          const: base64
        data:
          type: string
          format: byte
        media_type:
          type: string
          enum:
            - image/jpeg
            - image/png
            - image/gif
            - image/webp
      required:
        - type
        - data
        - media_type
    URLImageSource:
      type: object
      properties:
        type:
          type: string
          const: url
        url:
          type: string
      required:
        - type
        - url
    FileImageSource:
      type: object
      properties:
        type:
          type: string
          const: file
        file_id:
          type: string
      required:
        - type
        - file_id
    ImageTransformationsParam:
      type: object
      properties:
        oversized_image:
          type: string
          enum:
            - downsize
            - error
          description: >-
            当该图片超过模型支持的最大图片尺寸时服务端的处理方式。`"downsize"`（默认）会将图片缩小以适配，这会在不通知你的情况下改变模型所看到的图片尺寸。`"error"`
            则会以 400 错误拒绝请求，错误信息中会注明图片的尺寸以及可适配的最大尺寸，以便你自行缩放图片——图片绝不会被静默缩小。
    ContentBlockSource:
      type: object
      properties:
        type:
          type: string
          const: content
        content:
          anyOf:
            - type: string
            - $ref: '#/components/schemas/ContentBlockSourceContent'
      required:
        - type
        - content
    URLPDFSource:
      type: object
      properties:
        type:
          type: string
          const: url
        url:
          type: string
      required:
        - type
        - url
    FileDocumentSource:
      type: object
      properties:
        type:
          type: string
          const: file
        file_id:
          type: string
      required:
        - type
        - file_id
    ToolReferenceBlockParam:
      type: object
      properties:
        type:
          type: string
          const: tool_reference
        tool_name:
          type: string
          minLength: 1
          maxLength: 256
          pattern: ^[a-zA-Z0-9_-]{1,256}$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
      required:
        - type
        - tool_name
      description: 可包含在 tool_result 内容中的工具引用块。
    BrowserStateBlockParam:
      type: object
      properties:
        type:
          type: string
          const: browser_state
        tabs:
          type: array
          items:
            $ref: '#/components/schemas/BrowserStateTabEntry'
          description: '本次调用后浏览器中所有已打开的标签页——这是完整清单，而非增量。可能为空。只要非空，就恰好有一个条目带有 `active: true`。'
          maxItems: 100
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/CacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
        state_changes:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/BrowserStateChange'
            - type: 'null'
          description: 本次调用期间打开的标签页及下载状态变化。“无可报告内容”通过省略该字段表示，绝不使用空列表。
          minItems: 1
          maxItems: 200
      required:
        - type
        - tabs
      description: >-
        浏览器工具集成员调用之后调用方的浏览器状态——包括所有已打开标签页的完整清单、当前活动标签页，以及本次调用产生的副作用（打开的标签页、下载状态变化）。


        每个 `tool_result` 最多一个，且仅出现在响应浏览器工具集成员 `tool_use`
        的非错误结果中。服务端据此渲染出模型可见的文本；模型永远看不到原始字段。
    WebSearchToolResultBlockParamContent:
      anyOf:
        - $ref: '#/components/schemas/WebSearchToolResultBlockItem'
        - $ref: '#/components/schemas/WebSearchToolRequestError'
    WebFetchToolResultErrorBlockParam:
      type: object
      properties:
        type:
          type: string
          const: web_fetch_tool_result_error
        error_code:
          $ref: '#/components/schemas/WebFetchToolResultErrorCode'
      required:
        - type
        - error_code
    WebFetchBlockParam:
      type: object
      properties:
        type:
          type: string
          const: web_fetch_result
        content:
          $ref: '#/components/schemas/DocumentBlockParam'
        url:
          type: string
          description: 所抓取内容的 URL
        retrieved_at:
          anyOf:
            - type: string
            - type: 'null'
          description: 获取内容时的 ISO 8601 时间戳
      required:
        - type
        - content
        - url
    CodeExecutionToolResultBlockParamContent:
      anyOf:
        - $ref: '#/components/schemas/CodeExecutionToolResultErrorParam'
        - $ref: '#/components/schemas/CodeExecutionResultBlockParam'
        - $ref: '#/components/schemas/EncryptedCodeExecutionResultBlockParam'
    BashCodeExecutionToolResultErrorParam:
      type: object
      properties:
        type:
          type: string
          const: bash_code_execution_tool_result_error
        error_code:
          $ref: '#/components/schemas/BashCodeExecutionToolResultErrorCode'
      required:
        - type
        - error_code
    BashCodeExecutionResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: bash_code_execution_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/BashCodeExecutionOutputBlockParam'
        return_code:
          type: number
        stderr:
          type: string
        stdout:
          type: string
      required:
        - type
        - content
        - return_code
        - stderr
        - stdout
    TextEditorCodeExecutionToolResultErrorParam:
      type: object
      properties:
        type:
          type: string
          const: text_editor_code_execution_tool_result_error
        error_code:
          $ref: '#/components/schemas/TextEditorCodeExecutionToolResultErrorCode'
        error_message:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - error_code
    TextEditorCodeExecutionViewResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: text_editor_code_execution_view_result
        content:
          type: string
        file_type:
          type: string
          enum:
            - text
            - image
            - pdf
        num_lines:
          anyOf:
            - type: number
            - type: 'null'
        start_line:
          anyOf:
            - type: number
            - type: 'null'
        total_lines:
          anyOf:
            - type: number
            - type: 'null'
      required:
        - type
        - content
        - file_type
    TextEditorCodeExecutionCreateResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: text_editor_code_execution_create_result
        is_file_update:
          type: boolean
      required:
        - type
        - is_file_update
    TextEditorCodeExecutionStrReplaceResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: text_editor_code_execution_str_replace_result
        lines:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        new_lines:
          anyOf:
            - type: number
            - type: 'null'
        new_start:
          anyOf:
            - type: number
            - type: 'null'
        old_lines:
          anyOf:
            - type: number
            - type: 'null'
        old_start:
          anyOf:
            - type: number
            - type: 'null'
      required:
        - type
    ToolSearchToolResultErrorParam:
      type: object
      properties:
        type:
          type: string
          const: tool_search_tool_result_error
        error_code:
          $ref: '#/components/schemas/ToolSearchToolResultErrorCode'
        error_message:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - error_code
    ToolSearchToolSearchResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: tool_search_tool_search_result
        tool_references:
          type: array
          items:
            $ref: '#/components/schemas/ToolReferenceBlockParam'
      required:
        - type
        - tool_references
    ContentBlockSourceContent:
      type: array
      items:
        anyOf:
          - $ref: '#/components/schemas/TextBlockParam'
          - $ref: '#/components/schemas/ImageBlockParam'
    BrowserStateTabEntry:
      type: object
      properties:
        tab_id:
          type: string
          description: 调用方为该标签页分配的标识符，在清单中唯一。
          minLength: 1
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        title:
          type: string
          description: 该标签页所显示页面的标题。可能为空。
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        url:
          type: string
          description: 该标签页所显示页面的 URL。可能为空。
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        active:
          type: boolean
          description: '本次调用结束后该标签页是否为活动标签页。只要 `tabs` 非空，就恰好有一个条目被标记为 `active: true`。'
      required:
        - tab_id
        - title
        - url
    BrowserStateChange:
      anyOf:
        - $ref: '#/components/schemas/BrowserStateChangeTabOpened'
        - $ref: '#/components/schemas/BrowserStateChangeDownloadStarted'
        - $ref: '#/components/schemas/BrowserStateChangeDownloadCompleted'
        - $ref: '#/components/schemas/BrowserStateChangeDownloadFailed'
    WebSearchToolResultBlockItem:
      type: array
      items:
        $ref: '#/components/schemas/WebSearchResultBlockParam'
    WebSearchToolRequestError:
      type: object
      properties:
        type:
          type: string
          const: web_search_tool_result_error
        error_code:
          $ref: '#/components/schemas/WebSearchToolResultErrorCode'
      required:
        - type
        - error_code
    CodeExecutionToolResultErrorParam:
      type: object
      properties:
        type:
          type: string
          const: code_execution_tool_result_error
        error_code:
          $ref: '#/components/schemas/CodeExecutionToolResultErrorCode'
      required:
        - type
        - error_code
    CodeExecutionResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: code_execution_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/CodeExecutionOutputBlockParam'
        return_code:
          type: number
        stderr:
          type: string
        stdout:
          type: string
      required:
        - type
        - content
        - return_code
        - stderr
        - stdout
    EncryptedCodeExecutionResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: encrypted_code_execution_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/CodeExecutionOutputBlockParam'
        encrypted_stdout:
          type: string
        return_code:
          type: number
        stderr:
          type: string
      required:
        - type
        - content
        - encrypted_stdout
        - return_code
        - stderr
      description: Claude 通过代码执行工具运行的 Python 代码的输出和退出码，其中标准输出为加密形式，在后续请求中回传。
    BashCodeExecutionOutputBlockParam:
      type: object
      properties:
        type:
          type: string
          const: bash_code_execution_output
        file_id:
          type: string
      required:
        - type
        - file_id
    BrowserStateChangeTabOpened:
      type: object
      properties:
        type:
          type: string
          const: tab_opened
        tab_id:
          type: string
          description: 所打开标签页的 `tab_id`，存在于 `tabs` 中。
          minLength: 1
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
      required:
        - type
        - tab_id
      description: >-
        本次调用执行期间打开、且在调用结束时仍处于打开状态的标签页——即 `tabs` 清单的新增增量，而非事件日志。


        仅携带 `tab_id`；标签页的 `title` 和 `url` 位于其 `tabs` 条目中，该条目必须包含相同的
        `tab_id`。在失败的调用中打开的标签页不会有延迟的 `tab_opened`，而是直接出现在下一次结果的 `tabs` 清单中。
    BrowserStateChangeDownloadStarted:
      type: object
      properties:
        type:
          type: string
          const: download_started
        download_id:
          type: string
          description: 调用方为该下载分配的标识符，在报告其状态变化的各条记录中保持不变。
          minLength: 1
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        url:
          type: string
          description: 下载实际来源的最终 URL（重定向之后）。
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
      required:
        - type
        - download_id
        - url
      description: 本次调用期间开始的文件下载。
    BrowserStateChangeDownloadCompleted:
      type: object
      properties:
        type:
          type: string
          const: download_completed
        download_id:
          type: string
          description: 调用方为该下载分配的标识符，在报告其状态变化的各条记录中保持不变。
          minLength: 1
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        url:
          type: string
          description: 下载实际来源的最终 URL（重定向之后）。
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        path:
          anyOf:
            - type: string
            - type: 'null'
          description: 执行器在其文件系统上保存该文件的位置。仅当同一环境中的其他工具能够通过该路径读取文件时才包含此字段。
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        size_bytes:
          anyOf:
            - type: number
            - type: 'null'
          description: 已完成下载的大小。
          minimum: 0
      required:
        - type
        - download_id
        - url
      description: >-
        本次调用期间完成的文件下载，以与其 `download_started` 相同的 `download_id`
        报告；若下载在启动它的同一次调用中就已完成，则不会有先前的 `download_started`（每个结果中每个 `download_id`
        最多只有一次状态变化）。
    BrowserStateChangeDownloadFailed:
      type: object
      properties:
        type:
          type: string
          const: download_failed
        download_id:
          type: string
          description: 调用方为该下载分配的标识符，在报告其状态变化的各条记录中保持不变。
          minLength: 1
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        url:
          type: string
          description: 下载实际来源的最终 URL（重定向之后）。
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        error:
          anyOf:
            - type: string
            - type: 'null'
          description: 失败或取消的详细信息（如已知）。
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
      required:
        - type
        - download_id
        - url
      description: 本次调用期间失败或被取消的文件下载。
    WebSearchResultBlockParam:
      type: object
      properties:
        type:
          type: string
          const: web_search_result
        encrypted_content:
          type: string
        title:
          type: string
        url:
          type: string
        page_age:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - encrypted_content
        - title
        - url
    CodeExecutionOutputBlockParam:
      type: object
      properties:
        type:
          type: string
          const: code_execution_output
        file_id:
          type: string
      required:
        - type
        - file_id
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 在 `x-api-key` 请求头中传入 DreamTo API Key，Anthropic 官方 SDK 默认使用这种方式。
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        在 `Authorization` 请求头中传入 DreamTo API Key：`Authorization: Bearer <API
        Key>`。

````

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