> ## Documentation Index
> Fetch the complete documentation index at: https://oma-codex-339-workspace-permissions.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 创建消息批处理

> 通过 OMA API 创建消息批处理。

<Info>要使用此处展示的 Beta 请求和响应结构，请同时发送 `?beta=true` 与 `anthropic-beta: message-batches-2024-09-24`。</Info>


## OpenAPI

````yaml /openapi/oma.zh.json post /v1/messages/batches
openapi: 3.1.0
info:
  title: OMA API 参考
  version: 1.0.0
  description: Open Managed Agents 应用 API 参考。
servers:
  - url: http://localhost:38080
    description: 本地 OMA 服务器
security:
  - omaApiKey: []
  - omaBearer: []
paths:
  /v1/messages/batches:
    post:
      summary: 创建消息批处理
      description: 通过 OMA API 创建消息批处理。
      operationId: beta_message_batches_post
      parameters:
        - name: beta
          in: query
          required: true
          description: 为此接口启用 Beta API 合同，必须为 `true`。
          schema:
            type: boolean
            enum:
              - true
        - name: anthropic-beta
          in: header
          required: true
          schema:
            type: string
            items:
              type: string
            description: |-
              用于指定要使用的 beta 版本的可选请求头。

              要使用多个 beta，请使用逗号分隔的列表（如 `beta1,beta2`），或为每个 beta 分别指定该请求头。
            title: Anthropic-Beta
            x-stainless-override-schema:
              x-stainless-param: betas
              x-stainless-extend-default: true
              type: array
              description: 用于指定一个或多个 Beta 版本的可选请求头。
              items:
                $ref: '#/components/schemas/AnthropicBeta'
            x-default: message-batches-2024-09-24
          description: |-
            用于指定要使用的 beta 版本的可选请求头。

            要使用多个 beta，请使用逗号分隔的列表（如 `beta1,beta2`），或为每个 beta 分别指定该请求头。
        - name: anthropic-version
          in: header
          required: false
          schema:
            type: string
            description: |-
              你想使用的 OMA API 版本。

              在此处阅读更多关于版本控制和我们版本历史的信息。
            title: Anthropic-Version
          description: |-
            你想使用的 OMA API 版本。

            在此处阅读更多关于版本控制和我们版本历史的信息。
        - name: anthropic-user-profile-id
          in: header
          required: false
          schema:
            type: string
            description: >-
              用于归属此批次中请求的用户资料 ID。在代表你的组织以外的当事方行事时使用。需要 `user-profiles` beta
              请求头。适用于批次中的每个请求；若单个请求的 `user_profile_id` 正文字段与此请求头冲突，该请求将返回错误。
            title: Anthropic-User-Profile-Id
            x-stainless-param: user_profile_id
          description: >-
            用于归属此批次中请求的用户资料 ID。在代表你的组织以外的当事方行事时使用。需要 `user-profiles` beta
            请求头。适用于批次中的每个请求；若单个请求的 `user_profile_id` 正文字段与此请求头冲突，该请求将返回错误。
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BetaCreateMessageBatchParams'
        required: true
      responses:
        '200':
          description: 成功的响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaMessageBatch'
        4XX:
          description: |-
            错误响应。

            详见我们的错误文档。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
components:
  schemas:
    BetaCreateMessageBatchParams:
      additionalProperties: false
      properties:
        requests:
          description: 提示补全请求列表。每一项都是创建一条消息的独立请求。
          items:
            $ref: '#/components/schemas/BetaMessageBatchIndividualRequestParams'
          maxItems: 100000
          minItems: 1
          title: 请求
          type: array
      required:
        - requests
      title: CreateMessageBatchParams
      type: object
    BetaMessageBatch:
      properties:
        archived_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: 归档时间
          description: 表示消息批处理被归档且其结果不再可用的时间的 RFC 3339 日期时间字符串。
          examples:
            - '2024-08-20T18:37:24.100435Z'
        cancel_initiated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: 取消开始时间
          description: 表示发起取消该消息批处理的时间的 RFC 3339 日期时间字符串。仅在已发起取消时才会指定。
          examples:
            - '2024-08-20T18:37:24.100435Z'
        created_at:
          type: string
          format: date-time
          title: 创建时间
          description: 表示消息批处理创建时间的 RFC 3339 日期时间字符串。
          examples:
            - '2024-08-20T18:37:24.100435Z'
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: 结束时间
          description: |-
            表示消息批处理处理结束时间的 RFC 3339 日期时间字符串。仅在处理结束时指定。

            当消息批处理中的每个请求都已成功、出错、取消或过期时，处理结束。
          examples:
            - '2024-08-20T18:37:24.100435Z'
        expires_at:
          type: string
          format: date-time
          title: 过期时间
          description: 表示消息批处理将到期并结束处理的时间的 RFC 3339 日期时间字符串，即创建后 24 小时。
          examples:
            - '2024-08-20T18:37:24.100435Z'
        id:
          type: string
          title: ID
          description: |-
            唯一的对象标识符。

            ID 的格式和长度可能会随时间变化。
          examples:
            - msgbatch_013Zva2CMHLNnXjNJJKqJ2EF
        processing_status:
          type: string
          enum:
            - in_progress
            - canceling
            - ended
          title: 处理状态
          description: 消息批处理的处理状态。
          examples:
            - in_progress
        request_counts:
          $ref: '#/components/schemas/BetaRequestCounts'
          description: |-
            按状态分类统计消息批处理中的请求。

            请求初始状态为 `processing`，仅在整个批次的处理结束后才会转为其他状态之一。所有值之和始终与批次中的请求总数一致。
        results_url:
          anyOf:
            - type: string
            - type: 'null'
          title: 结果 URL
          description: |-
            包含消息批处理请求结果的 `.jsonl` 文件的 URL。仅在处理结束时指定。

            不保证文件中的结果与请求的顺序一致。请使用 `custom_id` 字段将结果与请求匹配。
          examples:
            - >-
              https://oma.example.com/v1/messages/batches/msgbatch_013Zva2CMHLNnXjNJJKqJ2EF/results
        type:
          type: string
          const: message_batch
          title: 类型
          description: |-
            对象类型。

            对于消息批处理，此值始终为 `"message_batch"`。
          default: message_batch
      type: object
      required:
        - archived_at
        - cancel_initiated_at
        - created_at
        - ended_at
        - expires_at
        - id
        - processing_status
        - request_counts
        - results_url
        - type
      title: MessageBatch
    BetaErrorResponse:
      properties:
        error:
          discriminator:
            mapping:
              api_error:
                $ref: '#/components/schemas/BetaAPIError'
              authentication_error:
                $ref: '#/components/schemas/BetaAuthenticationError'
              billing_error:
                $ref: '#/components/schemas/BetaBillingError'
              invalid_request_error:
                $ref: '#/components/schemas/BetaInvalidRequestError'
              not_found_error:
                $ref: '#/components/schemas/BetaNotFoundError'
              overloaded_error:
                $ref: '#/components/schemas/BetaOverloadedError'
              permission_error:
                $ref: '#/components/schemas/BetaPermissionError'
              rate_limit_error:
                $ref: '#/components/schemas/BetaRateLimitError'
              timeout_error:
                $ref: '#/components/schemas/BetaGatewayTimeoutError'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaInvalidRequestError'
            - $ref: '#/components/schemas/BetaAuthenticationError'
            - $ref: '#/components/schemas/BetaBillingError'
            - $ref: '#/components/schemas/BetaPermissionError'
            - $ref: '#/components/schemas/BetaNotFoundError'
            - $ref: '#/components/schemas/BetaRateLimitError'
            - $ref: '#/components/schemas/BetaGatewayTimeoutError'
            - $ref: '#/components/schemas/BetaAPIError'
            - $ref: '#/components/schemas/BetaOverloadedError'
          title: 错误
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: 请求 ID
        type:
          const: error
          default: error
          title: 类型
          type: string
      required:
        - error
        - request_id
        - type
      title: ErrorResponse
      type: object
    BetaMessageBatchIndividualRequestParams:
      additionalProperties: false
      properties:
        custom_id:
          description: |-
            为消息批处理中的每个请求创建的开发者提供的 ID。由于结果可能不按请求顺序给出，可用于将结果与请求匹配。

            在消息批处理内必须对每个请求唯一。
          examples:
            - my-custom-id-1
          maxLength: 64
          minLength: 1
          pattern: ^[a-zA-Z0-9_-]{1,64}$
          title: 自定义 ID
          type: string
        params:
          $ref: '#/components/schemas/BetaCreateMessageParams'
          description: |-
            该单独请求的消息 API 创建参数。

            有关可用参数的完整文档，请参阅消息 API 参考。
      required:
        - custom_id
        - params
      title: MessageBatchIndividualRequestParams
      type: object
    BetaRequestCounts:
      properties:
        canceled:
          type: integer
          title: 已取消
          description: |-
            消息批处理中已被取消的请求数量。

            在整个消息批处理的处理结束之前，该值始终为零。
          default: 0
          examples:
            - 10
        errored:
          type: integer
          title: 错误数
          description: |-
            消息批处理中遇到错误的请求数量。

            在整个消息批处理的处理结束之前，该值始终为零。
          default: 0
          examples:
            - 30
        expired:
          type: integer
          title: 已过期
          description: |-
            消息批处理中已过期的请求数量。

            在整个消息批处理的处理结束之前，该值始终为零。
          default: 0
          examples:
            - 10
        processing:
          type: integer
          title: 处理中
          description: 消息批处理中正在处理的请求数量。
          default: 0
          examples:
            - 100
        succeeded:
          type: integer
          title: 成功数
          description: |-
            消息批处理中已成功完成的请求数。

            在整个消息批处理处理结束之前，该值为零。
          default: 0
          examples:
            - 50
      type: object
      required:
        - canceled
        - errored
        - expired
        - processing
        - succeeded
      title: RequestCounts
    BetaAPIError:
      properties:
        message:
          default: Internal server error
          title: 消息
          type: string
        type:
          const: api_error
          default: api_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: APIError
      type: object
    BetaAuthenticationError:
      properties:
        message:
          default: Authentication error
          title: 消息
          type: string
        type:
          const: authentication_error
          default: authentication_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: AuthenticationError
      type: object
    BetaBillingError:
      properties:
        message:
          default: Billing error
          title: 消息
          type: string
        type:
          const: billing_error
          default: billing_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: BillingError
      type: object
    BetaInvalidRequestError:
      properties:
        message:
          default: Invalid request
          title: 消息
          type: string
        type:
          const: invalid_request_error
          default: invalid_request_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: InvalidRequestError
      type: object
    BetaNotFoundError:
      properties:
        message:
          default: Not found
          title: 消息
          type: string
        type:
          const: not_found_error
          default: not_found_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: NotFoundError
      type: object
    BetaOverloadedError:
      properties:
        message:
          default: Overloaded
          title: 消息
          type: string
        type:
          const: overloaded_error
          default: overloaded_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: OverloadedError
      type: object
    BetaPermissionError:
      properties:
        message:
          default: Permission denied
          title: 消息
          type: string
        type:
          const: permission_error
          default: permission_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: PermissionError
      type: object
    BetaRateLimitError:
      properties:
        message:
          default: Rate limited
          title: 消息
          type: string
        type:
          const: rate_limit_error
          default: rate_limit_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: RateLimitError
      type: object
    BetaGatewayTimeoutError:
      properties:
        message:
          default: Request timeout
          title: 消息
          type: string
        type:
          const: timeout_error
          default: timeout_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: GatewayTimeoutError
      type: object
    BetaCreateMessageParams:
      additionalProperties: false
      example:
        max_tokens: 1024
        messages:
          - content: Hello, world
            role: user
        model: claude-opus-4-6
      properties:
        model:
          $ref: '#/components/schemas/Model'
        messages:
          description: >-
            输入消息。


            我们的模型经过训练，会在交替的 `user` 和 `assistant` 对话轮次上进行工作。创建新的 `Message` 时，你通过
            `messages` 参数指定先前的对话轮次，模型随后会生成对话中的下一个 `Message`。请求中连续的 `user` 或
            `assistant` 轮次会被合并为一个轮次。


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


            如果最后一条消息使用 `assistant` 角色，响应内容将从该消息的内容直接继续。这可用于约束模型响应的部分内容。


            单条 `user` 消息示例：


            ```json

            [{"role": "user", "content": "Hello, the model"}]

            ```


            多个对话轮次示例：


            ```json

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

            ```


            模型部分填写的响应示例：


            ```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, the model"}

            ```


            ```json

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

            ```


            参见输入示例。


            请注意，如果你想包含系统提示词，可以使用顶层的 `system` 参数——消息 API 的输入消息中没有 `"system"` 角色。


            单个请求最多允许 100,000 条消息。
          items:
            $ref: '#/components/schemas/BetaInputMessage'
          title: 消息
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 顶层缓存控制会自动将 cache_control 标记应用于请求中最后一个可缓存的块。
          title: 缓存控制
        container:
          anyOf:
            - $ref: '#/components/schemas/BetaContainerParams'
            - type: string
            - type: 'null'
          description: 用于跨请求复用的容器标识符。
          title: 容器
        context_management:
          anyOf:
            - $ref: '#/components/schemas/BetaContextManagementConfig'
            - type: 'null'
          description: |-
            上下文管理配置。

            它允许你控制模型如何在多个请求之间管理上下文，例如是否清除函数结果。
        diagnostics:
          anyOf:
            - $ref: '#/components/schemas/BetaDiagnosticsParam'
            - type: 'null'
          description: >-
            请求级诊断信息。提供 `previous_message_id` 后，响应将包含
            `diagnostics.cache_miss_reason`，说明提示缓存与该先前请求之间的任何差异。
        fallback_credit_token:
          anyOf:
            - maxLength: 2048
              minLength: 1
              type: string
            - $ref: '#/components/schemas/BetaFallbackCreditTokenParam'
            - type: 'null'
          description: >-
            来自先前拒绝的 `stop_details` 中的 `fallback_credit_token`。


            当前序请求被拒绝并返回了 `fallback_credit_token`
            时，在重试中通过此处传入该代码，使重试中针对被拒绝模型上已预热前缀的缓存创建令牌按缓存读取费率计费。必须由相同的组织和工作区使用相同的请求正文兑换（可选地追加一条
            `assistant` 消息进行扩展，其内容为部分文本——最终 text 块末尾的空白已被去除——以及拒绝前流式输出的配对
            server-tool 块；设置了 `output_format` 或强制 `tool_choice`
            的请求不能使用追加助手的形式），在符合条件的 fallback 模型上、在相同的 platform 上、且在拒绝发生 5
            分钟内完成；不匹配则为 400。在 server-tool
            循环中途签发且其部分内容可续写的令牌，只能以追加助手的形式兑换——如果完全同正文的重试被 400
            拒绝并提示必须通过继续部分响应来兑换该令牌，则改用追加助手的形式重试。


            当在通常禁止助手回合 prefill 的模型上使用追加助手的形式时，该令牌还会授权该次 prefill。
          title: 回退额度令牌
        fallbacks:
          anyOf:
            - items:
                $ref: '#/components/schemas/BetaFallbackConfigV2'
              maxItems: 3
              minItems: 1
              type: array
            - const: default
              type: string
              title: 默认回退配置
              x-stainless-variantName: Default
            - type: 'null'
          description: >-
            可选启用的服务端重试：当所请求的模型出于策略原因拒绝时，改用一个或多个替代模型重试。按顺序尝试：如果第一个条目也被拒绝，则尝试第二个，依此类推。字符串
            "default" 表示请求使用所请求模型的服务端定义的默认回退配置。
          title: 回退配置
        inference_geo:
          anyOf:
            - type: string
            - type: 'null'
          description: 指定推理处理所使用的地理区域。未指定时，使用工作区的 `default_inference_geo`。
          title: 推理区域
        max_tokens:
          description: |-
            停止前最多生成的令牌数。

            请注意，模型可能在达到该上限_之前_停止。此参数只指定要生成的令牌的绝对上限。

            设为 `0` 可在不生成响应的情况下填充提示缓存。

            不同模型的此参数最大值不同。请参阅[模型列表](/docs/zh/api/models/list-models)。
          examples:
            - 1024
          minimum: 0
          title: 最大令牌数
          type: integer
        mcp_servers:
          description: 本次请求中要使用的 MCP 服务器
          items:
            $ref: '#/components/schemas/BetaRequestMCPServerURLDefinition'
          maxItems: 20
          title: MCP 服务器
          type: array
        metadata:
          $ref: '#/components/schemas/BetaMetadata'
          description: 描述请求元数据的对象。
        output_config:
          $ref: '#/components/schemas/BetaOutputConfig'
          description: 模型输出的配置选项，例如输出格式。
        output_format:
          anyOf:
            - $ref: '#/components/schemas/BetaJsonOutputFormat'
            - type: 'null'
          deprecated: true
          description: |-
            已弃用：请改用 `output_config.format`。参见结构化输出。

            用于指定模型响应的输出格式架构。该参数将在未来版本中移除。
        service_tier:
          description: |-
            决定该请求使用优先容量（如可用）还是标准容量。

            OMA 为你的 API 请求提供不同级别的服务。详见 service-tiers。
          enum:
            - auto
            - standard_only
          title: 服务层级
          type: string
        speed:
          anyOf:
            - $ref: '#/components/schemas/BetaSpeed'
            - type: 'null'
          description: 此请求的推理速度模式。`"fast"` 启用每秒高输出令牌数的推理。
        stop_sequences:
          description: >-
            会使模型停止生成的自定义文本序列。


            我们的模型通常会在自然完成回合时停止，此时响应的 `stop_reason` 为 `"end_turn"`。


            如果你希望模型在遇到自定义文本序列时停止生成，可以使用 `stop_sequences` 参数。如果模型遇到其中一个自定义序列，响应的
            `stop_reason` 值将为 `"stop_sequence"`，响应的 `stop_sequence`
            值将包含匹配到的停止序列。
          items:
            type: string
          title: 停止序列
          type: array
        stream:
          description: |-
            是否使用服务器发送事件增量流式返回响应。

            详情请参阅 streaming。
          title: 流式传输
          type: boolean
          example: false
        system:
          anyOf:
            - type: string
              x-stainless-skip:
                - go
            - items:
                $ref: '#/components/schemas/BetaRequestTextBlock'
              type: array
          description: |-
            系统提示词。

            系统提示词用于向模型提供上下文和指令，例如指定特定的目标或角色。请参阅我们的系统提示词指南。
          examples:
            - - text: Today's date is 2024-06-01.
                type: text
            - Today's date is 2023-01-01.
          title: 系统指令
        temperature:
          deprecated: true
          description: >-
            注入到响应中的随机程度。


            默认为 `1.0`。取值范围为 `0.0` 到 `1.0`。分析 / 多选类任务建议使用更接近 `0.0` 的
            `temperature`，创意和生成类任务建议使用更接近 `1.0` 的值。


            请注意，即使 `temperature` 为 `0.0`，结果也不会完全确定。
          examples:
            - 1
          maximum: 1
          minimum: 0
          title: 温度
          type: number
          x-stainless-deprecation-message: 已弃用。Opus 4.6 之后发布的模型不支持设置 temperature。为保持向后兼容，仍接受 1.0；其他值将返回 400 错误。
        thinking:
          $ref: '#/components/schemas/BetaThinkingConfigParam'
        tool_choice:
          $ref: '#/components/schemas/BetaToolChoice'
        tools:
          description: >+
            模型可以使用的工具的定义。


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


            工具有两种类型：**客户端工具**和**服务器工具**。下面描述的行为适用于客户端工具。服务器工具请参见各自的文档，因为每种工具都有自己的行为（例如
            web 搜索工具）。


            每个工具定义包含：


            * `name`：工具的名称。

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

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


            例如，如果你将 `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 结构的输出时都可以使用。

          examples:
            - description: 获取给定位置的当前天气
              input_schema:
                properties:
                  location:
                    description: 城市与州，例如 San Francisco, CA
                    type: string
                  unit:
                    description: 输出的单位 - (celsius, fahrenheit) 之一
                    type: string
                required:
                  - location
                type: object
              name: get_weather
          items:
            oneOf:
              - $ref: '#/components/schemas/BetaTool'
              - $ref: '#/components/schemas/BetaBashTool_20241022'
              - $ref: '#/components/schemas/BetaBashTool_20250124'
              - $ref: '#/components/schemas/BetaCodeExecutionTool_20250522'
              - $ref: '#/components/schemas/BetaCodeExecutionTool_20250825'
              - $ref: '#/components/schemas/BetaCodeExecutionTool_20260120'
              - $ref: '#/components/schemas/BetaCodeExecutionTool_20260521'
              - $ref: '#/components/schemas/BetaComputerUseTool_20241022'
              - $ref: '#/components/schemas/BetaMemoryTool_20250818'
              - $ref: '#/components/schemas/BetaComputerUseTool_20250124'
              - $ref: '#/components/schemas/BetaTextEditor_20241022'
              - $ref: '#/components/schemas/BetaComputerUseTool_20251124'
              - $ref: '#/components/schemas/BetaTextEditor_20250124'
              - $ref: '#/components/schemas/BetaTextEditor_20250429'
              - $ref: '#/components/schemas/BetaTextEditor_20250728'
              - $ref: '#/components/schemas/BetaWebSearchTool_20250305'
              - $ref: '#/components/schemas/BetaWebFetchTool_20250910'
              - $ref: '#/components/schemas/BetaWebSearchTool_20260209'
              - $ref: '#/components/schemas/BetaWebFetchTool_20260209'
              - $ref: '#/components/schemas/BetaWebFetchTool_20260309'
              - $ref: '#/components/schemas/BetaWebSearchTool_20260318'
              - $ref: '#/components/schemas/BetaWebFetchTool_20260318'
              - $ref: '#/components/schemas/BetaAdvisorTool_20260301'
              - $ref: '#/components/schemas/BetaToolSearchToolBM25_20251119'
              - $ref: '#/components/schemas/BetaToolSearchToolRegex_20251119'
              - $ref: '#/components/schemas/BetaMCPToolset'
          title: 工具
          type: array
        top_k:
          deprecated: true
          description: >-
            对每个后续令牌仅从概率最高的 K 个选项中采样。


            用于消除"长尾"低概率响应。[在此了解更多技术细节](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277)。


            仅建议高级用例使用。
          examples:
            - 5
          minimum: 0
          title: Top K
          type: integer
          x-stainless-deprecation-message: 已弃用。Opus 4.6 之后发布的模型不接受 top_k；设置任何值都会返回 400 错误。
        top_p:
          deprecated: true
          description: |-
            使用核采样。

            在核采样中，我们按概率从高到低对每个后续令牌的所有选项计算累积分布，并在达到由 `top_p` 指定的特定概率时截断。

            仅建议高级用例使用。
          examples:
            - 0.7
          maximum: 1
          minimum: 0
          title: Top P
          type: number
          x-stainless-deprecation-message: >-
            已弃用。Opus 4.6 之后发布的模型不支持设置 top_p。为保持向后兼容，仍接受大于或等于 0.99 的值；其他值将返回 400
            错误。
      required:
        - model
        - messages
        - max_tokens
      title: CreateMessageParams
      type: object
    Model:
      title: Model
      description: |-
        将完成你的提示的模型。

        更多详情和选项请参阅[模型列表](/docs/zh/api/models/list-models)。
      anyOf:
        - type: string
        - const: claude-sonnet-5
          description: 面向编程与智能体的高性能模型
          x-stainless-nominal: false
        - const: claude-fable-5
          description: 面向最艰难的知识工作与编程问题的下一代智能
          x-stainless-nominal: false
        - const: claude-mythos-5
          description: 网络安全和生物学研究方面能力最强的模型
          x-stainless-nominal: false
        - const: claude-opus-5
          description: 面向长时间运行智能体和编程的强大智能
          x-stainless-nominal: false
        - const: claude-opus-4-8
          description: 面向长时间运行智能体和编程的强大智能
          x-stainless-nominal: false
        - const: claude-opus-4-7
          description: 面向长时间运行智能体和编程的强大智能
          x-stainless-nominal: false
        - const: claude-mythos-preview
          description: 新级别的智能，在编程和网络安全方面最强
          x-stainless-nominal: false
          deprecated: true
          x-stainless-deprecation-message: 将于 2026 年 6 月 30 日停止支持。请迁移至 `claude-mythos-5`。
        - const: claude-opus-4-6
          description: 面向长时间运行智能体和编程的强大智能
          x-stainless-nominal: false
        - const: claude-sonnet-4-6
          description: 速度与智能的最佳组合
          x-stainless-nominal: false
        - const: claude-haiku-4-5
          description: 具备接近前沿智能的最快模型
          x-stainless-nominal: false
        - const: claude-haiku-4-5-20251001
          description: 具备接近前沿智能的最快模型
          x-stainless-nominal: false
        - const: claude-opus-4-5
          description: 面向长时间运行智能体和编程的强大智能
          x-stainless-nominal: false
        - const: claude-opus-4-5-20251101
          description: 面向长时间运行智能体和编程的强大智能
          x-stainless-nominal: false
        - const: claude-sonnet-4-5
          description: 面向智能体与编程的高性能模型
          x-stainless-nominal: false
        - const: claude-sonnet-4-5-20250929
          description: 面向智能体与编程的高性能模型
          x-stainless-nominal: false
    BetaInputMessage:
      additionalProperties: false
      properties:
        content:
          anyOf:
            - type: string
              x-stainless-skip:
                - go
                - cli
            - items:
                $ref: '#/components/schemas/BetaInputContentBlock'
              type: array
              example:
                - type: text
                  text: What is a quaternion?
          title: 内容
        role:
          enum:
            - user
            - assistant
            - system
          title: 角色
          type: string
      required:
        - content
        - role
      title: InputMessage
      type: object
      discriminator:
        propertyName: role
    BetaCacheControlEphemeral:
      additionalProperties: false
      properties:
        ttl:
          description: |-
            缓存控制断点的存活时间。

            可以是以下值之一：
            - `5m`：5 分钟
            - `1h`：1 小时

            默认为 `5m`。请参阅提示缓存说明。
          enum:
            - 5m
            - 1h
          title: TTL
          type: string
          x-stainless-renameMap:
            ttl_5m: 5m
            ttl_1h: 1h
        type:
          const: ephemeral
          title: 类型
          type: string
      required:
        - type
      title: CacheControlEphemeral
      type: object
      x-stainless-go-constant-constructor: true
    BetaContainerParams:
      additionalProperties: false
      description: 包含要加载的技能的容器参数。
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          description: 容器 ID
          title: ID
        skills:
          anyOf:
            - items:
                $ref: '#/components/schemas/BetaSkillParams'
              maxItems: 8
              type: array
            - type: 'null'
          description: 要加载到容器中的技能列表
          title: 技能
      title: ContainerParams
      type: object
    BetaContextManagementConfig:
      additionalProperties: false
      properties:
        edits:
          description: 要应用的上下文管理编辑列表
          items:
            discriminator:
              mapping:
                clear_thinking_20251015:
                  $ref: '#/components/schemas/BetaClearThinking20251015'
                clear_tool_uses_20250919:
                  $ref: '#/components/schemas/BetaClearToolUses20250919'
                compact_20260112:
                  $ref: '#/components/schemas/BetaCompact20260112'
              propertyName: type
            oneOf:
              - $ref: '#/components/schemas/BetaClearToolUses20250919'
              - $ref: '#/components/schemas/BetaClearThinking20251015'
              - $ref: '#/components/schemas/BetaCompact20260112'
          minItems: 0
          title: 编辑项
          type: array
      title: ContextManagementConfig
      type: object
    BetaDiagnosticsParam:
      additionalProperties: false
      description: |-
        请求级诊断信息。当前携带用于提示缓存差异报告的先前响应
        ID。
      properties:
        previous_message_id:
          anyOf:
            - maxLength: 256
              type: string
            - type: 'null'
          description: >-
            该客户端上一次 /v1/messages 响应中的
            `id`（`msg_...`）。服务器会将该请求的提示指纹与本次请求进行比对，当提示缓存前缀无法复用时返回
            `diagnostics.cache_miss_reason`。首轮请传入 `null`，以在没有可比较的前序消息的情况下启用该功能。
          title: 上一条消息 ID
      title: DiagnosticsParam
      type: object
    BetaFallbackCreditTokenParam:
      additionalProperties: false
      description: |-
        ``fallback_credit_token`` 的对象形式：令牌加上兑换
        模式。

        需要 ``anthropic-beta: fallback-credit-2026-07-01``；没有该
        请求头时，此字段仅接受裸字符串。裸字符串与不带模式的对象
        等价（二者都选择 ``strict``），因此把现有令牌包装成对象
        本身不会改变任何行为。
      properties:
        mode:
          description: >-
            失败的令牌对重试的影响。`strict`（默认值，也是裸字符串形式的行为）：兑换失败会返回
            400，不提供重试。`best_effort`：无论如何都会提供重试——令牌层面的失败不再拒绝请求；重试按正常价格继续，结果会报告在响应的
            `usage.fallback_credit` 中。两种失败在两种模式下都仍然是硬性错误：格式错误的令牌，以及将
            `fallback_credit_token` 与 `fallbacks` 组合使用。
          enum:
            - strict
            - best_effort
          title: 模式
          type: string
        token:
          description: >-
            来自先前拒绝响应的 `stop_details` 中的不透明 `fallback_credit_token` ——
            与裸字符串形式所携带的字符串相同。
          maxLength: 2048
          minLength: 1
          title: 令牌
          type: string
      required:
        - token
      title: FallbackCreditTokenParam
      type: object
    BetaFallbackConfigV2:
      additionalProperties: true
      description: |-
        `/v1/messages` 请求中 `fallbacks` 链的一个条目。

        `model` 为必填。覆盖字段（`max_tokens`、`thinking`、
        `output_config` 和 `speed`）仅针对本次尝试设置相应参数，并按照请求发往 `model` 的标准进行校验。
        其他任何键都会在解析时被拒绝。
      properties:
        max_tokens:
          anyOf:
            - type: integer
            - type: 'null'
          title: 最大令牌数
        model:
          $ref: '#/components/schemas/Model'
        output_config:
          anyOf:
            - $ref: '#/components/schemas/BetaOutputConfig'
            - type: 'null'
        speed:
          anyOf:
            - $ref: '#/components/schemas/BetaSpeed'
            - type: 'null'
        thinking:
          anyOf:
            - discriminator:
                mapping:
                  adaptive:
                    $ref: '#/components/schemas/BetaThinkingConfigAdaptive'
                  disabled:
                    $ref: '#/components/schemas/BetaThinkingConfigDisabled'
                  enabled:
                    $ref: '#/components/schemas/BetaThinkingConfigEnabled'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaThinkingConfigEnabled'
                - $ref: '#/components/schemas/BetaThinkingConfigDisabled'
                - $ref: '#/components/schemas/BetaThinkingConfigAdaptive'
            - type: 'null'
          title: 思考
      required:
        - model
      title: FallbackConfigV2
      type: object
    BetaRequestMCPServerURLDefinition:
      additionalProperties: false
      properties:
        authorization_token:
          anyOf:
            - type: string
            - type: 'null'
          title: 授权令牌
        name:
          title: 名称
          type: string
        tool_configuration:
          anyOf:
            - $ref: '#/components/schemas/BetaRequestMCPServerToolConfiguration'
            - type: 'null'
        type:
          const: url
          title: 类型
          type: string
        url:
          title: URL
          type: string
      required:
        - name
        - type
        - url
      title: RequestMCPServerURLDefinition
      type: object
    BetaMetadata:
      additionalProperties: false
      properties:
        user_id:
          anyOf:
            - maxLength: 512
              type: string
            - type: 'null'
          description: >-
            与该请求关联的用户的外部标识符。


            该值应为 uuid、哈希值或其他不透明标识符。OMA 可能使用此 ID
            协助检测滥用行为。不要包含任何可识别身份的信息，例如姓名、电子邮件地址或电话号码。
          examples:
            - 13803d75-b4b5-4c3e-b2a2-6f21399b021b
          title: 用户 ID
      title: Metadata
      type: object
    BetaOutputConfig:
      additionalProperties: false
      properties:
        effort:
          anyOf:
            - $ref: '#/components/schemas/BetaEffortLevel'
            - type: 'null'
          description: |-
            模型应在其响应中投入的努力程度。更高的努力程度可能带来更深入的分析，但耗时更长。

            有效值为 `low`、`medium`、`high`、`xhigh` 或 `max`。
        format:
          anyOf:
            - $ref: '#/components/schemas/BetaJsonOutputFormat'
            - type: 'null'
          description: 用于指定模型响应的输出格式架构。参见结构化输出
        task_budget:
          anyOf:
            - $ref: '#/components/schemas/BetaTokenTaskBudget'
            - type: 'null'
          description: 跨上下文的令牌预算跟踪配置。
      title: OutputConfig
      type: object
    BetaJsonOutputFormat:
      additionalProperties: false
      properties:
        schema:
          additionalProperties: true
          description: 格式的 JSON 架构
          title: 架构
          type: object
        type:
          const: json_schema
          title: 类型
          type: string
      required:
        - schema
        - type
      title: JsonOutputFormat
      type: object
    BetaSpeed:
      type: string
      description: 推理速度模式。`fast` 以较高价格提供显著更快的输出令牌生成速度。并非所有模型都支持 `fast`；无效组合会在创建时被拒绝。
      enum:
        - standard
        - fast
    BetaRequestTextBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        citations:
          anyOf:
            - items:
                discriminator:
                  mapping:
                    char_location:
                      $ref: '#/components/schemas/BetaRequestCharLocationCitation'
                    content_block_location:
                      $ref: >-
                        #/components/schemas/BetaRequestContentBlockLocationCitation
                    page_location:
                      $ref: '#/components/schemas/BetaRequestPageLocationCitation'
                    search_result_location:
                      $ref: >-
                        #/components/schemas/BetaRequestSearchResultLocationCitation
                    web_search_result_location:
                      $ref: >-
                        #/components/schemas/BetaRequestWebSearchResultLocationCitation
                  propertyName: type
                oneOf:
                  - $ref: '#/components/schemas/BetaRequestCharLocationCitation'
                  - $ref: '#/components/schemas/BetaRequestPageLocationCitation'
                  - $ref: >-
                      #/components/schemas/BetaRequestContentBlockLocationCitation
                  - $ref: >-
                      #/components/schemas/BetaRequestWebSearchResultLocationCitation
                  - $ref: >-
                      #/components/schemas/BetaRequestSearchResultLocationCitation
              type: array
            - type: 'null'
          title: 引用
        text:
          minLength: 1
          title: 文本
          type: string
        type:
          const: text
          title: 类型
          type: string
      required:
        - text
        - type
      title: RequestTextBlock
      type: object
    BetaThinkingConfigParam:
      description: >-
        用于启用模型扩展思考的配置。


        启用后，响应中会包含 `thinking` 内容块，展示模型在给出最终答案之前的思考过程。至少需要 1,024 个令牌的预算，并计入你的
        `max_tokens` 限制。


        详见扩展思考。
      discriminator:
        mapping:
          adaptive:
            $ref: '#/components/schemas/BetaThinkingConfigAdaptive'
          disabled:
            $ref: '#/components/schemas/BetaThinkingConfigDisabled'
          enabled:
            $ref: '#/components/schemas/BetaThinkingConfigEnabled'
        propertyName: type
      examples:
        - type: adaptive
      oneOf:
        - $ref: '#/components/schemas/BetaThinkingConfigEnabled'
        - $ref: '#/components/schemas/BetaThinkingConfigDisabled'
        - $ref: '#/components/schemas/BetaThinkingConfigAdaptive'
      title: Thinking
    BetaToolChoice:
      description: 模型应如何使用所提供的工具。模型可以使用特定工具、任意可用工具、自行决定，或完全不使用工具。
      discriminator:
        mapping:
          any:
            $ref: '#/components/schemas/BetaToolChoiceAny'
          auto:
            $ref: '#/components/schemas/BetaToolChoiceAuto'
          none:
            $ref: '#/components/schemas/BetaToolChoiceNone'
          tool:
            $ref: '#/components/schemas/BetaToolChoiceTool'
        propertyName: type
      oneOf:
        - $ref: '#/components/schemas/BetaToolChoiceAuto'
        - $ref: '#/components/schemas/BetaToolChoiceAny'
        - $ref: '#/components/schemas/BetaToolChoiceTool'
        - $ref: '#/components/schemas/BetaToolChoiceNone'
      title: Tool Choice
    BetaTool:
      additionalProperties: false
      properties:
        type:
          anyOf:
            - type: 'null'
            - const: custom
              type: string
          title: 类型
        description:
          description: >-
            对该工具功能的描述。


            工具描述应尽可能详尽。模型掌握的关于该工具是什么以及如何使用它的信息越多，其表现就越好。你可以使用自然语言描述来强调工具输入 JSON
            架构的重要方面。
          examples:
            - 获取指定位置的当前天气
          title: 描述
          type: string
        name:
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          maxLength: 128
          minLength: 1
          pattern: ^[a-zA-Z0-9_-]{1,128}$
          title: 名称
          type: string
        input_schema:
          $ref: '#/components/schemas/BetaInputSchema'
          description: |-
            此工具输入的 [JSON 架构](https://json-schema.org/draft/2020-12)。

            它定义了你的工具所接受、且模型将生成的 `input` 的结构。
          examples:
            - properties:
                location:
                  description: 城市与州，例如 San Francisco, CA
                  type: string
                unit:
                  description: 输出的单位 - (celsius, fahrenheit) 之一
                  type: string
              required:
                - location
              type: object
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        eager_input_streaming:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            为该工具启用即时输入流式传输。为 true 时，工具的输入参数会在生成时增量流式传输，类型即时推断，而不是缓冲完整的 JSON 输出。为
            false 时，即使 fine-grained-tool-streaming beta 已启用，该工具也禁用流式传输。为
            null（默认）时，使用基于 beta 请求头的默认行为。
          title: 提前流式传输输入
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        input_examples:
          items:
            additionalProperties:
              $ref: '#/components/schemas/BetaJsonValue'
            type: object
          title: 输入示例
          type: array
      required:
        - name
        - input_schema
      title: Tool
      type: object
    BetaBashTool_20241022:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        input_examples:
          items:
            additionalProperties:
              $ref: '#/components/schemas/BetaJsonValue'
            type: object
          title: 输入示例
          type: array
        name:
          const: bash
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: bash_20241022
          title: 类型
          type: string
      required:
        - name
        - type
      title: BashTool_20241022
      type: object
    BetaBashTool_20250124:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        input_examples:
          items:
            additionalProperties:
              $ref: '#/components/schemas/BetaJsonValue'
            type: object
          title: 输入示例
          type: array
        name:
          const: bash
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: bash_20250124
          title: 类型
          type: string
      required:
        - name
        - type
      title: BashTool_20250124
      type: object
    BetaCodeExecutionTool_20250522:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        name:
          const: code_execution
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: code_execution_20250522
          title: 类型
          type: string
      required:
        - name
        - type
      title: CodeExecutionTool_20250522
      type: object
    BetaCodeExecutionTool_20250825:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        name:
          const: code_execution
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: code_execution_20250825
          title: 类型
          type: string
      required:
        - name
        - type
      title: CodeExecutionTool_20250825
      type: object
    BetaCodeExecutionTool_20260120:
      additionalProperties: false
      description: 支持 REPL 状态持久化的代码执行工具（daemon 模式 + gVisor checkpoint）。
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        name:
          const: code_execution
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: code_execution_20260120
          title: 类型
          type: string
      required:
        - name
        - type
      title: CodeExecutionTool_20260120
      type: object
    BetaCodeExecutionTool_20260521:
      additionalProperties: false
      description: 支持 REPL 状态持久化的代码执行工具。
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        name:
          const: code_execution
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: code_execution_20260521
          title: 类型
          type: string
      required:
        - name
        - type
      title: CodeExecutionTool_20260521
      type: object
    BetaComputerUseTool_20241022:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        display_height_px:
          description: 显示区域的高度（像素）。
          minimum: 1
          title: 显示高度（像素）
          type: integer
        display_number:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
          description: 该显示器的 X11 显示编号（例如 0、1）。
          title: 显示器编号
        display_width_px:
          description: 显示区域的宽度（像素）。
          minimum: 1
          title: 显示宽度（像素）
          type: integer
        input_examples:
          items:
            additionalProperties:
              $ref: '#/components/schemas/BetaJsonValue'
            type: object
          title: 输入示例
          type: array
        name:
          const: computer
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: computer_20241022
          title: 类型
          type: string
      required:
        - display_height_px
        - display_width_px
        - name
        - type
      title: ComputerUseTool_20241022
      type: object
    BetaMemoryTool_20250818:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        input_examples:
          items:
            additionalProperties:
              $ref: '#/components/schemas/BetaJsonValue'
            type: object
          title: 输入示例
          type: array
        name:
          const: memory
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: memory_20250818
          title: 类型
          type: string
      required:
        - name
        - type
      title: MemoryTool_20250818
      type: object
    BetaComputerUseTool_20250124:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        display_height_px:
          description: 显示区域的高度（像素）。
          minimum: 1
          title: 显示高度（像素）
          type: integer
        display_number:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
          description: 该显示器的 X11 显示编号（例如 0、1）。
          title: 显示器编号
        display_width_px:
          description: 显示区域的宽度（像素）。
          minimum: 1
          title: 显示宽度（像素）
          type: integer
        input_examples:
          items:
            additionalProperties:
              $ref: '#/components/schemas/BetaJsonValue'
            type: object
          title: 输入示例
          type: array
        name:
          const: computer
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: computer_20250124
          title: 类型
          type: string
      required:
        - display_height_px
        - display_width_px
        - name
        - type
      title: ComputerUseTool_20250124
      type: object
    BetaTextEditor_20241022:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        input_examples:
          items:
            additionalProperties:
              $ref: '#/components/schemas/BetaJsonValue'
            type: object
          title: 输入示例
          type: array
        name:
          const: str_replace_editor
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: text_editor_20241022
          title: 类型
          type: string
      required:
        - name
        - type
      title: TextEditor_20241022
      type: object
    BetaComputerUseTool_20251124:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        display_height_px:
          description: 显示区域的高度（像素）。
          minimum: 1
          title: 显示高度（像素）
          type: integer
        display_number:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
          description: 该显示器的 X11 显示编号（例如 0、1）。
          title: 显示器编号
        display_width_px:
          description: 显示区域的宽度（像素）。
          minimum: 1
          title: 显示宽度（像素）
          type: integer
        enable_zoom:
          description: 是否启用对屏幕进行放大截图的操作。
          title: 启用缩放
          type: boolean
        input_examples:
          items:
            additionalProperties:
              $ref: '#/components/schemas/BetaJsonValue'
            type: object
          title: 输入示例
          type: array
        name:
          const: computer
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: computer_20251124
          title: 类型
          type: string
      required:
        - display_height_px
        - display_width_px
        - name
        - type
      title: ComputerUseTool_20251124
      type: object
    BetaTextEditor_20250124:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        input_examples:
          items:
            additionalProperties:
              $ref: '#/components/schemas/BetaJsonValue'
            type: object
          title: 输入示例
          type: array
        name:
          const: str_replace_editor
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: text_editor_20250124
          title: 类型
          type: string
      required:
        - name
        - type
      title: TextEditor_20250124
      type: object
    BetaTextEditor_20250429:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        input_examples:
          items:
            additionalProperties:
              $ref: '#/components/schemas/BetaJsonValue'
            type: object
          title: 输入示例
          type: array
        name:
          const: str_replace_based_edit_tool
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: text_editor_20250429
          title: 类型
          type: string
      required:
        - name
        - type
      title: TextEditor_20250429
      type: object
    BetaTextEditor_20250728:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        input_examples:
          items:
            additionalProperties:
              $ref: '#/components/schemas/BetaJsonValue'
            type: object
          title: 输入示例
          type: array
        max_characters:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          description: 查看文件时显示的最大字符数。未指定时，默认显示完整文件。
          title: 最大字符数
        name:
          const: str_replace_based_edit_tool
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: text_editor_20250728
          title: 类型
          type: string
      required:
        - name
        - type
      title: TextEditor_20250728
      type: object
    BetaWebSearchTool_20250305:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        allowed_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 若提供，结果中将只包含这些域名。不能与 `blocked_domains` 同时使用。
          title: 允许的域名
        blocked_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 若提供，这些域名将不会出现在结果中。不能与 `allowed_domains` 同时使用。
          title: 阻止的域名
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        max_uses:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 工具在 API 请求中可使用的最大次数。
          title: 最大使用次数
        name:
          const: web_search
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: web_search_20250305
          title: 类型
          type: string
        user_location:
          anyOf:
            - $ref: '#/components/schemas/BetaUserLocation'
            - type: 'null'
          description: 用户位置的参数。用于提供更相关的搜索结果。
      required:
        - name
        - type
      title: WebSearchTool_20250305
      type: object
    BetaWebFetchTool_20250910:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        allowed_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 允许抓取的域名列表
          title: 允许的域名
        blocked_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 禁止抓取的域名列表
          title: 阻止的域名
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        citations:
          anyOf:
            - $ref: '#/components/schemas/BetaRequestCitationsConfig'
            - type: 'null'
          description: 已获取文档的引用配置。引用默认禁用。
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        max_content_tokens:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 将网页文本内容纳入上下文所使用的最大令牌数。该限制是近似的，且不适用于 PDF 等二进制内容。
          title: 最大内容令牌数
        max_uses:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 工具在 API 请求中可使用的最大次数。
          title: 最大使用次数
        name:
          const: web_fetch
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: web_fetch_20250910
          title: 类型
          type: string
      required:
        - name
        - type
      title: WebFetchTool_20250910
      type: object
    BetaWebSearchTool_20260209:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        allowed_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 若提供，结果中将只包含这些域名。不能与 `blocked_domains` 同时使用。
          title: 允许的域名
        blocked_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 若提供，这些域名将不会出现在结果中。不能与 `allowed_domains` 同时使用。
          title: 阻止的域名
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        max_uses:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 工具在 API 请求中可使用的最大次数。
          title: 最大使用次数
        name:
          const: web_search
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: web_search_20260209
          title: 类型
          type: string
        user_location:
          anyOf:
            - $ref: '#/components/schemas/BetaUserLocation'
            - type: 'null'
          description: 用户位置的参数。用于提供更相关的搜索结果。
      required:
        - name
        - type
      title: WebSearchTool_20260209
      type: object
    BetaWebFetchTool_20260209:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        allowed_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 允许抓取的域名列表
          title: 允许的域名
        blocked_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 禁止抓取的域名列表
          title: 阻止的域名
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        citations:
          anyOf:
            - $ref: '#/components/schemas/BetaRequestCitationsConfig'
            - type: 'null'
          description: 已获取文档的引用配置。引用默认禁用。
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        max_content_tokens:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 将网页文本内容纳入上下文所使用的最大令牌数。该限制是近似的，且不适用于 PDF 等二进制内容。
          title: 最大内容令牌数
        max_uses:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 工具在 API 请求中可使用的最大次数。
          title: 最大使用次数
        name:
          const: web_fetch
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: web_fetch_20260209
          title: 类型
          type: string
      required:
        - name
        - type
      title: WebFetchTool_20260209
      type: object
    BetaWebFetchTool_20260309:
      additionalProperties: false
      description: 带有 use_cache 参数用于绕过缓存内容的网页抓取工具。
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        allowed_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 允许抓取的域名列表
          title: 允许的域名
        blocked_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 禁止抓取的域名列表
          title: 阻止的域名
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        citations:
          anyOf:
            - $ref: '#/components/schemas/BetaRequestCitationsConfig'
            - type: 'null'
          description: 已获取文档的引用配置。引用默认禁用。
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        max_content_tokens:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 将网页文本内容纳入上下文所使用的最大令牌数。该限制是近似的，且不适用于 PDF 等二进制内容。
          title: 最大内容令牌数
        max_uses:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 工具在 API 请求中可使用的最大次数。
          title: 最大使用次数
        name:
          const: web_fetch
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: web_fetch_20260309
          title: 类型
          type: string
        use_cache:
          description: 是否使用缓存内容。设为 false 可绕过缓存并获取最新内容。仅当用户明确要求最新内容或抓取快速变化的来源时才设为 false。
          title: 使用缓存
          type: boolean
      required:
        - name
        - type
      title: WebFetchTool_20260309
      type: object
    BetaWebSearchTool_20260318:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        allowed_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 若提供，结果中将只包含这些域名。不能与 `blocked_domains` 同时使用。
          title: 允许的域名
        blocked_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 若提供，这些域名将不会出现在结果中。不能与 `allowed_domains` 同时使用。
          title: 阻止的域名
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        max_uses:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 工具在 API 请求中可使用的最大次数。
          title: 最大使用次数
        name:
          const: web_search
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        response_inclusion:
          description: >-
            当本工具的结果在同一轮中被一次已完成的 code_execution 调用消费时，其结果块在 API 响应中的呈现方式。'full'
            返回完整内容（默认）。'excluded' 完全丢弃嵌套的 server_tool_use
            与结果块对。来自直接调用的结果，或来自完成前被暂停的 code_execution 调用的结果，始终完整返回，以便在下一轮传回。
          enum:
            - full
            - excluded
          title: 响应包含方式
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: web_search_20260318
          title: 类型
          type: string
        user_location:
          anyOf:
            - $ref: '#/components/schemas/BetaUserLocation'
            - type: 'null'
          description: 用户位置的参数。用于提供更相关的搜索结果。
      required:
        - name
        - type
      title: WebSearchTool_20260318
      type: object
    BetaWebFetchTool_20260318:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        allowed_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 允许抓取的域名列表
          title: 允许的域名
        blocked_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 禁止抓取的域名列表
          title: 阻止的域名
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        citations:
          anyOf:
            - $ref: '#/components/schemas/BetaRequestCitationsConfig'
            - type: 'null'
          description: 已获取文档的引用配置。引用默认禁用。
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        max_content_tokens:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 将网页文本内容纳入上下文所使用的最大令牌数。该限制是近似的，且不适用于 PDF 等二进制内容。
          title: 最大内容令牌数
        max_uses:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 工具在 API 请求中可使用的最大次数。
          title: 最大使用次数
        name:
          const: web_fetch
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        response_inclusion:
          description: >-
            当本工具的结果在同一轮中被一次已完成的 code_execution 调用消费时，其结果块在 API 响应中的呈现方式。'full'
            返回完整内容（默认）。'excluded' 完全丢弃嵌套的 server_tool_use
            与结果块对。来自直接调用的结果，或来自完成前被暂停的 code_execution 调用的结果，始终完整返回，以便在下一轮传回。
          enum:
            - full
            - excluded
          title: 响应包含方式
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: web_fetch_20260318
          title: 类型
          type: string
        use_cache:
          description: 是否使用缓存内容。设为 false 可绕过缓存并获取最新内容。仅当用户明确要求最新内容或抓取快速变化的来源时才设为 false。
          title: 使用缓存
          type: boolean
      required:
        - name
        - type
      title: WebFetchTool_20260318
      type: object
    BetaAdvisorTool_20260301:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        caching:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: >-
            针对顾问自身提示的缓存。设置后，每次顾问调用都会以给定的 TTL
            写入一个缓存条目，以便同一会话中的后续调用读取稳定前缀。省略时，顾问提示不会被缓存。
          title: 缓存配置
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        max_tokens:
          anyOf:
            - minimum: 1024
              type: integer
            - type: 'null'
          description: >-
            限制顾问每次调用的总输出（思考 + text）。当顾问达到该上限时，返回的 advisor_result 或
            advisor_redacted_result 块会携带 stop_reason='max_tokens'，并在 worker
            模型看到的建议文本末尾追加一条截断说明（在已脱敏模式下位于加密数据块内部）。设置该项时，服务器还会在顾问的提示中发出一个剩余令牌预算块，使顾问自行向该上限收敛。省略时，应用顾问模型的默认输出上限，且不发出预算块。
          title: 最大令牌数
        max_uses:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: 工具在 API 请求中可使用的最大次数。
          title: 最大使用次数
        model:
          $ref: '#/components/schemas/Model'
        name:
          const: advisor
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          const: advisor_20260301
          title: 类型
          type: string
      required:
        - model
        - name
        - type
      title: AdvisorTool_20260301
      type: object
    BetaToolSearchToolBM25_20251119:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        name:
          const: tool_search_tool_bm25
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          enum:
            - tool_search_tool_bm25_20251119
            - tool_search_tool_bm25
          title: 类型
          type: string
      required:
        - name
        - type
      title: ToolSearchToolBM25_20251119
      type: object
    BetaToolSearchToolRegex_20251119:
      additionalProperties: false
      properties:
        allowed_callers:
          items:
            $ref: '#/components/schemas/BetaAllowedCaller'
          title: 允许的调用方
          type: array
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        defer_loading:
          description: >-
            如果为 true，该工具将不包含在初始系统提示词中。仅当通过 tool search 以 tool_reference
            形式返回时才加载。
          title: 延迟加载
          type: boolean
        name:
          const: tool_search_tool_regex
          description: |-
            工具的名称。

            模型以及在 `tool_use` 块中将按此名称调用该工具。
          title: 名称
          type: string
        strict:
          description: 为 `true` 时，保证对工具名称和输入进行架构校验
          title: 严格模式
          type: boolean
        type:
          enum:
            - tool_search_tool_regex_20251119
            - tool_search_tool_regex
          title: 类型
          type: string
      required:
        - name
        - type
      title: ToolSearchToolRegex_20251119
      type: object
    BetaMCPToolset:
      additionalProperties: false
      description: |-
        对来自某个 MCP 服务器的一组工具的配置。

        允许为来自该 MCP 服务器的所有工具配置启用状态和 defer_loading，
        并可选地按工具单独覆盖。
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        configs:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/BetaMCPToolConfig'
              type: object
            - type: 'null'
          description: 针对特定工具的配置覆盖，以工具名称为键
          title: 配置
        default_config:
          $ref: '#/components/schemas/BetaMCPToolDefaultConfig'
          description: 应用于该服务器所有工具的默认配置
        mcp_server_name:
          description: 要配置工具的 MCP 服务器名称
          maxLength: 255
          minLength: 1
          title: MCP 服务器名称
          type: string
        type:
          const: mcp_toolset
          title: 类型
          type: string
      required:
        - mcp_server_name
        - type
      title: MCPToolset
      type: object
    BetaInputContentBlock:
      discriminator:
        mapping:
          advisor_tool_result:
            $ref: '#/components/schemas/BetaRequestAdvisorToolResultBlock'
          bash_code_execution_tool_result:
            $ref: '#/components/schemas/BetaRequestBashCodeExecutionToolResultBlock'
          code_execution_tool_result:
            $ref: '#/components/schemas/BetaRequestCodeExecutionToolResultBlock'
          compaction:
            $ref: '#/components/schemas/BetaRequestCompactionBlock'
          container_upload:
            $ref: '#/components/schemas/BetaRequestContainerUploadBlock'
          document:
            $ref: '#/components/schemas/BetaRequestDocumentBlock'
          fallback:
            $ref: '#/components/schemas/BetaRequestFallbackBlock'
          image:
            $ref: '#/components/schemas/BetaRequestImageBlock'
          mcp_tool_result:
            $ref: '#/components/schemas/BetaRequestMCPToolResultBlock'
          mcp_tool_use:
            $ref: '#/components/schemas/BetaRequestMCPToolUseBlock'
          mid_conv_system:
            $ref: '#/components/schemas/BetaRequestMidConvSystemBlock'
          redacted_thinking:
            $ref: '#/components/schemas/BetaRequestRedactedThinkingBlock'
          search_result:
            $ref: '#/components/schemas/BetaRequestSearchResultBlock'
          server_tool_use:
            $ref: '#/components/schemas/BetaRequestServerToolUseBlock'
          text:
            $ref: '#/components/schemas/BetaRequestTextBlock'
          text_editor_code_execution_tool_result:
            $ref: >-
              #/components/schemas/BetaRequestTextEditorCodeExecutionToolResultBlock
          thinking:
            $ref: '#/components/schemas/BetaRequestThinkingBlock'
          tool_addition:
            $ref: '#/components/schemas/BetaRequestToolAdditionBlock'
          tool_removal:
            $ref: '#/components/schemas/BetaRequestToolRemovalBlock'
          tool_result:
            $ref: '#/components/schemas/BetaRequestToolResultBlock'
          tool_search_tool_result:
            $ref: '#/components/schemas/BetaRequestToolSearchToolResultBlock'
          tool_use:
            $ref: '#/components/schemas/BetaRequestToolUseBlock'
          web_fetch_tool_result:
            $ref: '#/components/schemas/BetaRequestWebFetchToolResultBlock'
          web_search_tool_result:
            $ref: '#/components/schemas/BetaRequestWebSearchToolResultBlock'
        propertyName: type
      oneOf:
        - $ref: '#/components/schemas/BetaRequestTextBlock'
          description: 普通文本内容。
        - $ref: '#/components/schemas/BetaRequestImageBlock'
          description: 直接以 base64 数据指定，或通过 URL 引用指定的图片内容。
        - $ref: '#/components/schemas/BetaRequestDocumentBlock'
          description: 文档内容，可直接指定为 base64 数据、文本，或通过 URL 引用。
        - $ref: '#/components/schemas/BetaRequestSearchResultBlock'
          description: 包含搜索操作返回的来源、标题和内容的搜索结果块。
        - $ref: '#/components/schemas/BetaRequestThinkingBlock'
          description: 指定模型内部思考的内容块。
        - $ref: '#/components/schemas/BetaRequestRedactedThinkingBlock'
          description: 用于指定模型进行内部、经删节思考的块。
        - $ref: '#/components/schemas/BetaRequestToolUseBlock'
          description: 表示模型工具调用的块。
        - $ref: '#/components/schemas/BetaRequestToolResultBlock'
          description: 指定模型工具使用结果的块。
        - $ref: '#/components/schemas/BetaRequestServerToolUseBlock'
        - $ref: '#/components/schemas/BetaRequestWebSearchToolResultBlock'
        - $ref: '#/components/schemas/BetaRequestWebFetchToolResultBlock'
        - $ref: '#/components/schemas/BetaRequestAdvisorToolResultBlock'
        - $ref: '#/components/schemas/BetaRequestCodeExecutionToolResultBlock'
        - $ref: '#/components/schemas/BetaRequestBashCodeExecutionToolResultBlock'
        - $ref: >-
            #/components/schemas/BetaRequestTextEditorCodeExecutionToolResultBlock
        - $ref: '#/components/schemas/BetaRequestToolSearchToolResultBlock'
        - $ref: '#/components/schemas/BetaRequestMCPToolUseBlock'
        - $ref: '#/components/schemas/BetaRequestMCPToolResultBlock'
        - $ref: '#/components/schemas/BetaRequestContainerUploadBlock'
        - $ref: '#/components/schemas/BetaRequestCompactionBlock'
        - $ref: '#/components/schemas/BetaRequestMidConvSystemBlock'
        - $ref: '#/components/schemas/BetaRequestToolAdditionBlock'
        - $ref: '#/components/schemas/BetaRequestToolRemovalBlock'
        - $ref: '#/components/schemas/BetaRequestFallbackBlock'
      x-stainless-go-variant-constructor:
        naming: new_beta_{variant}_block
    BetaSkillParams:
      additionalProperties: false
      description: 要在容器中加载的技能的规格说明（请求模型）。
      properties:
        skill_id:
          description: 技能 ID
          examples:
            - pdf
          maxLength: 64
          minLength: 1
          title: 技能 ID
          type: string
        type:
          description: 技能的类型 - 'anthropic'（内置）或 'custom'（用户自定义）
          enum:
            - anthropic
            - custom
          examples:
            - anthropic
          title: 类型
          type: string
        version:
          description: 技能版本，或 'latest' 表示最新版本
          examples:
            - latest
          maxLength: 64
          minLength: 1
          title: 版本
          type: string
      required:
        - skill_id
        - type
      title: SkillParams
      type: object
    BetaClearThinking20251015:
      additionalProperties: false
      properties:
        keep:
          anyOf:
            - discriminator:
                mapping:
                  all:
                    $ref: '#/components/schemas/BetaAllThinkingTurns'
                  thinking_turns:
                    $ref: '#/components/schemas/BetaThinkingTurns'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaThinkingTurns'
                - $ref: '#/components/schemas/BetaAllThinkingTurns'
            - const: all
              type: string
              x-stainless-naming:
                csharp:
                  type_name: All
          description: 保留思考块的最近助手轮次数量。更早轮次的思考块将被移除。
          title: 保留数量
        type:
          const: clear_thinking_20251015
          title: 类型
          type: string
      required:
        - type
      title: ClearThinking20251015
      type: object
    BetaClearToolUses20250919:
      additionalProperties: false
      properties:
        clear_at_least:
          anyOf:
            - $ref: '#/components/schemas/BetaInputTokensClearAtLeast'
            - type: 'null'
          description: 触发时必须清除的最少令牌数量。只有能移除至少这么多令牌时，才会修改上下文。
        clear_tool_inputs:
          anyOf:
            - type: boolean
            - items:
                type: string
              type: array
            - type: 'null'
          description: 是清除所有工具输入（bool），还是指定要清除的特定工具输入（list）
          title: 清除工具输入
        exclude_tools:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: 使用记录不会被清除的工具名称
          title: 排除的工具
        keep:
          description: 在对话中保留的工具使用数量
          discriminator:
            mapping:
              tool_uses:
                $ref: '#/components/schemas/BetaToolUsesKeep'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaToolUsesKeep'
          title: 保留数量
        trigger:
          description: 触发上下文管理策略的条件
          discriminator:
            mapping:
              input_tokens:
                $ref: '#/components/schemas/BetaInputTokensTrigger'
              tool_uses:
                $ref: '#/components/schemas/BetaToolUsesTrigger'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaInputTokensTrigger'
            - $ref: '#/components/schemas/BetaToolUsesTrigger'
          title: 触发条件
        type:
          const: clear_tool_uses_20250919
          title: 类型
          type: string
      required:
        - type
      title: ClearToolUses20250919
      type: object
    BetaCompact20260112:
      additionalProperties: false
      description: 在达到配置的触发阈值时自动压缩较旧的上下文。
      properties:
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          description: 用于摘要的附加指令。
          title: 指令
        pause_after_compaction:
          description: 是否在压缩后暂停并将压缩块返回给用户。
          title: 压缩后暂停
          type: boolean
        trigger:
          anyOf:
            - $ref: '#/components/schemas/BetaInputTokensTrigger'
            - type: 'null'
          description: 何时触发压缩。默认为 150000 个输入令牌。
        type:
          const: compact_20260112
          title: 类型
          type: string
      required:
        - type
      title: Compact20260112
      type: object
    BetaThinkingConfigAdaptive:
      additionalProperties: false
      properties:
        display:
          anyOf:
            - $ref: '#/components/schemas/BetaThinkingDisplayMode'
            - type: 'null'
          description: >-
            控制思考内容在响应中的呈现方式。设置为 `summarized` 时，思考内容正常返回。设置为 `omitted`
            时，思考内容会被删隐，但会返回一个签名以保持多轮对话的连续性。默认为 `summarized`。
        type:
          const: adaptive
          title: 类型
          type: string
      required:
        - type
      title: ThinkingConfigAdaptive
      type: object
    BetaThinkingConfigDisabled:
      additionalProperties: false
      properties:
        type:
          const: disabled
          title: 类型
          type: string
      required:
        - type
      title: ThinkingConfigDisabled
      type: object
      x-stainless-go-constant-constructor: true
    BetaThinkingConfigEnabled:
      additionalProperties: false
      properties:
        budget_tokens:
          description: |-
            决定模型可用于其内部推理过程的令牌数量。更大的预算可以让模型对复杂问题进行更深入的分析，从而提升响应质量。

            必须 ≥1024 且小于 `max_tokens`。

            详见扩展思考。
          minimum: 1024
          title: 预算令牌数
          type: integer
        display:
          anyOf:
            - $ref: '#/components/schemas/BetaThinkingDisplayMode'
            - type: 'null'
          description: >-
            控制思考内容在响应中的呈现方式。设置为 `summarized` 时，思考内容正常返回。设置为 `omitted`
            时，思考内容会被删隐，但会返回一个签名以保持多轮对话的连续性。默认为 `summarized`。
        type:
          const: enabled
          title: 类型
          type: string
      required:
        - budget_tokens
        - type
      title: ThinkingConfigEnabled
      type: object
    BetaRequestMCPServerToolConfiguration:
      additionalProperties: false
      properties:
        allowed_tools:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: 允许的工具
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: 已启用
      title: RequestMCPServerToolConfiguration
      type: object
    BetaEffortLevel:
      description: 所有可能的 effort 级别。
      enum:
        - low
        - medium
        - high
        - xhigh
        - max
      title: EffortLevel
      type: string
    BetaTokenTaskBudget:
      additionalProperties: false
      description: 用户可配置的跨上下文总令牌预算。
      properties:
        remaining:
          anyOf:
            - minimum: 0
              type: integer
            - type: 'null'
          description: 预算中的剩余令牌数。在客户端实现压缩时，可用其跟踪跨上下文的使用情况。未提供时默认为 total。
          minimum: 0
          title: 剩余量
        total:
          description: 会话中所有上下文的总令牌预算。
          minimum: 1024
          title: 总数
          type: integer
        type:
          const: tokens
          description: 预算类型。目前仅支持 'tokens'。
          title: 类型
          type: string
      required:
        - total
        - type
      title: TokenTaskBudget
      type: object
    BetaRequestCharLocationCitation:
      additionalProperties: false
      properties:
        cited_text:
          examples:
            - The grass is green. The sky is blue.
          title: 引用文本
          type: string
        document_index:
          minimum: 0
          title: 文档索引
          type: integer
        document_title:
          anyOf:
            - maxLength: 500
              minLength: 1
              type: string
            - type: 'null'
          title: 文档标题
        end_char_index:
          title: 结束字符索引
          type: integer
        start_char_index:
          minimum: 0
          title: 起始字符索引
          type: integer
        type:
          const: char_location
          title: 类型
          type: string
      required:
        - cited_text
        - document_index
        - document_title
        - end_char_index
        - start_char_index
        - type
      title: RequestCharLocationCitation
      type: object
    BetaRequestContentBlockLocationCitation:
      additionalProperties: false
      properties:
        cited_text:
          description: >-
            被引用的块范围的完整文本，拼接而成。


            始终等于 `content[start_block_index:end_block_index]`
            各段内容连接后的结果。文本块是最小的可引用单位；该字段不会是单个块的子串。不计入输出令牌，在后续轮次传回时也不计入输入令牌。
          examples:
            - The grass is green. The sky is blue.
          title: 引用文本
          type: string
        document_index:
          minimum: 0
          title: 文档索引
          type: integer
        document_title:
          anyOf:
            - maxLength: 500
              minLength: 1
              type: string
            - type: 'null'
          title: 文档标题
        end_block_index:
          description: >-
            所引用区块范围在源 `content` 数组中的排他性 0 基结束索引。


            始终大于 `start_block_index`；单区块引用的 `end_block_index = start_block_index
            + 1`。
          title: 结束内容块索引
          type: integer
        start_block_index:
          description: 来源的 `content` 数组中第一个被引用块的从 0 开始的索引。
          minimum: 0
          title: 起始内容块索引
          type: integer
        type:
          const: content_block_location
          title: 类型
          type: string
      required:
        - cited_text
        - document_index
        - document_title
        - end_block_index
        - start_block_index
        - type
      title: RequestContentBlockLocationCitation
      type: object
    BetaRequestPageLocationCitation:
      additionalProperties: false
      properties:
        cited_text:
          examples:
            - The grass is green. The sky is blue.
          title: 引用文本
          type: string
        document_index:
          minimum: 0
          title: 文档索引
          type: integer
        document_title:
          anyOf:
            - maxLength: 500
              minLength: 1
              type: string
            - type: 'null'
          title: 文档标题
        end_page_number:
          title: 结束页码
          type: integer
        start_page_number:
          minimum: 1
          title: 起始页码
          type: integer
        type:
          const: page_location
          title: 类型
          type: string
      required:
        - cited_text
        - document_index
        - document_title
        - end_page_number
        - start_page_number
        - type
      title: RequestPageLocationCitation
      type: object
    BetaRequestSearchResultLocationCitation:
      additionalProperties: false
      properties:
        cited_text:
          description: >-
            被引用的块范围的完整文本，拼接而成。


            始终等于 `content[start_block_index:end_block_index]`
            各段内容连接后的结果。文本块是最小的可引用单位；该字段不会是单个块的子串。不计入输出令牌，在后续轮次传回时也不计入输入令牌。
          examples:
            - The grass is green. The sky is blue.
          title: 引用文本
          type: string
        end_block_index:
          description: >-
            所引用区块范围在源 `content` 数组中的排他性 0 基结束索引。


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

            与 `document_index` 分开计数；服务端网页搜索结果不包含在此计数中。
          minimum: 0
          title: 搜索结果索引
          type: integer
        source:
          title: 来源
          type: string
        start_block_index:
          description: 来源的 `content` 数组中第一个被引用块的从 0 开始的索引。
          minimum: 0
          title: 起始内容块索引
          type: integer
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: 标题
        type:
          const: search_result_location
          title: 类型
          type: string
      required:
        - cited_text
        - end_block_index
        - search_result_index
        - source
        - start_block_index
        - title
        - type
      title: RequestSearchResultLocationCitation
      type: object
    BetaRequestWebSearchResultLocationCitation:
      additionalProperties: false
      properties:
        cited_text:
          examples:
            - The grass is green. The sky is blue.
          title: 引用文本
          type: string
        encrypted_index:
          title: 加密索引
          type: string
        title:
          anyOf:
            - maxLength: 512
              minLength: 1
              type: string
            - type: 'null'
          title: 标题
        type:
          const: web_search_result_location
          title: 类型
          type: string
        url:
          minLength: 1
          title: URL
          type: string
      required:
        - cited_text
        - encrypted_index
        - title
        - type
        - url
      title: RequestWebSearchResultLocationCitation
      type: object
    BetaToolChoiceAny:
      additionalProperties: false
      description: 模型将使用任何可用的工具。
      properties:
        disable_parallel_tool_use:
          description: |-
            是否禁用并行工具使用。

            默认为 `false`。如果设为 `true`，模型将恰好输出一个 tool use。
          title: 禁用并行工具调用
          type: boolean
        type:
          const: any
          title: 类型
          type: string
      required:
        - type
      title: ToolChoiceAny
      type: object
    BetaToolChoiceAuto:
      additionalProperties: false
      description: 模型将自动决定是否使用工具。
      properties:
        disable_parallel_tool_use:
          description: |-
            是否禁用并行工具使用。

            默认为 `false`。如果设为 `true`，模型最多输出一个 tool use。
          title: 禁用并行工具调用
          type: boolean
        type:
          const: auto
          title: 类型
          type: string
      required:
        - type
      title: ToolChoiceAuto
      type: object
    BetaToolChoiceNone:
      additionalProperties: false
      description: 模型将不被允许使用工具。
      properties:
        type:
          const: none
          title: 类型
          type: string
      required:
        - type
      title: ToolChoiceNone
      type: object
      x-stainless-go-constant-constructor: true
    BetaToolChoiceTool:
      additionalProperties: false
      description: 模型将使用 `tool_choice.name` 指定的工具。
      properties:
        disable_parallel_tool_use:
          description: |-
            是否禁用并行工具使用。

            默认为 `false`。如果设为 `true`，模型将恰好输出一个 tool use。
          title: 禁用并行工具调用
          type: boolean
        name:
          description: 要使用的工具的名称。
          title: 名称
          type: string
        type:
          const: tool
          title: 类型
          type: string
      required:
        - name
        - type
      title: ToolChoiceTool
      type: object
    BetaInputSchema:
      additionalProperties: true
      properties:
        properties:
          anyOf:
            - type: object
              additionalProperties: true
            - type: 'null'
          title: 属性
        required:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: 必填字段
        type:
          const: object
          title: 类型
          type: string
      required:
        - type
      title: InputSchema
      type: object
    BetaAllowedCaller:
      description: |-
        指定谁可以调用工具。

        取值：
            direct: 模型可以直接调用该工具。
            code_execution_20250825: 该工具可以从代码执行环境（v1）调用。
            code_execution_20260120: 该工具可以从代码执行环境（v2，带持久化）调用。
            code_execution_20260521: 该工具可以从代码执行环境（v2，带持久化）调用。
      enum:
        - direct
        - code_execution_20250825
        - code_execution_20260120
        - code_execution_20260521
      title: AllowedCaller
      type: string
    BetaJsonValue: {}
    BetaUserLocation:
      additionalProperties: false
      properties:
        city:
          anyOf:
            - maxLength: 255
              minLength: 1
              type: string
            - type: 'null'
          description: 用户所在的城市。
          examples:
            - New York
            - Tokyo
            - Los Angeles
          title: 城市
        country:
          anyOf:
            - maxLength: 2
              minLength: 2
              type: string
            - type: 'null'
          description: >-
            用户的两个字母 [ISO
            国家/地区代码](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)。
          examples:
            - US
            - JP
            - GB
          title: 国家或地区
        region:
          anyOf:
            - maxLength: 255
              minLength: 1
              type: string
            - type: 'null'
          description: 用户所在的地区。
          examples:
            - California
            - Ontario
            - Wales
          title: 地区
        timezone:
          anyOf:
            - maxLength: 255
              minLength: 1
              type: string
            - type: 'null'
          description: 用户的 [IANA 时区](https://nodatime.org/TimeZones)。
          examples:
            - America/New_York
            - Asia/Tokyo
            - Europe/London
          title: 时区
        type:
          const: approximate
          title: 类型
          type: string
      required:
        - type
      title: UserLocation
      type: object
    BetaRequestCitationsConfig:
      additionalProperties: false
      properties:
        enabled:
          title: 已启用
          type: boolean
      title: RequestCitationsConfig
      type: object
    BetaMCPToolConfig:
      additionalProperties: false
      description: MCP 工具集中特定工具的配置。
      properties:
        defer_loading:
          title: 延迟加载
          type: boolean
        enabled:
          title: 已启用
          type: boolean
      title: MCPToolConfig
      type: object
    BetaMCPToolDefaultConfig:
      additionalProperties: false
      description: MCP 工具集中工具的默认配置。
      properties:
        defer_loading:
          title: 延迟加载
          type: boolean
        enabled:
          title: 已启用
          type: boolean
      title: MCPToolDefaultConfig
      type: object
    BetaRequestAdvisorToolResultBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaRequestAdvisorToolResultError'
            - $ref: '#/components/schemas/BetaRequestAdvisorResultBlock'
            - $ref: '#/components/schemas/BetaRequestAdvisorRedactedResultBlock'
          title: 内容
        tool_use_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: 工具调用 ID
          type: string
        type:
          const: advisor_tool_result
          title: 类型
          type: string
      required:
        - content
        - tool_use_id
        - type
      title: RequestAdvisorToolResultBlock
      type: object
    BetaRequestBashCodeExecutionToolResultBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaRequestBashCodeExecutionToolResultError'
            - $ref: '#/components/schemas/BetaRequestBashCodeExecutionResultBlock'
          title: 内容
        tool_use_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: 工具调用 ID
          type: string
        type:
          const: bash_code_execution_tool_result
          title: 类型
          type: string
      required:
        - content
        - tool_use_id
        - type
      title: RequestBashCodeExecutionToolResultBlock
      type: object
    BetaRequestCodeExecutionToolResultBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaRequestCodeExecutionToolResultError'
              x-stainless-naming:
                go:
                  variant_constructor: BetaNewCodeExecutionToolRequestError
            - $ref: '#/components/schemas/BetaRequestCodeExecutionResultBlock'
            - $ref: >-
                #/components/schemas/BetaRequestEncryptedCodeExecutionResultBlock
          title: 内容
        tool_use_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: 工具调用 ID
          type: string
        type:
          const: code_execution_tool_result
          title: 类型
          type: string
      required:
        - content
        - tool_use_id
        - type
      title: RequestCodeExecutionToolResultBlock
      type: object
    BetaRequestCompactionBlock:
      additionalProperties: false
      description: |-
        包含先前上下文摘要的压缩（compaction）块。

        用户应将这些块从响应原样传回后续请求，
        以在压缩边界之间保持上下文。

        当内容为 None 时，该块表示一次失败的压缩。服务器
        将这些情况视为无操作。不允许内容为空字符串。
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        content:
          anyOf:
            - type: string
            - type: 'null'
          description: 先前压缩内容的摘要；压缩失败时为 null
          title: 内容
        encrypted_content:
          anyOf:
            - type: string
            - type: 'null'
          description: 来自上一次压缩的不透明元数据，需原样回传
          title: 加密内容
        type:
          const: compaction
          title: 类型
          type: string
      required:
        - type
      title: RequestCompactionBlock
      type: object
    BetaRequestContainerUploadBlock:
      additionalProperties: false
      description: |-
        表示要上传到容器的文件的内容块。
        通过此块上传的文件可在容器的输入目录中使用。
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        file_id:
          title: 文件 ID
          type: string
        type:
          const: container_upload
          title: 类型
          type: string
      required:
        - file_id
        - type
      title: RequestContainerUploadBlock
      type: object
    BetaRequestDocumentBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        citations:
          anyOf:
            - $ref: '#/components/schemas/BetaRequestCitationsConfig'
            - type: 'null'
        context:
          anyOf:
            - minLength: 1
              type: string
            - type: 'null'
          title: 上下文
        source:
          discriminator:
            mapping:
              base64:
                $ref: '#/components/schemas/BetaBase64PDFSource'
              content:
                $ref: '#/components/schemas/BetaContentBlockSource'
              file:
                $ref: '#/components/schemas/BetaFileDocumentSource'
              text:
                $ref: '#/components/schemas/BetaPlainTextSource'
              url:
                $ref: '#/components/schemas/BetaURLPDFSource'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaBase64PDFSource'
            - $ref: '#/components/schemas/BetaPlainTextSource'
            - $ref: '#/components/schemas/BetaContentBlockSource'
            - $ref: '#/components/schemas/BetaURLPDFSource'
            - $ref: '#/components/schemas/BetaFileDocumentSource'
          title: 来源
        title:
          anyOf:
            - maxLength: 500
              minLength: 1
              type: string
            - type: 'null'
          title: 标题
        type:
          const: document
          title: 类型
          type: string
      required:
        - source
        - type
      title: RequestDocumentBlock
      type: object
    BetaRequestFallbackBlock:
      additionalProperties: false
      description: >-
        从先前响应中原样回传的 `fallback` 块。


        在 `messages[].content` 中接受，但不会渲染进提示；不会针对请求的 `fallbacks` 链或顶层 `model`
        进行校验。


        请原样回传助手回合，包括位于其原始位置的这个块。该块标记了 fallback
        跳转前后所产生内容的边界，服务器依赖该边界来校验回合：当思考运行分列边界两侧时，省略该块会将它们合并为一个服务器无法校验的跨度（请求会被拒绝），将其移动到单次运行中间同样会被拒绝；在非思考块之间，该块的位置没有校验效果。
      properties:
        from:
          $ref: '#/components/schemas/BetaRequestFallbackHopInfo'
        to:
          $ref: '#/components/schemas/BetaRequestFallbackHopInfo'
        trigger:
          description: 响应块的 `trigger`，原样回显。服务器会接受但忽略该值；允许任意对象或 `null`。
          title: 触发条件
        type:
          const: fallback
          title: 类型
          type: string
      required:
        - from
        - to
        - type
      title: RequestFallbackBlock
      type: object
    BetaRequestImageBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        source:
          discriminator:
            mapping:
              base64:
                $ref: '#/components/schemas/BetaBase64ImageSource'
              file:
                $ref: '#/components/schemas/BetaFileImageSource'
              url:
                $ref: '#/components/schemas/BetaURLImageSource'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaBase64ImageSource'
            - $ref: '#/components/schemas/BetaURLImageSource'
            - $ref: '#/components/schemas/BetaFileImageSource'
          title: 来源
        type:
          const: image
          title: 类型
          type: string
      required:
        - source
        - type
      title: RequestImageBlock
      type: object
    BetaRequestMCPToolResultBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        content:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/BetaRequestTextBlock'
                title: beta_mcp_tool_result_block_param_content_item
              type: array
              title: beta_mcp_tool_result_block_param_content
          title: 内容
        is_error:
          title: 是否为错误
          type: boolean
        tool_use_id:
          pattern: ^[a-zA-Z0-9_-]+$
          title: 工具调用 ID
          type: string
        type:
          const: mcp_tool_result
          title: 类型
          type: string
      required:
        - tool_use_id
        - type
      title: RequestMCPToolResultBlock
      type: object
    BetaRequestMCPToolUseBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        id:
          pattern: ^[a-zA-Z0-9_-]+$
          title: ID
          type: string
        input:
          additionalProperties: true
          title: 输入
          type: object
        name:
          title: 名称
          type: string
        server_name:
          description: MCP 服务器的名称
          title: 服务器名称
          type: string
        type:
          const: mcp_tool_use
          title: 类型
          type: string
      required:
        - id
        - input
        - name
        - server_name
        - type
      title: RequestMCPToolUseBlock
      type: object
    BetaRequestMidConvSystemBlock:
      additionalProperties: false
      description: |-
        出现在会话中途的系统指令。

        使用此块可在会话的特定时刻提供或更新系统级
        指令，而不是仅通过顶层 `system` 参数。
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        content:
          description: 系统指令文本块。
          items:
            discriminator:
              mapping:
                text:
                  $ref: '#/components/schemas/BetaRequestTextBlock'
                tool_addition:
                  $ref: '#/components/schemas/BetaRequestToolAdditionBlock'
                tool_removal:
                  $ref: '#/components/schemas/BetaRequestToolRemovalBlock'
              propertyName: type
            oneOf:
              - $ref: '#/components/schemas/BetaRequestTextBlock'
              - $ref: '#/components/schemas/BetaRequestToolAdditionBlock'
              - $ref: '#/components/schemas/BetaRequestToolRemovalBlock'
          title: 内容
          type: array
        type:
          const: mid_conv_system
          title: 类型
          type: string
      required:
        - content
        - type
      title: RequestMidConvSystemBlock
      type: object
    BetaRequestRedactedThinkingBlock:
      additionalProperties: false
      properties:
        data:
          description: 此经过编辑的思考块的 `data` 值，与 API 在先前响应中返回的完全一致。不透明且已加密；请原样传回。
          title: 数据
          type: string
        type:
          const: redacted_thinking
          title: 类型
          type: string
      required:
        - data
        - type
      title: RequestRedactedThinkingBlock
      type: object
    BetaRequestSearchResultBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        citations:
          $ref: '#/components/schemas/BetaRequestCitationsConfig'
        content:
          items:
            $ref: '#/components/schemas/BetaRequestTextBlock'
          title: 内容
          type: array
        source:
          title: 来源
          type: string
        title:
          title: 标题
          type: string
        type:
          const: search_result
          title: 类型
          type: string
      required:
        - content
        - source
        - title
        - type
      title: RequestSearchResultBlock
      type: object
    BetaRequestServerToolUseBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        caller:
          discriminator:
            mapping:
              code_execution_20250825:
                $ref: '#/components/schemas/BetaServerToolCaller'
              code_execution_20260120:
                $ref: '#/components/schemas/BetaServerToolCaller_20260120'
              direct:
                $ref: '#/components/schemas/BetaDirectCaller'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller_20260120'
          title: 调用方
        id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: ID
          type: string
        input:
          additionalProperties: true
          title: 输入
          type: object
        name:
          enum:
            - advisor
            - web_search
            - web_fetch
            - code_execution
            - bash_code_execution
            - text_editor_code_execution
            - tool_search_tool_regex
            - tool_search_tool_bm25
          title: 名称
          type: string
        type:
          const: server_tool_use
          title: 类型
          type: string
      required:
        - id
        - input
        - name
        - type
      title: RequestServerToolUseBlock
      type: object
    BetaRequestTextEditorCodeExecutionToolResultBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        content:
          anyOf:
            - $ref: >-
                #/components/schemas/BetaRequestTextEditorCodeExecutionToolResultError
            - $ref: >-
                #/components/schemas/BetaRequestTextEditorCodeExecutionViewResultBlock
            - $ref: >-
                #/components/schemas/BetaRequestTextEditorCodeExecutionCreateResultBlock
            - $ref: >-
                #/components/schemas/BetaRequestTextEditorCodeExecutionStrReplaceResultBlock
          title: 内容
        tool_use_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: 工具调用 ID
          type: string
        type:
          const: text_editor_code_execution_tool_result
          title: 类型
          type: string
      required:
        - content
        - tool_use_id
        - type
      title: RequestTextEditorCodeExecutionToolResultBlock
      type: object
    BetaRequestThinkingBlock:
      additionalProperties: false
      properties:
        signature:
          description: |-
            此思考块的 `signature` 值，与 API 在先前响应中返回的完全一致。用于验证该块确实由模型生成。

            思考块必须原样按原始顺序回传；修改过的块会导致 400 `invalid_request_error`。
          title: 签名
          type: string
        thinking:
          description: API 返回的此块的 `thinking` 文本。
          title: 思考
          type: string
        type:
          const: thinking
          title: 类型
          type: string
      required:
        - signature
        - thinking
        - type
      title: RequestThinkingBlock
      type: object
    BetaRequestToolAdditionBlock:
      additionalProperties: false
      description: |-
        会话中途呈现已声明工具的指令。

        ``tool`` 按名称引用请求的
        ``tools`` 中的某个工具（或 MCP 工具集）；从会话中
        的这一时刻起，该工具将提供给模型。
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        tool:
          discriminator:
            mapping:
              mcp_tool_reference:
                $ref: '#/components/schemas/BetaToolChangeMCPToolReference'
              mcp_toolset_reference:
                $ref: '#/components/schemas/BetaToolChangeMCPToolsetReference'
              tool_reference:
                $ref: '#/components/schemas/BetaToolChangeToolReference'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaToolChangeToolReference'
            - $ref: '#/components/schemas/BetaToolChangeMCPToolReference'
            - $ref: '#/components/schemas/BetaToolChangeMCPToolsetReference'
          title: 工具
        type:
          const: tool_addition
          title: 类型
          type: string
      required:
        - tool
        - type
      title: RequestToolAdditionBlock
      type: object
    BetaRequestToolRemovalBlock:
      additionalProperties: false
      description: |-
        会话中途撤回工具的指令。

        ``tool`` 按名称引用请求的
        ``tools`` 中的某个工具（或 MCP 工具集）；从会话中
        的这一时刻起，该工具不再提供给模型。
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        tool:
          discriminator:
            mapping:
              mcp_tool_reference:
                $ref: '#/components/schemas/BetaToolChangeMCPToolReference'
              mcp_toolset_reference:
                $ref: '#/components/schemas/BetaToolChangeMCPToolsetReference'
              tool_reference:
                $ref: '#/components/schemas/BetaToolChangeToolReference'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaToolChangeToolReference'
            - $ref: '#/components/schemas/BetaToolChangeMCPToolReference'
            - $ref: '#/components/schemas/BetaToolChangeMCPToolsetReference'
          title: 工具
        type:
          const: tool_removal
          title: 类型
          type: string
      required:
        - tool
        - type
      title: RequestToolRemovalBlock
      type: object
    BetaRequestToolResultBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        content:
          anyOf:
            - type: string
              x-stainless-skip:
                - go
                - cli
            - items:
                discriminator:
                  mapping:
                    document:
                      $ref: '#/components/schemas/BetaRequestDocumentBlock'
                    image:
                      $ref: '#/components/schemas/BetaRequestImageBlock'
                    search_result:
                      $ref: '#/components/schemas/BetaRequestSearchResultBlock'
                    text:
                      $ref: '#/components/schemas/BetaRequestTextBlock'
                    tool_reference:
                      $ref: '#/components/schemas/BetaRequestToolReferenceBlock'
                  propertyName: type
                oneOf:
                  - $ref: '#/components/schemas/BetaRequestTextBlock'
                  - $ref: '#/components/schemas/BetaRequestImageBlock'
                  - $ref: '#/components/schemas/BetaRequestSearchResultBlock'
                  - $ref: '#/components/schemas/BetaRequestDocumentBlock'
                  - $ref: '#/components/schemas/BetaRequestToolReferenceBlock'
                title: 内容块
              type: array
              x-stainless-naming:
                python:
                  type_name: Content
                ruby:
                  type_name: Content
                php:
                  type_name: Content
          title: 内容
        is_error:
          title: 是否为错误
          type: boolean
        tool_use_id:
          pattern: ^[a-zA-Z0-9_-]+$
          title: 工具调用 ID
          type: string
        type:
          const: tool_result
          title: 类型
          type: string
      required:
        - tool_use_id
        - type
      title: RequestToolResultBlock
      type: object
    BetaRequestToolSearchToolResultBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaRequestToolSearchToolResultError'
            - $ref: '#/components/schemas/BetaRequestToolSearchToolSearchResultBlock'
          title: 内容
        tool_use_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: 工具调用 ID
          type: string
        type:
          const: tool_search_tool_result
          title: 类型
          type: string
      required:
        - content
        - tool_use_id
        - type
      title: RequestToolSearchToolResultBlock
      type: object
    BetaRequestToolUseBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        caller:
          discriminator:
            mapping:
              code_execution_20250825:
                $ref: '#/components/schemas/BetaServerToolCaller'
              code_execution_20260120:
                $ref: '#/components/schemas/BetaServerToolCaller_20260120'
              direct:
                $ref: '#/components/schemas/BetaDirectCaller'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller_20260120'
          title: 调用方
        id:
          pattern: ^[a-zA-Z0-9_-]+$
          title: ID
          type: string
        input:
          additionalProperties: true
          title: 输入
          type: object
        name:
          maxLength: 200
          minLength: 1
          title: 名称
          type: string
        type:
          const: tool_use
          title: 类型
          type: string
      required:
        - id
        - input
        - name
        - type
      title: RequestToolUseBlock
      type: object
    BetaRequestWebFetchToolResultBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        caller:
          discriminator:
            mapping:
              code_execution_20250825:
                $ref: '#/components/schemas/BetaServerToolCaller'
              code_execution_20260120:
                $ref: '#/components/schemas/BetaServerToolCaller_20260120'
              direct:
                $ref: '#/components/schemas/BetaDirectCaller'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller_20260120'
          title: 调用方
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaRequestWebFetchToolResultError'
            - $ref: '#/components/schemas/BetaRequestWebFetchResultBlock'
          title: 内容
        tool_use_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: 工具调用 ID
          type: string
        type:
          const: web_fetch_tool_result
          title: 类型
          type: string
      required:
        - content
        - tool_use_id
        - type
      title: RequestWebFetchToolResultBlock
      type: object
    BetaRequestWebSearchToolResultBlock:
      additionalProperties: false
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        caller:
          discriminator:
            mapping:
              code_execution_20250825:
                $ref: '#/components/schemas/BetaServerToolCaller'
              code_execution_20260120:
                $ref: '#/components/schemas/BetaServerToolCaller_20260120'
              direct:
                $ref: '#/components/schemas/BetaDirectCaller'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller_20260120'
          title: 调用方
        content:
          anyOf:
            - items:
                $ref: '#/components/schemas/BetaRequestWebSearchResultBlock'
              type: array
              title: 结果块
            - $ref: '#/components/schemas/BetaRequestWebSearchToolResultError'
              x-stainless-naming:
                go:
                  variant_constructor: BetaNewWebSearchToolRequestError
          title: 内容
        tool_use_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: 工具调用 ID
          type: string
        type:
          const: web_search_tool_result
          title: 类型
          type: string
      required:
        - content
        - tool_use_id
        - type
      title: RequestWebSearchToolResultBlock
      type: object
    BetaAllThinkingTurns:
      additionalProperties: false
      properties:
        type:
          const: all
          title: 类型
          type: string
      required:
        - type
      title: AllThinkingTurns
      type: object
    BetaThinkingTurns:
      additionalProperties: false
      properties:
        type:
          const: thinking_turns
          title: 类型
          type: string
        value:
          minimum: 1
          title: 值
          type: integer
      required:
        - type
        - value
      title: ThinkingTurns
      type: object
    BetaInputTokensClearAtLeast:
      additionalProperties: false
      properties:
        type:
          const: input_tokens
          title: 类型
          type: string
        value:
          minimum: 0
          title: 值
          type: integer
      required:
        - type
        - value
      title: InputTokensClearAtLeast
      type: object
    BetaToolUsesKeep:
      additionalProperties: false
      properties:
        type:
          const: tool_uses
          title: 类型
          type: string
        value:
          minimum: 0
          title: 值
          type: integer
      required:
        - type
        - value
      title: ToolUsesKeep
      type: object
    BetaInputTokensTrigger:
      additionalProperties: false
      properties:
        type:
          const: input_tokens
          title: 类型
          type: string
        value:
          minimum: 1
          title: 值
          type: integer
      required:
        - type
        - value
      title: InputTokensTrigger
      type: object
    BetaToolUsesTrigger:
      additionalProperties: false
      properties:
        type:
          const: tool_uses
          title: 类型
          type: string
        value:
          minimum: 1
          title: 值
          type: integer
      required:
        - type
        - value
      title: ToolUsesTrigger
      type: object
    BetaThinkingDisplayMode:
      enum:
        - summarized
        - omitted
      title: ThinkingDisplayMode
      type: string
    BetaRequestAdvisorToolResultError:
      additionalProperties: false
      properties:
        error_code:
          $ref: '#/components/schemas/BetaAdvisorToolResultErrorCode'
        type:
          const: advisor_tool_result_error
          title: 类型
          type: string
      required:
        - error_code
        - type
      title: RequestAdvisorToolResultError
      type: object
    BetaRequestAdvisorResultBlock:
      additionalProperties: false
      properties:
        stop_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: 停止原因
        text:
          title: 文本
          type: string
        type:
          const: advisor_result
          title: 类型
          type: string
      required:
        - text
        - type
      title: RequestAdvisorResultBlock
      type: object
    BetaRequestAdvisorRedactedResultBlock:
      additionalProperties: false
      properties:
        encrypted_content:
          description: 由先前响应生成的不透明数据块；必须原样回传。
          title: 加密内容
          type: string
        stop_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: 停止原因
        type:
          const: advisor_redacted_result
          title: 类型
          type: string
      required:
        - encrypted_content
        - type
      title: RequestAdvisorRedactedResultBlock
      type: object
    BetaRequestBashCodeExecutionToolResultError:
      additionalProperties: false
      properties:
        error_code:
          $ref: '#/components/schemas/BetaBashCodeExecutionToolResultErrorCode'
        type:
          const: bash_code_execution_tool_result_error
          title: 类型
          type: string
      required:
        - error_code
        - type
      title: RequestBashCodeExecutionToolResultError
      type: object
    BetaRequestBashCodeExecutionResultBlock:
      additionalProperties: false
      properties:
        content:
          items:
            $ref: '#/components/schemas/BetaRequestBashCodeExecutionOutputBlock'
          title: 内容
          type: array
        return_code:
          title: 返回码
          type: integer
        stderr:
          title: 标准错误输出
          type: string
        stdout:
          title: 标准输出
          type: string
        type:
          const: bash_code_execution_result
          title: 类型
          type: string
      required:
        - content
        - return_code
        - stderr
        - stdout
        - type
      title: RequestBashCodeExecutionResultBlock
      type: object
    BetaRequestCodeExecutionToolResultError:
      additionalProperties: false
      properties:
        error_code:
          $ref: '#/components/schemas/BetaCodeExecutionToolResultErrorCode'
        type:
          const: code_execution_tool_result_error
          title: 类型
          type: string
      required:
        - error_code
        - type
      title: Error
      type: object
    BetaRequestCodeExecutionResultBlock:
      additionalProperties: false
      properties:
        content:
          items:
            $ref: '#/components/schemas/BetaRequestCodeExecutionOutputBlock'
          title: 内容
          type: array
        return_code:
          title: 返回码
          type: integer
        stderr:
          title: 标准错误输出
          type: string
        stdout:
          title: 标准输出
          type: string
        type:
          const: code_execution_result
          title: 类型
          type: string
      required:
        - content
        - return_code
        - stderr
        - stdout
        - type
      title: Result Block
      type: object
    BetaRequestEncryptedCodeExecutionResultBlock:
      additionalProperties: false
      description: 带有加密 stdout 的代码执行结果，用于 PFC + web_search 结果。
      properties:
        content:
          items:
            $ref: '#/components/schemas/BetaRequestCodeExecutionOutputBlock'
          title: 内容
          type: array
        encrypted_stdout:
          title: 加密标准输出
          type: string
        return_code:
          title: 返回码
          type: integer
        stderr:
          title: 标准错误输出
          type: string
        type:
          const: encrypted_code_execution_result
          title: 类型
          type: string
      required:
        - content
        - encrypted_stdout
        - return_code
        - stderr
        - type
      title: RequestEncryptedCodeExecutionResultBlock
      type: object
    BetaBase64PDFSource:
      additionalProperties: false
      properties:
        data:
          format: byte
          title: 数据
          type: string
        media_type:
          const: application/pdf
          title: 媒体类型
          type: string
        type:
          const: base64
          title: 类型
          type: string
      required:
        - data
        - media_type
        - type
      title: Base64PDFSource
      type: object
    BetaContentBlockSource:
      additionalProperties: false
      properties:
        content:
          anyOf:
            - type: string
            - items:
                discriminator:
                  mapping:
                    image:
                      $ref: '#/components/schemas/BetaRequestImageBlock'
                    text:
                      $ref: '#/components/schemas/BetaRequestTextBlock'
                  propertyName: type
                oneOf:
                  - $ref: '#/components/schemas/BetaRequestTextBlock'
                  - $ref: '#/components/schemas/BetaRequestImageBlock'
                title: beta_content_block_source_content_item
              type: array
              title: beta_content_block_source_content
          title: 内容
        type:
          const: content
          title: 类型
          type: string
      required:
        - content
        - type
      title: ContentBlockSource
      type: object
    BetaFileDocumentSource:
      additionalProperties: false
      properties:
        file_id:
          title: 文件 ID
          type: string
        type:
          const: file
          title: 类型
          type: string
      required:
        - file_id
        - type
      title: FileDocumentSource
      type: object
    BetaPlainTextSource:
      additionalProperties: false
      properties:
        data:
          title: 数据
          type: string
        media_type:
          const: text/plain
          title: 媒体类型
          type: string
        type:
          const: text
          title: 类型
          type: string
      required:
        - data
        - media_type
        - type
      title: PlainTextSource
      type: object
    BetaURLPDFSource:
      additionalProperties: false
      properties:
        type:
          const: url
          title: 类型
          type: string
        url:
          title: URL
          type: string
      required:
        - type
        - url
      title: URLPDFSource
      type: object
    BetaRequestFallbackHopInfo:
      additionalProperties: false
      description: 标识回退转换中的一跳。
      properties:
        model:
          $ref: '#/components/schemas/Model'
      required:
        - model
      title: RequestFallbackHopInfo
      type: object
    BetaBase64ImageSource:
      additionalProperties: false
      properties:
        data:
          format: byte
          title: 数据
          type: string
        media_type:
          enum:
            - image/jpeg
            - image/png
            - image/gif
            - image/webp
          title: 媒体类型
          type: string
        type:
          const: base64
          title: 类型
          type: string
      required:
        - data
        - media_type
        - type
      title: Base64ImageSource
      type: object
    BetaFileImageSource:
      additionalProperties: false
      properties:
        file_id:
          title: 文件 ID
          type: string
        type:
          const: file
          title: 类型
          type: string
      required:
        - file_id
        - type
      title: FileImageSource
      type: object
    BetaURLImageSource:
      additionalProperties: false
      properties:
        type:
          const: url
          title: 类型
          type: string
        url:
          title: URL
          type: string
      required:
        - type
        - url
      title: URLImageSource
      type: object
    BetaServerToolCaller:
      additionalProperties: false
      description: 由服务器端工具生成的工具调用。
      properties:
        tool_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: 工具 ID
          type: string
        type:
          const: code_execution_20250825
          title: 类型
          type: string
      required:
        - tool_id
        - type
      title: ServerToolCaller
      type: object
    BetaServerToolCaller_20260120:
      additionalProperties: false
      properties:
        tool_id:
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
          title: 工具 ID
          type: string
        type:
          const: code_execution_20260120
          title: 类型
          type: string
      required:
        - tool_id
        - type
      title: ServerToolCaller_20260120
      type: object
    BetaDirectCaller:
      additionalProperties: false
      description: 模型直接发起的工具调用。
      properties:
        type:
          const: direct
          title: 类型
          type: string
      required:
        - type
      title: DirectCaller
      type: object
    BetaRequestTextEditorCodeExecutionToolResultError:
      additionalProperties: false
      properties:
        error_code:
          $ref: '#/components/schemas/BetaTextEditorCodeExecutionToolResultErrorCode'
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: 错误消息
        type:
          const: text_editor_code_execution_tool_result_error
          title: 类型
          type: string
      required:
        - error_code
        - type
      title: RequestTextEditorCodeExecutionToolResultError
      type: object
    BetaRequestTextEditorCodeExecutionViewResultBlock:
      additionalProperties: false
      properties:
        content:
          title: 内容
          type: string
        file_type:
          enum:
            - text
            - image
            - pdf
          title: 文件类型
          type: string
        num_lines:
          anyOf:
            - type: integer
            - type: 'null'
          title: 行数
        start_line:
          anyOf:
            - type: integer
            - type: 'null'
          title: 起始行
        total_lines:
          anyOf:
            - type: integer
            - type: 'null'
          title: 总行数
        type:
          const: text_editor_code_execution_view_result
          title: 类型
          type: string
      required:
        - content
        - file_type
        - type
      title: RequestTextEditorCodeExecutionViewResultBlock
      type: object
    BetaRequestTextEditorCodeExecutionCreateResultBlock:
      additionalProperties: false
      properties:
        is_file_update:
          title: 是否为文件更新
          type: boolean
        type:
          const: text_editor_code_execution_create_result
          title: 类型
          type: string
      required:
        - is_file_update
        - type
      title: RequestTextEditorCodeExecutionCreateResultBlock
      type: object
    BetaRequestTextEditorCodeExecutionStrReplaceResultBlock:
      additionalProperties: false
      properties:
        lines:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: 行
        new_lines:
          anyOf:
            - type: integer
            - type: 'null'
          title: 新行
        new_start:
          anyOf:
            - type: integer
            - type: 'null'
          title: 新起始位置
        old_lines:
          anyOf:
            - type: integer
            - type: 'null'
          title: 原行
        old_start:
          anyOf:
            - type: integer
            - type: 'null'
          title: 原起始位置
        type:
          const: text_editor_code_execution_str_replace_result
          title: 类型
          type: string
      required:
        - type
      title: RequestTextEditorCodeExecutionStrReplaceResultBlock
      type: object
    BetaToolChangeMCPToolReference:
      additionalProperties: false
      description: |-
        通过 server 和 remote name 引用单个 MCP 工具 —— 与
        ``mcp_tool_use`` 所携带的 ``server_name``/``name`` 对相同。
      properties:
        name:
          title: 名称
          type: string
        server_name:
          title: 服务器名称
          type: string
        type:
          const: mcp_tool_reference
          title: 类型
          type: string
      required:
        - name
        - server_name
        - type
      title: ToolChangeMCPToolReference
      type: object
    BetaToolChangeMCPToolsetReference:
      additionalProperties: false
      description: 对指定 MCP 服务器工具集中所有工具的引用。
      properties:
        server_name:
          title: 服务器名称
          type: string
        type:
          const: mcp_toolset_reference
          title: 类型
          type: string
      required:
        - server_name
        - type
      title: ToolChangeMCPToolsetReference
      type: object
    BetaToolChangeToolReference:
      additionalProperties: false
      description: >-
        引用调用方直接在

        ``tools[]`` 中声明的单个工具。不接受服务端为 MCP 解析出的工具所分配的

        ``{server}_{name}`` 组合形式——这些工具请使用 ``mcp_tool_reference`` 或
        ``mcp_toolset_reference``。
      properties:
        name:
          pattern: ^[a-zA-Z0-9_-]{1,128}$
          title: 名称
          type: string
        type:
          const: tool_reference
          title: 类型
          type: string
      required:
        - name
        - type
      title: ToolChangeToolReference
      type: object
    BetaRequestToolReferenceBlock:
      additionalProperties: false
      description: 可包含在 tool_result 内容中的工具引用块。
      properties:
        cache_control:
          anyOf:
            - discriminator:
                mapping:
                  ephemeral:
                    $ref: '#/components/schemas/BetaCacheControlEphemeral'
                propertyName: type
              oneOf:
                - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在此内容块处创建缓存控制断点。
          title: 缓存控制
        tool_name:
          maxLength: 256
          minLength: 1
          pattern: ^[a-zA-Z0-9_-]{1,256}$
          title: 工具名称
          type: string
        type:
          const: tool_reference
          title: 类型
          type: string
      required:
        - tool_name
        - type
      title: RequestToolReferenceBlock
      type: object
    BetaRequestToolSearchToolResultError:
      additionalProperties: false
      properties:
        error_code:
          $ref: '#/components/schemas/BetaToolSearchToolResultErrorCode'
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: 错误消息
        type:
          const: tool_search_tool_result_error
          title: 类型
          type: string
      required:
        - error_code
        - type
      title: RequestToolSearchToolResultError
      type: object
    BetaRequestToolSearchToolSearchResultBlock:
      additionalProperties: false
      properties:
        tool_references:
          items:
            $ref: '#/components/schemas/BetaRequestToolReferenceBlock'
          title: 工具引用
          type: array
        type:
          const: tool_search_tool_search_result
          title: 类型
          type: string
      required:
        - tool_references
        - type
      title: RequestToolSearchToolSearchResultBlock
      type: object
    BetaRequestWebFetchToolResultError:
      additionalProperties: false
      properties:
        error_code:
          $ref: '#/components/schemas/BetaWebFetchToolResultErrorCode'
        type:
          const: web_fetch_tool_result_error
          title: 类型
          type: string
      required:
        - error_code
        - type
      title: RequestWebFetchToolResultError
      type: object
    BetaRequestWebFetchResultBlock:
      additionalProperties: false
      properties:
        content:
          $ref: '#/components/schemas/BetaRequestDocumentBlock'
        retrieved_at:
          anyOf:
            - type: string
            - type: 'null'
          description: 内容获取时间的 ISO 8601 时间戳
          title: 获取时间
        type:
          const: web_fetch_result
          title: 类型
          type: string
        url:
          description: 已抓取内容的 URL
          title: URL
          type: string
      required:
        - content
        - type
        - url
      title: RequestWebFetchResultBlock
      type: object
    BetaRequestWebSearchResultBlock:
      additionalProperties: false
      properties:
        encrypted_content:
          title: 加密内容
          type: string
        page_age:
          anyOf:
            - type: string
            - type: 'null'
          title: 页面时效
        title:
          title: 标题
          type: string
        type:
          const: web_search_result
          title: 类型
          type: string
        url:
          title: URL
          type: string
      required:
        - encrypted_content
        - title
        - type
        - url
      title: RequestWebSearchResultBlock
      type: object
    BetaRequestWebSearchToolResultError:
      additionalProperties: false
      properties:
        error_code:
          $ref: '#/components/schemas/BetaWebSearchToolResultErrorCode'
        type:
          const: web_search_tool_result_error
          title: 类型
          type: string
      required:
        - error_code
        - type
      title: Error
      type: object
    BetaAdvisorToolResultErrorCode:
      enum:
        - max_uses_exceeded
        - prompt_too_long
        - too_many_requests
        - overloaded
        - unavailable
        - execution_time_exceeded
        - model_not_found
      title: AdvisorToolResultErrorCode
      type: string
    BetaBashCodeExecutionToolResultErrorCode:
      enum:
        - invalid_tool_input
        - unavailable
        - too_many_requests
        - execution_time_exceeded
        - output_file_too_large
      title: BashCodeExecutionToolResultErrorCode
      type: string
    BetaRequestBashCodeExecutionOutputBlock:
      additionalProperties: false
      properties:
        file_id:
          title: 文件 ID
          type: string
        type:
          const: bash_code_execution_output
          title: 类型
          type: string
      required:
        - file_id
        - type
      title: RequestBashCodeExecutionOutputBlock
      type: object
    BetaCodeExecutionToolResultErrorCode:
      enum:
        - invalid_tool_input
        - unavailable
        - too_many_requests
        - execution_time_exceeded
      title: CodeExecutionToolResultErrorCode
      type: string
    BetaRequestCodeExecutionOutputBlock:
      additionalProperties: false
      properties:
        file_id:
          title: 文件 ID
          type: string
        type:
          const: code_execution_output
          title: 类型
          type: string
      required:
        - file_id
        - type
      title: RequestCodeExecutionOutputBlock
      type: object
    BetaTextEditorCodeExecutionToolResultErrorCode:
      enum:
        - invalid_tool_input
        - unavailable
        - too_many_requests
        - execution_time_exceeded
        - file_not_found
      title: TextEditorCodeExecutionToolResultErrorCode
      type: string
    BetaToolSearchToolResultErrorCode:
      enum:
        - invalid_tool_input
        - unavailable
        - too_many_requests
        - execution_time_exceeded
      title: ToolSearchToolResultErrorCode
      type: string
    BetaWebFetchToolResultErrorCode:
      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
      title: WebFetchToolResultErrorCode
      type: string
    BetaWebSearchToolResultErrorCode:
      enum:
        - invalid_tool_input
        - unavailable
        - max_uses_exceeded
        - too_many_requests
        - query_too_long
        - request_too_large
      title: WebSearchToolResultErrorCode
      type: string
  securitySchemes:
    omaApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: OMA 工作区 API 密钥。
      x-default: sk-ant-local-default
    omaBearer:
      type: http
      scheme: bearer
      description: 以 Bearer 令牌形式发送的 OMA 工作区 API 密钥。

````