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

# Create message

Use the Anthropic Messages format to generate text with Claude from text or image inputs. Send requests to `https://geekai.co/api/v1/messages` (mainland China) or `https://geekai.dev/api/v1/messages` (international). Set the bearer token to your [GeekAI API key](https://geekai.co/user/api_keys). Request and response parameters follow the [Claude Messages API](https://docs.claude.com/en/api/messages).


## OpenAPI

````yaml openapi_claude.yaml POST /messages
openapi: 3.1.0
info:
  title: 极客智坊 Claude Messages API
  version: 1.0.1
  description: 兼容 Anthropic Messages 的接口。Beta 功能的可用性取决于模型、请求头和供应商线路。
servers:
  - url: https://geekai.co/api/v1
    description: 国内代理入口
  - url: https://geekai.dev/api/v1
    description: 海外代理入口
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /messages:
    post:
      summary: 创建消息
      description: 根据传入的对话生成下一条助手消息。支持单轮提示、无状态多轮历史及流式输出。
      operationId: createMessage
      parameters:
        - name: anthropic-version
          in: header
          required: false
          description: 请求使用的 Anthropic API 版本。
          schema:
            type: string
            example: '2026-10-21'
        - name: anthropic-beta
          in: header
          required: false
          description: 以逗号分隔的 Beta 功能标识。示例值并非封闭枚举。
          schema:
            type: array
            items:
              type: string
              examples:
                - computer-use-2024-10-22
                - computer-use-2025-01-24
                - output-128k-2025-02-19
                - mcp-client-2025-04-04
                - mcp-client-2025-11-20
                - dev-full-thinking-2025-05-14
                - interleaved-thinking-2025-05-14
                - code-execution-2025-05-22
                - context-1m-2025-08-07
                - context-management-2025-06-27
                - model-context-window-exceeded-2025-08-26
                - fast-mode-2026-02-01
                - output-300k-2026-03-24
                - user-profiles-2026-03-24
                - user-profiles-2026-08-18
                - user-profiles-2026-09-04
                - advisor-tool-2026-03-01
                - managed-agents-2026-04-01
                - dreaming-2026-04-21
                - thinking-token-count-2026-05-13
                - server-side-fallback-2026-06-01
                - server-side-fallback-2026-07-01
                - fallback-credit-2026-06-01
                - fallback-credit-2026-07-01
                - agent-memory-2026-07-22
                - mid-conversation-tool-changes-2026-07-01
                - compact-2026-01-12
                - computer-use-2025-11-24
                - mcp-tunnels-2026-06-22
                - structured-outputs-2025-11-13
                - task-budgets-2026-03-13
                - thinking-display-updates-2026-08-18
                - mid-conversation-output-config-2026-07-01
                - thinking-binding-controls-2026-08-01
                - mid-conversation-system-clear-at-2026-08-21
                - compact-2026-09-04
                - inline-tools-2026-09-15
                - mcp-client-2026-09-15
                - ce-plugins-2026-09-01
                - spend-limit-reads-2026-09-26
                - telemetry-destinations-2026-08-11
                - webhooks-2026-10-07
                - admin-user-sign-out-2026-10-08
                - message-threads-2026-08-12
                - analytics-usage-cost-2026-08-24
                - experimental-claude-tag-2026-10-21
                - ce-claude-code-managed-settings-2026-10-06
                - efs-2026-10-01
                - user-profiles-billing-2026-10-01
                - message-batches-2024-09-24
                - prompt-caching-2024-07-31
                - pdfs-2024-09-25
                - token-counting-2024-11-01
                - token-efficient-tools-2025-02-19
                - files-api-2025-04-14
                - extended-cache-ttl-2025-04-11
                - skills-2025-10-02
                - cache-diagnosis-2026-04-07
                - ce-user-management-2026-07-13
          style: simple
          explode: false
        - name: anthropic-user-profile-id
          in: header
          required: false
          description: 将请求归属到此用户配置。
          schema:
            type: string
        - name: anthropic-workspace-id
          in: header
          required: false
          description: 凭据可访问多个工作区时用于选择工作区。若凭据绑定特定工作区，传入值必须与之匹配。
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMessageRequest'
            example:
              model: claude-opus-5-5
              max_tokens: 1024
              messages:
                - role: user
                  content: Hello, Claude!
      responses:
        '200':
          description: >-
            非流式调用返回完整 JSON 消息；stream 为 true 时返回 SSE 帧序列。开始推流后的失败通过 error
            事件传递，不会更改 HTTP 状态。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaMessage'
              example:
                id: msg_013Zva2CMHLNnXjNJJKqJ2EF
                container:
                  id: container_011CpZohnwH4vuy7gazohgSP
                  expires_at: '2019-12-27T18:11:19.117Z'
                  skills:
                    - skill_id: pdf
                      type: anthropic
                      version: latest
                content:
                  - citations: null
                    text: Hi! My name is Claude.
                    type: text
                context_management:
                  applied_edits:
                    - cleared_input_tokens: 0
                      cleared_tool_uses: 0
                      type: clear_tool_uses_20250919
                diagnostics: null
                model: claude-opus-5-5
                role: assistant
                stop_details: null
                stop_reason: end_turn
                stop_sequence: null
                type: message
                usage:
                  cache_creation:
                    ephemeral_1h_input_tokens: 0
                    ephemeral_5m_input_tokens: 0
                  cache_creation_input_tokens: 2051
                  cache_read_input_tokens: 2051
                  fallback_credit:
                    status:
                      type: redeemed
                  inference_geo: global
                  input_tokens: 2095
                  iterations:
                    - cache_creation:
                        ephemeral_1h_input_tokens: 0
                        ephemeral_5m_input_tokens: 0
                      cache_creation_input_tokens: 0
                      cache_read_input_tokens: 0
                      input_tokens: 0
                      model: claude-fable-5-2
                      output_tokens: 0
                      type: message
                  output_tokens: 503
                  output_tokens_details:
                    thinking_tokens: 0
                  server_tool_use:
                    web_fetch_requests: 2
                    web_search_requests: 0
                  service_tier: standard
                  speed: standard
                input_transformations:
                  - path: path
                    reason: model_binding_mismatch
                    type: thinking_dropped
            text/event-stream:
              schema:
                type: string
                description: 每帧的 data 包含一个 JSON 事件，也可能出现 ping 或 error 事件。
              x-event-schema:
                anyOf:
                  - $ref: '#/components/schemas/BetaRawMessageStreamEvent'
                  - $ref: '#/components/schemas/ErrorResponse'
                  - type: object
                    properties:
                      type:
                        const: ping
                    required:
                      - type
              example: |+
                event: message_stop
                data: {"type":"message_stop"}

        '400':
          description: >-
            error.details.error_code 的可能值：available_tools_limit_exceeded,
            claude_code_key_creator_not_member, claude_code_version_too_old,
            cmek_key_disabled, cmek_key_network_blocked,
            compaction_block_ambiguous, compaction_block_misplaced,
            compaction_content_mismatch, compaction_incomplete_turn,
            compaction_nothing_to_summarize, compaction_signature_invalid,
            compaction_too_many_tool_references,
            compaction_tool_changes_mismatch, image_dimensions_too_large,
            organization_on_hold, request_body_encoding_invalid,
            request_body_encoding_unsupported, thread_already_continued,
            thread_continue_in_flight, thread_fingerprint_mismatch,
            thread_unsupported_request, tool_name_conflict,
            tool_reference_unresolved, user_profile_required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: >-
            error.details.error_code
            的可能值：linked_organization_billing_unavailable,
            linked_organization_spend_limit_reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: >-
            error.details.error_code 的可能值：user_profile_billing_not_authorized,
            user_profile_not_billable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: error.details.error_code 的可能值：thread_not_found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: error.details.error_code 的可能值：skill_read_blocked_undecryptable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: error.details.error_code 的可能值：request_body_too_large_after_decoding
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            error.details.error_code 的可能值：contract_spend_limit_reached,
            enforced_spend_limit_reached, ramp_limit_exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: error.details.error_code 的可能值：cmek_key_unreachable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '529':
          description: error.details.error_code 的可能值：compaction_unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          description: 开始推流前的其他 HTTP 错误。请查看 error.type 和 error.message。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      externalDocs:
        url: https://platform.claude.com/docs/en/api/http/beta/messages/create
components:
  schemas:
    CreateMessageRequest:
      type: object
      properties:
        max_tokens:
          type: integer
          minimum: 0
          description: 最多生成的 token 数。设为 0 可预热提示缓存而不生成文本；上限取决于模型。
        messages:
          type: array
          items:
            $ref: '#/components/schemas/BetaMessageParam'
          description: >-
            按顺序传入对话轮次。无状态请求需要包含历史消息；连续的 user 或 assistant 同角色消息会被合并。能否预填
            assistant 回复取决于模型。
          maxItems: 100000
        model:
          type: string
          examples:
            - claude-opus-5-5
          description: 生成回复所用的模型 ID。
        billing_policy:
          anyOf:
            - $ref: '#/components/schemas/BetaBillingPolicy'
            - type: 'null'
          description: 将费用计入本组织（self）或 anthropic-user-profile-id 指定的已授权客户（user_profile）。
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
          description: 在请求中最后一个可缓存的内容块上设置缓存断点。
        compaction:
          anyOf:
            - $ref: '#/components/schemas/BetaCompactionConfig'
            - type: 'null'
          description: 将对话压缩为可在后续轮次使用的 compaction 块。不可与 context_management 同时使用。
        container:
          anyOf:
            - anyOf:
                - $ref: '#/components/schemas/BetaContainerParams'
                - type: string
            - type: 'null'
          description: 复用容器 ID，或指定需要加载的技能。
        context_management:
          anyOf:
            - $ref: '#/components/schemas/BetaContextManagementConfig'
            - type: 'null'
          description: 配置上下文编辑策略，例如清除早期工具结果。
        diagnostics:
          anyOf:
            - $ref: '#/components/schemas/BetaDiagnosticsParam'
            - type: 'null'
          description: 配置本次请求的诊断信息。
        fallback_credit_token:
          anyOf:
            - anyOf:
                - type: string
                - $ref: '#/components/schemas/BetaFallbackCreditTokenParam'
            - type: 'null'
          description: >-
            上次拒绝响应返回的抵扣令牌，须在五分钟内由同一组织和工作区使用。对象形式需要
            fallback-credit-2026-07-01，不可与 fallbacks 同用。
        fallbacks:
          anyOf:
            - $ref: '#/components/schemas/BetaFallbacksParam'
            - type: 'null'
          description: 因策略拒绝时依次尝试的备用模型；传入 default 使用服务端策略。支持情况取决于模型。
        inference_geo:
          anyOf:
            - type: string
            - type: 'null'
          description: 请求使用的推理地域。
        mcp_servers:
          type: array
          items:
            $ref: '#/components/schemas/BetaRequestMCPServerURLDefinition'
          maxItems: 20
          description: 本次请求可用的远程 MCP 服务器。
        metadata:
          $ref: '#/components/schemas/BetaMetadata'
          description: 与请求关联的元数据。
        output_config:
          $ref: '#/components/schemas/BetaOutputConfig'
          description: 配置输出努力程度、结构化输出格式或任务预算。
        service_tier:
          type: string
          enum:
            - auto
            - standard_only
          description: 自动使用可用的优先容量（auto），或仅使用标准容量。
        speed:
          anyOf:
            - type: string
              enum:
                - standard
                - fast
            - type: 'null'
          description: 在模型支持时选择标准或快速推理。
        stop_sequences:
          type: array
          items:
            type: string
          description: 遇到指定序列时停止生成，匹配结果在 stop_sequence 中返回。
        stream:
          type: boolean
          description: 设为 true 时返回 SSE 事件流，而不是单条 JSON 消息。
        system:
          anyOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/BetaTextBlockParam'
          description: 以字符串或文本块数组传入的系统指令。
        thinking:
          $ref: '#/components/schemas/BetaThinkingConfigParam'
          description: >-
            选择模型支持的思考模式。adaptive 由 Claude 决定；enabled 需要至少 1,024 个预算 token，思考消耗计入
            max_tokens。
        thread:
          anyOf:
            - $ref: '#/components/schemas/BetaMessageThreadParam'
            - type: 'null'
          description: 创建服务端对话状态，或使用上一条回复 ID 继续线程，此时仅需提交新轮次。
        tool_choice:
          $ref: '#/components/schemas/BetaToolChoice'
          description: 允许自动选择、要求调用工具、指定一个工具或禁用工具。
        tools:
          type: array
          items:
            $ref: '#/components/schemas/BetaToolUnion'
          description: >-
            声明客户端或服务端工具。收到客户端 tool_use 后，使用其 input 调用指定工具，再返回引用该调用 ID 的
            tool_result。
        output_format:
          anyOf:
            - $ref: '#/components/schemas/BetaJSONOutputFormat'
            - type: 'null'
          description: 已弃用。请通过 output_config.format 指定 JSON 输出 schema。
          deprecated: true
        temperature:
          description: >-
            响应中注入的随机性温度


            默认值为 `1.0`。范围从 `0.0` 到 `1.0`。使用 `temperature` 更接近 `0.0` 进行分析 /
            多项选择，而更接近 `1.0` 进行创造性和生成性 任务。


            注意，即使 `temperature` 为 `0.0`，结果也不会完全确定。 旧版采样选项，所附 Beta
            文档未列出；支持情况取决于模型和 API 版本。
          examples:
            - 1
          maximum: 1
          minimum: 0
          title: 温度
          type: number
        top_k:
          description: >-
            仅从每个后续标记的前 K 个选项中进行采样。


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


            仅推荐用于高级用例。通常，您只需要使用 `temperature`。 旧版采样选项，所附 Beta 文档未列出；支持情况取决于模型和
            API 版本。
          examples:
            - 5
          minimum: 0
          title: Top K
          type: integer
        top_p:
          description: >-
            使用核采样。

            在核采样中，我们按照概率递减的顺序计算每个后续 token 的所有选项的累积分布，并在达到 `top_p`
            指定的特定概率时将其截断。您应该只更改 `temperature` 或 `top_p` 中的一个，而不是同时更改两者。

            仅推荐用于高级用例。通常，您只需要使用 `temperature`。 旧版采样选项，所附 Beta 文档未列出；支持情况取决于模型和
            API 版本。
          examples:
            - 0.7
          maximum: 1
          minimum: 0
          title: Top P
          type: number
      required:
        - max_tokens
        - messages
        - model
      allOf:
        - not:
            required:
              - compaction
              - context_management
            properties:
              compaction:
                not:
                  type: 'null'
              context_management:
                not:
                  type: 'null'
        - not:
            required:
              - fallbacks
              - fallback_credit_token
            properties:
              fallbacks:
                not:
                  type: 'null'
              fallback_credit_token:
                not:
                  type: 'null'
    BetaMessage:
      type: object
      properties:
        type:
          const: message
          default: message
          description: 固定为 message。
        id:
          type: string
          description: 消息唯一标识。
        container:
          anyOf:
            - $ref: '#/components/schemas/BetaContainer'
            - type: 'null'
          description: 本次请求使用的容器信息（如有）。
        content:
          type: array
          items:
            $ref: '#/components/schemas/BetaContentBlock'
          description: 有序的输出内容块，如文本、工具调用或思考内容。
        context_management:
          anyOf:
            - $ref: '#/components/schemas/BetaContextManagementResponse'
            - type: 'null'
          description: 处理请求时已执行的上下文编辑。
        diagnostics:
          anyOf:
            - $ref: '#/components/schemas/BetaDiagnostics'
            - type: 'null'
          description: 与本次请求关联的诊断结果（如有）。
        model:
          type: string
          examples:
            - claude-opus-5-5
          description: 实际生成回复的模型。
        role:
          const: assistant
          default: assistant
          description: 生成的消息角色为 assistant。
        stop_details:
          anyOf:
            - $ref: '#/components/schemas/BetaRefusalStopDetails'
            - type: 'null'
          description: 有关停止原因的补充信息（如有）。
        stop_reason:
          anyOf:
            - $ref: '#/components/schemas/BetaStopReason'
            - type: 'null'
          description: 生成停止的原因；结束前可能为 null。
        stop_sequence:
          anyOf:
            - type: string
            - type: 'null'
          description: 触发停止的自定义序列；未触发时为 null。
        usage:
          $ref: '#/components/schemas/BetaUsage'
          description: >-
            用量及计费数据。输入 token 总量包括 input_tokens、cache_creation_input_tokens 和
            cache_read_input_tokens。
        input_transformations:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/BetaInputTransformation'
            - type: 'null'
          description: 服务端对输入块执行的变换。
      required:
        - type
        - id
        - container
        - content
        - context_management
        - diagnostics
        - model
        - role
        - stop_details
        - stop_reason
        - stop_sequence
        - usage
    ErrorResponse:
      type: object
      required:
        - type
        - error
      properties:
        type:
          const: error
        error:
          type: object
          required:
            - type
            - message
          properties:
            type:
              type: string
            message:
              type: string
            details:
              type: object
              properties:
                error_code:
                  type: string
        request_id:
          type: string
    BetaMessageParam:
      anyOf:
        - $ref: '#/components/schemas/BetaUserMessageParam'
        - $ref: '#/components/schemas/BetaAssistantMessageParam'
        - $ref: '#/components/schemas/BetaSystemMessageParam'
    BetaBillingPolicy:
      type: object
      properties:
        type:
          const: billing_policy
        bill_to:
          $ref: '#/components/schemas/BetaBillTo'
      required:
        - type
    BetaCacheControlEphemeral:
      type: object
      properties:
        type:
          const: ephemeral
        ttl:
          type: string
          enum:
            - 5m
            - 1h
      required:
        - type
    BetaCompactionConfig:
      type: object
      properties:
        type:
          const: summarize
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          maxLength: 16384
      required:
        - type
    BetaContainerParams:
      type: object
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
        skills:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/BetaSkillParams'
            - type: 'null'
          maxItems: 20
    BetaContextManagementConfig:
      type: object
      properties:
        edits:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/BetaClearToolUses20250919Edit'
              - $ref: '#/components/schemas/BetaClearThinking20251015Edit'
              - $ref: '#/components/schemas/BetaCompact20260112Edit'
    BetaDiagnosticsParam:
      type: object
      properties:
        previous_message_id:
          anyOf:
            - type: string
            - type: 'null'
          maxLength: 256
    BetaFallbackCreditTokenParam:
      type: object
      properties:
        token:
          type: string
          minLength: 1
          maxLength: 2048
        mode:
          type: string
          enum:
            - strict
            - best_effort
      required:
        - token
    BetaFallbacksParam:
      anyOf:
        - type: array
          items:
            $ref: '#/components/schemas/BetaFallbackParam'
        - const: default
    BetaRequestMCPServerURLDefinition:
      type: object
      properties:
        type:
          const: url
        name:
          type: string
        url:
          type: string
        authorization_token:
          anyOf:
            - type: string
            - type: 'null'
        tool_configuration:
          anyOf:
            - $ref: '#/components/schemas/BetaRequestMCPServerToolConfiguration'
            - type: 'null'
      required:
        - type
        - name
        - url
    BetaMetadata:
      type: object
      properties:
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          maxLength: 512
    BetaOutputConfig:
      type: object
      properties:
        effort:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
                - xhigh
                - max
            - type: 'null'
        format:
          anyOf:
            - $ref: '#/components/schemas/BetaJSONOutputFormat'
            - type: 'null'
        task_budget:
          anyOf:
            - $ref: '#/components/schemas/BetaTokenTaskBudget'
            - type: 'null'
    BetaTextBlockParam:
      type: object
      properties:
        type:
          const: text
        text:
          type: string
          minLength: 1
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        citations:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/BetaTextCitationParam'
            - type: 'null'
      required:
        - type
        - text
    BetaThinkingConfigParam:
      anyOf:
        - $ref: '#/components/schemas/BetaThinkingConfigEnabled'
        - $ref: '#/components/schemas/BetaThinkingConfigDisabled'
        - $ref: '#/components/schemas/BetaThinkingConfigBetweenTools'
        - $ref: '#/components/schemas/BetaThinkingConfigAdaptive'
    BetaMessageThreadParam:
      anyOf:
        - $ref: '#/components/schemas/BetaThreadCreateParams'
        - $ref: '#/components/schemas/BetaThreadContinueParams'
    BetaToolChoice:
      anyOf:
        - $ref: '#/components/schemas/BetaToolChoiceAuto'
        - $ref: '#/components/schemas/BetaToolChoiceAny'
        - $ref: '#/components/schemas/BetaToolChoiceTool'
        - $ref: '#/components/schemas/BetaToolChoiceNone'
    BetaToolUnion:
      anyOf:
        - $ref: '#/components/schemas/BetaTool'
        - $ref: '#/components/schemas/BetaToolBash20241022'
        - $ref: '#/components/schemas/BetaToolBash20250124'
        - $ref: '#/components/schemas/BetaCodeExecutionTool20250522'
        - $ref: '#/components/schemas/BetaCodeExecutionTool20250825'
        - $ref: '#/components/schemas/BetaCodeExecutionTool20260120'
        - $ref: '#/components/schemas/BetaCodeExecutionTool20260521'
        - $ref: '#/components/schemas/BetaBrowserToolset20260801'
        - $ref: '#/components/schemas/BetaToolComputerUse20241022'
        - $ref: '#/components/schemas/BetaMemoryTool20250818'
        - $ref: '#/components/schemas/BetaToolComputerUse20250124'
        - $ref: '#/components/schemas/BetaToolTextEditor20241022'
        - $ref: '#/components/schemas/BetaToolComputerUse20251124'
        - $ref: '#/components/schemas/BetaComputerToolset20260801'
        - $ref: '#/components/schemas/BetaToolTextEditor20250124'
        - $ref: '#/components/schemas/BetaToolTextEditor20250429'
        - $ref: '#/components/schemas/BetaToolTextEditor20250728'
        - $ref: '#/components/schemas/BetaWebSearchTool20250305'
        - $ref: '#/components/schemas/BetaWebFetchTool20250910'
        - $ref: '#/components/schemas/BetaWebSearchTool20260209'
        - $ref: '#/components/schemas/BetaWebFetchTool20260209'
        - $ref: '#/components/schemas/BetaWebFetchTool20260309'
        - $ref: '#/components/schemas/BetaWebSearchTool20260318'
        - $ref: '#/components/schemas/BetaWebFetchTool20260318'
        - $ref: '#/components/schemas/BetaAdvisorTool20260301'
        - $ref: '#/components/schemas/BetaToolSearchToolBm25_20251119'
        - $ref: '#/components/schemas/BetaToolSearchToolRegex20251119'
        - $ref: '#/components/schemas/BetaMCPToolset'
    BetaJSONOutputFormat:
      type: object
      properties:
        type:
          const: json_schema
        schema:
          type: object
          additionalProperties: {}
      required:
        - type
        - schema
    BetaContainer:
      type: object
      properties:
        id:
          type: string
        expires_at:
          type: string
        skills:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/BetaContainerSkill'
            - type: 'null'
      required:
        - id
        - expires_at
        - skills
    BetaContentBlock:
      anyOf:
        - $ref: '#/components/schemas/BetaTextBlock'
        - $ref: '#/components/schemas/BetaThinkingBlock'
        - $ref: '#/components/schemas/BetaRedactedThinkingBlock'
        - $ref: '#/components/schemas/BetaToolUseBlock'
        - $ref: '#/components/schemas/BetaServerToolUseBlock'
        - $ref: '#/components/schemas/BetaWebSearchToolResultBlock'
        - $ref: '#/components/schemas/BetaWebFetchToolResultBlock'
        - $ref: '#/components/schemas/BetaAdvisorToolResultBlock'
        - $ref: '#/components/schemas/BetaCodeExecutionToolResultBlock'
        - $ref: '#/components/schemas/BetaBashCodeExecutionToolResultBlock'
        - $ref: '#/components/schemas/BetaTextEditorCodeExecutionToolResultBlock'
        - $ref: '#/components/schemas/BetaToolSearchToolResultBlock'
        - $ref: '#/components/schemas/BetaMCPToolUseBlock'
        - $ref: '#/components/schemas/BetaMCPToolResultBlock'
        - $ref: '#/components/schemas/BetaContainerUploadBlock'
        - $ref: '#/components/schemas/BetaCompactionBlock'
        - $ref: '#/components/schemas/BetaFallbackBlock'
        - $ref: '#/components/schemas/BetaMCPToolListingBlock'
    BetaContextManagementResponse:
      type: object
      properties:
        applied_edits:
          type: array
          items:
            anyOf:
              - $ref: '#/components/schemas/BetaClearToolUses20250919EditResponse'
              - $ref: '#/components/schemas/BetaClearThinking20251015EditResponse'
      required:
        - applied_edits
    BetaDiagnostics:
      type: object
      properties:
        cache_miss_reason:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheMissReason'
            - type: 'null'
      required:
        - cache_miss_reason
    BetaRefusalStopDetails:
      type: object
      properties:
        type:
          const: refusal
          default: refusal
        category:
          anyOf:
            - type: string
              enum:
                - cyber
                - bio
                - frontier_llm
                - reasoning_extraction
                - general_harms
            - type: 'null'
        explanation:
          anyOf:
            - type: string
            - type: 'null'
        fallback_credit_token:
          anyOf:
            - type: string
            - type: 'null'
        fallback_has_prefill_claim:
          anyOf:
            - type: boolean
            - type: 'null'
        recommended_model:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - category
        - explanation
        - fallback_credit_token
        - fallback_has_prefill_claim
        - recommended_model
    BetaStopReason:
      type: string
      enum:
        - end_turn
        - max_tokens
        - stop_sequence
        - tool_use
        - pause_turn
        - compaction
        - refusal
        - model_context_window_exceeded
    BetaUsage:
      type: object
      properties:
        cache_creation:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheCreation'
            - type: 'null'
        cache_creation_input_tokens:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 0
        cache_read_input_tokens:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 0
        fallback_credit:
          anyOf:
            - $ref: '#/components/schemas/BetaFallbackCreditUsage'
            - type: 'null'
        inference_geo:
          anyOf:
            - type: string
            - type: 'null'
        input_tokens:
          type: number
          minimum: 0
        iterations:
          anyOf:
            - $ref: '#/components/schemas/BetaIterationsUsage'
            - type: 'null'
        output_tokens:
          type: number
          minimum: 0
        output_tokens_details:
          anyOf:
            - $ref: '#/components/schemas/BetaOutputTokensDetails'
            - type: 'null'
        server_tool_use:
          anyOf:
            - $ref: '#/components/schemas/BetaServerToolUsage'
            - type: 'null'
        service_tier:
          anyOf:
            - type: string
              enum:
                - standard
                - priority
                - batch
            - type: 'null'
        speed:
          anyOf:
            - type: string
              enum:
                - standard
                - fast
            - type: 'null'
      required:
        - cache_creation
        - cache_creation_input_tokens
        - cache_read_input_tokens
        - fallback_credit
        - inference_geo
        - input_tokens
        - iterations
        - output_tokens
        - output_tokens_details
        - server_tool_use
        - service_tier
        - speed
    BetaInputTransformation:
      anyOf:
        - $ref: '#/components/schemas/BetaThinkingDroppedInputTransformation'
        - $ref: '#/components/schemas/BetaThinkingMismatchAllowedInputTransformation'
    BetaUserMessageParam:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/BetaMessageContentParam'
        role:
          const: user
      required:
        - content
        - role
    BetaAssistantMessageParam:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/BetaMessageContentParam'
        role:
          const: assistant
      required:
        - content
        - role
    BetaSystemMessageParam:
      type: object
      properties:
        role:
          const: system
        clear_at:
          anyOf:
            - type: string
              enum:
                - next_user_message
                - never
            - type: 'null'
        content:
          anyOf:
            - type: string
            - type: array
              items:
                anyOf:
                  - $ref: '#/components/schemas/BetaTextBlockParam'
                  - $ref: '#/components/schemas/BetaRequestToolAdditionBlock'
                  - $ref: '#/components/schemas/BetaRequestToolRemovalBlock'
        output_config:
          anyOf:
            - $ref: '#/components/schemas/BetaSystemMessageOutputConfig'
            - type: 'null'
      required:
        - role
    BetaBillTo:
      type: string
      enum:
        - self
        - user_profile
    BetaSkillParams:
      type: object
      properties:
        type:
          type: string
          enum:
            - anthropic
            - custom
        skill_id:
          type: string
          minLength: 1
          maxLength: 64
        version:
          type: string
          minLength: 1
          maxLength: 64
      required:
        - type
        - skill_id
    BetaClearToolUses20250919Edit:
      type: object
      properties:
        type:
          const: clear_tool_uses_20250919
        clear_at_least:
          anyOf:
            - $ref: '#/components/schemas/BetaInputTokensClearAtLeast'
            - type: 'null'
        clear_tool_inputs:
          anyOf:
            - anyOf:
                - type: boolean
                - type: array
                  items:
                    type: string
            - type: 'null'
        exclude_tools:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        keep:
          $ref: '#/components/schemas/BetaToolUsesKeep'
        trigger:
          anyOf:
            - $ref: '#/components/schemas/BetaInputTokensTrigger'
            - $ref: '#/components/schemas/BetaToolUsesTrigger'
      required:
        - type
    BetaClearThinking20251015Edit:
      type: object
      properties:
        type:
          const: clear_thinking_20251015
        keep:
          anyOf:
            - $ref: '#/components/schemas/BetaThinkingTurns'
            - $ref: '#/components/schemas/BetaAllThinkingTurns'
            - const: all
      required:
        - type
    BetaCompact20260112Edit:
      type: object
      properties:
        type:
          const: compact_20260112
        instructions:
          anyOf:
            - type: string
            - type: 'null'
        pause_after_compaction:
          type: boolean
        trigger:
          anyOf:
            - $ref: '#/components/schemas/BetaInputTokensTrigger'
            - type: 'null'
      required:
        - type
    BetaFallbackParam:
      type: object
      properties:
        model:
          type: string
          examples:
            - claude-opus-5-5
        max_tokens:
          anyOf:
            - type: number
            - type: 'null'
        output_config:
          anyOf:
            - $ref: '#/components/schemas/BetaOutputConfig'
            - type: 'null'
        speed:
          anyOf:
            - type: string
              enum:
                - standard
                - fast
            - type: 'null'
        thinking:
          anyOf:
            - anyOf:
                - $ref: '#/components/schemas/BetaThinkingConfigEnabled'
                - $ref: '#/components/schemas/BetaThinkingConfigDisabled'
                - $ref: '#/components/schemas/BetaThinkingConfigBetweenTools'
                - $ref: '#/components/schemas/BetaThinkingConfigAdaptive'
            - type: 'null'
      required:
        - model
    BetaRequestMCPServerToolConfiguration:
      type: object
      properties:
        allowed_tools:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaTokenTaskBudget:
      type: object
      properties:
        type:
          const: tokens
        total:
          type: number
          minimum: 1024
        remaining:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 0
      required:
        - type
        - total
    BetaTextCitationParam:
      anyOf:
        - $ref: '#/components/schemas/BetaCitationCharLocationParam'
        - $ref: '#/components/schemas/BetaCitationPageLocationParam'
        - $ref: '#/components/schemas/BetaCitationContentBlockLocationParam'
        - $ref: '#/components/schemas/BetaCitationWebSearchResultLocationParam'
        - $ref: '#/components/schemas/BetaCitationSearchResultLocationParam'
    BetaThinkingConfigEnabled:
      type: object
      properties:
        type:
          const: enabled
        budget_tokens:
          type: number
          minimum: 1024
        block_binding:
          anyOf:
            - $ref: '#/components/schemas/BetaThinkingBlockBinding'
            - type: 'null'
        display:
          anyOf:
            - type: string
              enum:
                - summarized
                - omitted
                - updates
            - type: 'null'
      required:
        - type
        - budget_tokens
    BetaThinkingConfigDisabled:
      type: object
      properties:
        type:
          const: disabled
      required:
        - type
    BetaThinkingConfigBetweenTools:
      type: object
      properties:
        type:
          const: between_tools
      required:
        - type
    BetaThinkingConfigAdaptive:
      type: object
      properties:
        type:
          const: adaptive
        block_binding:
          anyOf:
            - $ref: '#/components/schemas/BetaThinkingBlockBinding'
            - type: 'null'
        display:
          anyOf:
            - type: string
              enum:
                - summarized
                - omitted
                - updates
            - type: 'null'
      required:
        - type
    BetaThreadCreateParams:
      type: object
      properties:
        type:
          const: create
      required:
        - type
    BetaThreadContinueParams:
      type: object
      properties:
        type:
          const: continue
        previous_message_id:
          type: string
      required:
        - type
        - previous_message_id
    BetaToolChoiceAuto:
      type: object
      properties:
        type:
          const: auto
        disable_parallel_tool_use:
          type: boolean
      required:
        - type
    BetaToolChoiceAny:
      type: object
      properties:
        type:
          const: any
        disable_parallel_tool_use:
          type: boolean
      required:
        - type
    BetaToolChoiceTool:
      type: object
      properties:
        type:
          const: tool
        name:
          type: string
        disable_parallel_tool_use:
          type: boolean
      required:
        - type
        - name
    BetaToolChoiceNone:
      type: object
      properties:
        type:
          const: none
      required:
        - type
    BetaTool:
      type: object
      properties:
        type:
          anyOf:
            - const: custom
            - type: 'null'
        input_schema:
          type: object
          properties:
            type:
              const: object
            properties:
              anyOf:
                - type: object
                  additionalProperties: {}
                - type: 'null'
            required:
              anyOf:
                - type: array
                  items:
                    type: string
                - type: 'null'
          required:
            - type
        name:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[a-zA-Z0-9_-]{1,128}$
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        description:
          type: string
        eager_input_streaming:
          anyOf:
            - type: boolean
            - type: 'null'
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: {}
        strict:
          type: boolean
      required:
        - input_schema
        - name
    BetaToolBash20241022:
      type: object
      properties:
        type:
          const: bash_20241022
        name:
          const: bash
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: {}
        strict:
          type: boolean
      required:
        - type
        - name
    BetaToolBash20250124:
      type: object
      properties:
        type:
          const: bash_20250124
        name:
          const: bash
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: {}
        strict:
          type: boolean
      required:
        - type
        - name
    BetaCodeExecutionTool20250522:
      type: object
      properties:
        type:
          const: code_execution_20250522
        name:
          const: code_execution
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        strict:
          type: boolean
      required:
        - type
        - name
    BetaCodeExecutionTool20250825:
      type: object
      properties:
        type:
          const: code_execution_20250825
        name:
          const: code_execution
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        strict:
          type: boolean
      required:
        - type
        - name
    BetaCodeExecutionTool20260120:
      type: object
      properties:
        type:
          const: code_execution_20260120
        name:
          const: code_execution
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        strict:
          type: boolean
      required:
        - type
        - name
    BetaCodeExecutionTool20260521:
      type: object
      properties:
        type:
          const: code_execution_20260521
        name:
          const: code_execution
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        strict:
          type: boolean
      required:
        - type
        - name
    BetaBrowserToolset20260801:
      type: object
      properties:
        type:
          const: browser_toolset_20260801
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        configs:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserToolsetConfigs'
            - type: 'null'
      required:
        - type
    BetaToolComputerUse20241022:
      type: object
      properties:
        type:
          const: computer_20241022
        display_height_px:
          type: number
          minimum: 1
        display_width_px:
          type: number
          minimum: 1
        name:
          const: computer
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        display_number:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 0
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: {}
        strict:
          type: boolean
      required:
        - type
        - display_height_px
        - display_width_px
        - name
    BetaMemoryTool20250818:
      type: object
      properties:
        type:
          const: memory_20250818
        name:
          const: memory
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: {}
        strict:
          type: boolean
      required:
        - type
        - name
    BetaToolComputerUse20250124:
      type: object
      properties:
        type:
          const: computer_20250124
        display_height_px:
          type: number
          minimum: 1
        display_width_px:
          type: number
          minimum: 1
        name:
          const: computer
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        display_number:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 0
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: {}
        strict:
          type: boolean
      required:
        - type
        - display_height_px
        - display_width_px
        - name
    BetaToolTextEditor20241022:
      type: object
      properties:
        type:
          const: text_editor_20241022
        name:
          const: str_replace_editor
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: {}
        strict:
          type: boolean
      required:
        - type
        - name
    BetaToolComputerUse20251124:
      type: object
      properties:
        type:
          const: computer_20251124
        display_height_px:
          type: number
          minimum: 1
        display_width_px:
          type: number
          minimum: 1
        name:
          const: computer
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        display_number:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 0
        enable_zoom:
          type: boolean
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: {}
        strict:
          type: boolean
      required:
        - type
        - display_height_px
        - display_width_px
        - name
    BetaComputerToolset20260801:
      type: object
      properties:
        type:
          const: computer_toolset_20260801
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        configs:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerToolsetConfigs'
            - type: 'null'
      required:
        - type
    BetaToolTextEditor20250124:
      type: object
      properties:
        type:
          const: text_editor_20250124
        name:
          const: str_replace_editor
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: {}
        strict:
          type: boolean
      required:
        - type
        - name
    BetaToolTextEditor20250429:
      type: object
      properties:
        type:
          const: text_editor_20250429
        name:
          const: str_replace_based_edit_tool
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: {}
        strict:
          type: boolean
      required:
        - type
        - name
    BetaToolTextEditor20250728:
      type: object
      properties:
        type:
          const: text_editor_20250728
        name:
          const: str_replace_based_edit_tool
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: {}
        max_characters:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        strict:
          type: boolean
      required:
        - type
        - name
    BetaWebSearchTool20250305:
      type: object
      properties:
        type:
          const: web_search_20250305
        name:
          const: web_search
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        strict:
          type: boolean
        user_location:
          anyOf:
            - $ref: '#/components/schemas/BetaUserLocation'
            - type: 'null'
      required:
        - type
        - name
    BetaWebFetchTool20250910:
      type: object
      properties:
        type:
          const: web_fetch_20250910
        name:
          const: web_fetch
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        citations:
          anyOf:
            - $ref: '#/components/schemas/BetaCitationsConfigParam'
            - type: 'null'
        defer_loading:
          type: boolean
        max_content_tokens:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        strict:
          type: boolean
        url_sources:
          anyOf:
            - $ref: '#/components/schemas/BetaWebFetchURLSources'
            - type: 'null'
      required:
        - type
        - name
    BetaWebSearchTool20260209:
      type: object
      properties:
        type:
          const: web_search_20260209
        name:
          const: web_search
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        strict:
          type: boolean
        user_location:
          anyOf:
            - $ref: '#/components/schemas/BetaUserLocation'
            - type: 'null'
      required:
        - type
        - name
    BetaWebFetchTool20260209:
      type: object
      properties:
        type:
          const: web_fetch_20260209
        name:
          const: web_fetch
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        citations:
          anyOf:
            - $ref: '#/components/schemas/BetaCitationsConfigParam'
            - type: 'null'
        defer_loading:
          type: boolean
        max_content_tokens:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        strict:
          type: boolean
        url_sources:
          anyOf:
            - $ref: '#/components/schemas/BetaWebFetchURLSources'
            - type: 'null'
      required:
        - type
        - name
    BetaWebFetchTool20260309:
      type: object
      properties:
        type:
          const: web_fetch_20260309
        name:
          const: web_fetch
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        citations:
          anyOf:
            - $ref: '#/components/schemas/BetaCitationsConfigParam'
            - type: 'null'
        defer_loading:
          type: boolean
        max_content_tokens:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        strict:
          type: boolean
        url_sources:
          anyOf:
            - $ref: '#/components/schemas/BetaWebFetchURLSources'
            - type: 'null'
        use_cache:
          type: boolean
      required:
        - type
        - name
    BetaWebSearchTool20260318:
      type: object
      properties:
        type:
          const: web_search_20260318
        name:
          const: web_search
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        response_inclusion:
          type: string
          enum:
            - full
            - excluded
        strict:
          type: boolean
        user_location:
          anyOf:
            - $ref: '#/components/schemas/BetaUserLocation'
            - type: 'null'
      required:
        - type
        - name
    BetaWebFetchTool20260318:
      type: object
      properties:
        type:
          const: web_fetch_20260318
        name:
          const: web_fetch
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        allowed_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        blocked_domains:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        citations:
          anyOf:
            - $ref: '#/components/schemas/BetaCitationsConfigParam'
            - type: 'null'
        defer_loading:
          type: boolean
        max_content_tokens:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        response_inclusion:
          type: string
          enum:
            - full
            - excluded
        strict:
          type: boolean
        url_sources:
          anyOf:
            - $ref: '#/components/schemas/BetaWebFetchURLSources'
            - type: 'null'
        use_cache:
          type: boolean
      required:
        - type
        - name
    BetaAdvisorTool20260301:
      type: object
      properties:
        type:
          const: advisor_20260301
        model:
          type: string
          examples:
            - claude-opus-5-5
        name:
          const: advisor
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        caching:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        max_tokens:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1024
        max_uses:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 1
        strict:
          type: boolean
      required:
        - type
        - model
        - name
    BetaToolSearchToolBm25_20251119:
      type: object
      properties:
        type:
          type: string
          enum:
            - tool_search_tool_bm25_20251119
            - tool_search_tool_bm25
        name:
          const: tool_search_tool_bm25
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        strict:
          type: boolean
      required:
        - type
        - name
    BetaToolSearchToolRegex20251119:
      type: object
      properties:
        type:
          type: string
          enum:
            - tool_search_tool_regex_20251119
            - tool_search_tool_regex
        name:
          const: tool_search_tool_regex
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        defer_loading:
          type: boolean
        strict:
          type: boolean
      required:
        - type
        - name
    BetaMCPToolset:
      type: object
      properties:
        type:
          const: mcp_toolset
        mcp_server_name:
          type: string
          minLength: 1
          maxLength: 255
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        configs:
          anyOf:
            - type: object
              properties:
                defer_loading:
                  type: boolean
                enabled:
                  type: boolean
            - type: 'null'
        default_config:
          $ref: '#/components/schemas/BetaMCPToolDefaultConfig'
        tools:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/BetaMCPToolParam'
            - type: 'null'
      required:
        - type
        - mcp_server_name
    BetaContainerSkill:
      type: object
      properties:
        type:
          type: string
          enum:
            - anthropic
            - custom
        skill_id:
          type: string
          minLength: 1
          maxLength: 64
        version:
          type: string
          minLength: 1
          maxLength: 64
      required:
        - type
        - skill_id
        - version
    BetaTextBlock:
      type: object
      properties:
        type:
          const: text
          default: text
        citations:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/BetaTextCitation'
            - type: 'null'
        text:
          type: string
      required:
        - type
        - citations
        - text
    BetaThinkingBlock:
      type: object
      properties:
        type:
          const: thinking
          default: thinking
        signature:
          type: string
        thinking:
          type: string
      required:
        - type
        - signature
        - thinking
    BetaRedactedThinkingBlock:
      type: object
      properties:
        type:
          const: redacted_thinking
          default: redacted_thinking
        data:
          type: string
      required:
        - type
        - data
    BetaToolUseBlock:
      type: object
      properties:
        type:
          const: tool_use
          default: tool_use
        id:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        input:
          type: object
          additionalProperties: {}
        name:
          type: string
          minLength: 1
        caller:
          anyOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller20260120'
        toolset_name:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 64
          pattern: ^[a-zA-Z0-9_-]+$
      required:
        - type
        - id
        - input
        - name
    BetaServerToolUseBlock:
      type: object
      properties:
        type:
          const: server_tool_use
          default: server_tool_use
        id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        input:
          type: object
          additionalProperties: {}
        name:
          type: string
          enum:
            - advisor
            - web_search
            - web_fetch
            - code_execution
            - bash_code_execution
            - text_editor_code_execution
            - tool_search_tool_regex
            - tool_search_tool_bm25
        caller:
          anyOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller20260120'
      required:
        - type
        - id
        - input
        - name
    BetaWebSearchToolResultBlock:
      type: object
      properties:
        type:
          const: web_search_tool_result
          default: web_search_tool_result
        content:
          $ref: '#/components/schemas/BetaWebSearchToolResultBlockContent'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        caller:
          anyOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller20260120'
      required:
        - type
        - content
        - tool_use_id
    BetaWebFetchToolResultBlock:
      type: object
      properties:
        type:
          const: web_fetch_tool_result
          default: web_fetch_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaWebFetchToolResultErrorBlock'
            - $ref: '#/components/schemas/BetaWebFetchBlock'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        caller:
          anyOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller20260120'
      required:
        - type
        - content
        - tool_use_id
    BetaAdvisorToolResultBlock:
      type: object
      properties:
        type:
          const: advisor_tool_result
          default: advisor_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaAdvisorToolResultErrorObject'
            - $ref: '#/components/schemas/BetaAdvisorResultBlock'
            - $ref: '#/components/schemas/BetaAdvisorRedactedResultBlock'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - content
        - tool_use_id
    BetaCodeExecutionToolResultBlock:
      type: object
      properties:
        type:
          const: code_execution_tool_result
          default: code_execution_tool_result
        content:
          $ref: '#/components/schemas/BetaCodeExecutionToolResultBlockContent'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - content
        - tool_use_id
    BetaBashCodeExecutionToolResultBlock:
      type: object
      properties:
        type:
          const: bash_code_execution_tool_result
          default: bash_code_execution_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaBashCodeExecutionToolResultErrorObject'
            - $ref: '#/components/schemas/BetaBashCodeExecutionResultBlock'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - content
        - tool_use_id
    BetaTextEditorCodeExecutionToolResultBlock:
      type: object
      properties:
        type:
          const: text_editor_code_execution_tool_result
          default: text_editor_code_execution_tool_result
        content:
          anyOf:
            - $ref: >-
                #/components/schemas/BetaTextEditorCodeExecutionToolResultErrorObject
            - $ref: '#/components/schemas/BetaTextEditorCodeExecutionViewResultBlock'
            - $ref: >-
                #/components/schemas/BetaTextEditorCodeExecutionCreateResultBlock
            - $ref: >-
                #/components/schemas/BetaTextEditorCodeExecutionStrReplaceResultBlock
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - content
        - tool_use_id
    BetaToolSearchToolResultBlock:
      type: object
      properties:
        type:
          const: tool_search_tool_result
          default: tool_search_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaToolSearchToolResultErrorObject'
            - $ref: '#/components/schemas/BetaToolSearchToolSearchResultBlock'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - content
        - tool_use_id
    BetaMCPToolUseBlock:
      type: object
      properties:
        type:
          const: mcp_tool_use
          default: mcp_tool_use
        id:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        input:
          type: object
          additionalProperties: {}
        name:
          type: string
        server_name:
          type: string
      required:
        - type
        - id
        - input
        - name
        - server_name
    BetaMCPToolResultBlock:
      type: object
      properties:
        type:
          const: mcp_tool_result
          default: mcp_tool_result
        content:
          anyOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/BetaTextBlock'
        is_error:
          type: boolean
          default: false
        tool_use_id:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
      required:
        - type
        - content
        - is_error
        - tool_use_id
    BetaContainerUploadBlock:
      type: object
      properties:
        type:
          const: container_upload
          default: container_upload
        file_id:
          type: string
      required:
        - type
        - file_id
    BetaCompactionBlock:
      type: object
      properties:
        type:
          const: compaction
          default: compaction
        content:
          anyOf:
            - type: string
            - type: 'null'
        encrypted_content:
          anyOf:
            - type: string
            - type: 'null'
        signature:
          anyOf:
            - type: string
            - type: 'null'
        tool_changes:
          anyOf:
            - type: array
              items:
                anyOf:
                  - $ref: '#/components/schemas/BetaResponseToolAdditionBlock'
                  - $ref: '#/components/schemas/BetaResponseToolRemovalBlock'
            - type: 'null'
      required:
        - type
        - content
        - encrypted_content
    BetaFallbackBlock:
      type: object
      properties:
        type:
          const: fallback
          default: fallback
        from:
          $ref: '#/components/schemas/BetaFallbackInfo'
        to:
          $ref: '#/components/schemas/BetaFallbackInfo'
        trigger:
          $ref: '#/components/schemas/BetaFallbackRefusalTrigger'
      required:
        - type
        - from
        - to
        - trigger
    BetaMCPToolListingBlock:
      type: object
      properties:
        type:
          const: mcp_tool_listing
          default: mcp_tool_listing
        mcp_server_name:
          type: string
        tools:
          type: array
          items:
            $ref: '#/components/schemas/BetaMCPTool'
      required:
        - type
        - mcp_server_name
        - tools
    BetaClearToolUses20250919EditResponse:
      type: object
      properties:
        type:
          const: clear_tool_uses_20250919
          default: clear_tool_uses_20250919
        cleared_input_tokens:
          type: number
          minimum: 0
        cleared_tool_uses:
          type: number
          minimum: 0
      required:
        - type
        - cleared_input_tokens
        - cleared_tool_uses
    BetaClearThinking20251015EditResponse:
      type: object
      properties:
        type:
          const: clear_thinking_20251015
          default: clear_thinking_20251015
        cleared_input_tokens:
          type: number
          minimum: 0
        cleared_thinking_turns:
          type: number
          minimum: 0
      required:
        - type
        - cleared_input_tokens
        - cleared_thinking_turns
    BetaCacheMissReason:
      anyOf:
        - $ref: '#/components/schemas/BetaCacheMissModelChanged'
        - $ref: '#/components/schemas/BetaCacheMissSystemChanged'
        - $ref: '#/components/schemas/BetaCacheMissToolsChanged'
        - $ref: '#/components/schemas/BetaCacheMissMessagesChanged'
        - $ref: '#/components/schemas/BetaCacheMissPreviousMessageNotFound'
        - $ref: '#/components/schemas/BetaCacheMissUnavailable'
    BetaCacheCreation:
      type: object
      properties:
        ephemeral_1h_input_tokens:
          type: number
          minimum: 0
          default: 0
        ephemeral_5m_input_tokens:
          type: number
          minimum: 0
          default: 0
      required:
        - ephemeral_1h_input_tokens
        - ephemeral_5m_input_tokens
    BetaFallbackCreditUsage:
      type: object
      properties:
        status:
          anyOf:
            - $ref: '#/components/schemas/BetaFallbackCreditRedeemed'
            - $ref: '#/components/schemas/BetaFallbackCreditNotApplied'
      required:
        - status
    BetaIterationsUsage:
      type: array
      items:
        anyOf:
          - $ref: '#/components/schemas/BetaMessageIterationUsage'
          - $ref: '#/components/schemas/BetaCompactionIterationUsage'
          - $ref: '#/components/schemas/BetaAdvisorMessageIterationUsage'
          - $ref: '#/components/schemas/BetaFallbackMessageIterationUsage'
    BetaOutputTokensDetails:
      type: object
      properties:
        thinking_tokens:
          type: number
          minimum: 0
          default: 0
      required:
        - thinking_tokens
    BetaServerToolUsage:
      type: object
      properties:
        web_fetch_requests:
          type: number
          minimum: 0
          default: 0
        web_search_requests:
          type: number
          minimum: 0
          default: 0
      required:
        - web_fetch_requests
        - web_search_requests
    BetaThinkingDroppedInputTransformation:
      type: object
      properties:
        type:
          const: thinking_dropped
          default: thinking_dropped
        path:
          type: string
        reason:
          type: string
          enum:
            - model_binding_mismatch
            - prefix_binding_mismatch
            - organization_binding_mismatch
            - end_user_binding_mismatch
      required:
        - type
        - path
        - reason
    BetaThinkingMismatchAllowedInputTransformation:
      type: object
      properties:
        type:
          const: thinking_mismatch_allowed
          default: thinking_mismatch_allowed
        path:
          type: string
        reason:
          type: string
          enum:
            - model_binding_mismatch
            - prefix_binding_mismatch
            - organization_binding_mismatch
            - end_user_binding_mismatch
      required:
        - type
        - path
        - reason
    BetaMessageContentParam:
      anyOf:
        - type: string
        - type: array
          items:
            $ref: '#/components/schemas/BetaContentBlockParam'
    BetaRequestToolAdditionBlock:
      type: object
      properties:
        type:
          const: tool_addition
        tool:
          anyOf:
            - $ref: '#/components/schemas/BetaToolChangeToolReference'
            - $ref: '#/components/schemas/BetaToolChangeMCPToolReference'
            - $ref: '#/components/schemas/BetaToolChangeMCPToolsetReference'
            - $ref: '#/components/schemas/BetaToolChangeToolDefinitionParam'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
      required:
        - type
        - tool
    BetaRequestToolRemovalBlock:
      type: object
      properties:
        type:
          const: tool_removal
        tool:
          anyOf:
            - $ref: '#/components/schemas/BetaToolChangeToolReference'
            - $ref: '#/components/schemas/BetaToolChangeMCPToolReference'
            - $ref: '#/components/schemas/BetaToolChangeMCPToolsetReference'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
      required:
        - type
        - tool
    BetaSystemMessageOutputConfig:
      type: object
      properties:
        effort:
          anyOf:
            - type: string
              enum:
                - low
                - medium
                - high
                - xhigh
                - max
            - type: 'null'
    BetaInputTokensClearAtLeast:
      type: object
      properties:
        type:
          const: input_tokens
        value:
          type: number
          minimum: 0
      required:
        - type
        - value
    BetaToolUsesKeep:
      type: object
      properties:
        type:
          const: tool_uses
        value:
          type: number
          minimum: 0
      required:
        - type
        - value
    BetaInputTokensTrigger:
      type: object
      properties:
        type:
          const: input_tokens
        value:
          type: number
          minimum: 1
      required:
        - type
        - value
    BetaToolUsesTrigger:
      type: object
      properties:
        type:
          const: tool_uses
        value:
          type: number
          minimum: 1
      required:
        - type
        - value
    BetaThinkingTurns:
      type: object
      properties:
        type:
          const: thinking_turns
        value:
          type: number
          minimum: 1
      required:
        - type
        - value
    BetaAllThinkingTurns:
      type: object
      properties:
        type:
          const: all
      required:
        - type
    BetaCitationCharLocationParam:
      type: object
      properties:
        type:
          const: char_location
        cited_text:
          type: string
        document_index:
          type: number
          minimum: 0
        document_title:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 500
        end_char_index:
          type: number
        start_char_index:
          type: number
          minimum: 0
      required:
        - type
        - cited_text
        - document_index
        - document_title
        - end_char_index
        - start_char_index
    BetaCitationPageLocationParam:
      type: object
      properties:
        type:
          const: page_location
        cited_text:
          type: string
        document_index:
          type: number
          minimum: 0
        document_title:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 500
        end_page_number:
          type: number
        start_page_number:
          type: number
          minimum: 1
      required:
        - type
        - cited_text
        - document_index
        - document_title
        - end_page_number
        - start_page_number
    BetaCitationContentBlockLocationParam:
      type: object
      properties:
        type:
          const: content_block_location
        cited_text:
          type: string
        document_index:
          type: number
          minimum: 0
        document_title:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 500
        end_block_index:
          type: number
        start_block_index:
          type: number
          minimum: 0
      required:
        - type
        - cited_text
        - document_index
        - document_title
        - end_block_index
        - start_block_index
    BetaCitationWebSearchResultLocationParam:
      type: object
      properties:
        type:
          const: web_search_result_location
        cited_text:
          type: string
        encrypted_index:
          type: string
        title:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 512
        url:
          type: string
          minLength: 1
      required:
        - type
        - cited_text
        - encrypted_index
        - title
        - url
    BetaCitationSearchResultLocationParam:
      type: object
      properties:
        type:
          const: search_result_location
        cited_text:
          type: string
        end_block_index:
          type: number
        search_result_index:
          type: number
          minimum: 0
        source:
          type: string
        start_block_index:
          type: number
          minimum: 0
        title:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - cited_text
        - end_block_index
        - search_result_index
        - source
        - start_block_index
        - title
    BetaThinkingBlockBinding:
      type: object
      properties:
        prefix_mismatch_behavior:
          anyOf:
            - $ref: '#/components/schemas/BetaThinkingPrefixMismatchBehavior'
            - type: 'null'
    BetaBrowserToolsetConfigs:
      type: object
      properties:
        type:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserTypeConfig'
            - type: 'null'
        close_tab:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserCloseTabConfig'
            - type: 'null'
        double_click:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserDoubleClickConfig'
            - type: 'null'
        file_upload:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserFileUploadConfig'
            - type: 'null'
        find:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserFindConfig'
            - type: 'null'
        form_input:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserFormInputConfig'
            - type: 'null'
        get_page_text:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserGetPageTextConfig'
            - type: 'null'
        hold_key:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserHoldKeyConfig'
            - type: 'null'
        hover:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserHoverConfig'
            - type: 'null'
        javascript_exec:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserJavascriptExecConfig'
            - type: 'null'
        key:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserKeyConfig'
            - type: 'null'
        left_click:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserLeftClickConfig'
            - type: 'null'
        left_click_drag:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserLeftClickDragConfig'
            - type: 'null'
        left_mouse_down:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserLeftMouseDownConfig'
            - type: 'null'
        left_mouse_up:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserLeftMouseUpConfig'
            - type: 'null'
        list_tabs:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserListTabsConfig'
            - type: 'null'
        middle_click:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserMiddleClickConfig'
            - type: 'null'
        mouse_move:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserMouseMoveConfig'
            - type: 'null'
        navigate:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserNavigateConfig'
            - type: 'null'
        new_tab:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserNewTabConfig'
            - type: 'null'
        read_console:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserReadConsoleConfig'
            - type: 'null'
        read_network:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserReadNetworkConfig'
            - type: 'null'
        read_page:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserReadPageConfig'
            - type: 'null'
        right_click:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserRightClickConfig'
            - type: 'null'
        screenshot:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserScreenshotConfig'
            - type: 'null'
        scroll:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserScrollConfig'
            - type: 'null'
        scroll_to:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserScrollToConfig'
            - type: 'null'
        switch_tab:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserSwitchTabConfig'
            - type: 'null'
        triple_click:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserTripleClickConfig'
            - type: 'null'
        wait:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserWaitConfig'
            - type: 'null'
        zoom:
          anyOf:
            - $ref: '#/components/schemas/BetaBrowserZoomConfig'
            - type: 'null'
    BetaComputerToolsetConfigs:
      type: object
      properties:
        type:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerTypeConfig'
            - type: 'null'
        cursor_position:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerCursorPositionConfig'
            - type: 'null'
        double_click:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerDoubleClickConfig'
            - type: 'null'
        hold_key:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerHoldKeyConfig'
            - type: 'null'
        key:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerKeyConfig'
            - type: 'null'
        left_click:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerLeftClickConfig'
            - type: 'null'
        left_click_drag:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerLeftClickDragConfig'
            - type: 'null'
        left_mouse_down:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerLeftMouseDownConfig'
            - type: 'null'
        left_mouse_up:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerLeftMouseUpConfig'
            - type: 'null'
        middle_click:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerMiddleClickConfig'
            - type: 'null'
        mouse_move:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerMouseMoveConfig'
            - type: 'null'
        right_click:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerRightClickConfig'
            - type: 'null'
        screenshot:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerScreenshotConfig'
            - type: 'null'
        scroll:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerScrollConfig'
            - type: 'null'
        triple_click:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerTripleClickConfig'
            - type: 'null'
        wait:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerWaitConfig'
            - type: 'null'
        zoom:
          anyOf:
            - $ref: '#/components/schemas/BetaComputerZoomConfig'
            - type: 'null'
    BetaUserLocation:
      type: object
      properties:
        type:
          const: approximate
        city:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 255
        country:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 2
          maxLength: 2
        region:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 255
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 255
      required:
        - type
    BetaCitationsConfigParam:
      type: object
      properties:
        enabled:
          type: boolean
    BetaWebFetchURLSources:
      type: object
      properties:
        client_tool_results:
          anyOf:
            - $ref: '#/components/schemas/BetaWebFetchURLSourceAll'
            - $ref: '#/components/schemas/BetaWebFetchURLSourceNone'
            - $ref: '#/components/schemas/BetaWebFetchURLSourceOnly'
            - $ref: '#/components/schemas/BetaWebFetchURLSourceExcept'
        server_tool_results:
          anyOf:
            - $ref: '#/components/schemas/BetaWebFetchURLSourceAll'
            - $ref: '#/components/schemas/BetaWebFetchURLSourceNone'
            - $ref: '#/components/schemas/BetaWebFetchURLSourceOnly'
            - $ref: '#/components/schemas/BetaWebFetchURLSourceExcept'
        user_input:
          anyOf:
            - $ref: '#/components/schemas/BetaWebFetchURLSourceAll'
            - $ref: '#/components/schemas/BetaWebFetchURLSourceNone'
    BetaMCPToolDefaultConfig:
      type: object
      properties:
        defer_loading:
          type: boolean
        enabled:
          type: boolean
    BetaMCPToolParam:
      type: object
      properties:
        input_schema:
          type: object
          additionalProperties: {}
        name:
          type: string
          minLength: 1
        description:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - input_schema
        - name
    BetaTextCitation:
      anyOf:
        - $ref: '#/components/schemas/BetaCitationCharLocation'
        - $ref: '#/components/schemas/BetaCitationPageLocation'
        - $ref: '#/components/schemas/BetaCitationContentBlockLocation'
        - $ref: '#/components/schemas/BetaCitationsWebSearchResultLocation'
        - $ref: '#/components/schemas/BetaCitationSearchResultLocation'
    BetaDirectCaller:
      type: object
      properties:
        type:
          const: direct
      required:
        - type
    BetaServerToolCaller:
      type: object
      properties:
        type:
          const: code_execution_20250825
        tool_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - tool_id
    BetaServerToolCaller20260120:
      type: object
      properties:
        type:
          const: code_execution_20260120
        tool_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
      required:
        - type
        - tool_id
    BetaWebSearchToolResultBlockContent:
      anyOf:
        - $ref: '#/components/schemas/BetaWebSearchToolResultErrorObject'
        - type: array
          items:
            $ref: '#/components/schemas/BetaWebSearchResultBlock'
    BetaWebFetchToolResultErrorBlock:
      type: object
      properties:
        type:
          const: web_fetch_tool_result_error
          default: web_fetch_tool_result_error
        error_code:
          $ref: '#/components/schemas/BetaWebFetchToolResultErrorCode'
      required:
        - type
        - error_code
    BetaWebFetchBlock:
      type: object
      properties:
        type:
          const: web_fetch_result
          default: web_fetch_result
        content:
          $ref: '#/components/schemas/BetaDocumentBlock'
        retrieved_at:
          anyOf:
            - type: string
            - type: 'null'
        url:
          type: string
      required:
        - type
        - content
        - retrieved_at
        - url
    BetaAdvisorToolResultErrorObject:
      type: object
      properties:
        type:
          const: advisor_tool_result_error
          default: advisor_tool_result_error
        error_code:
          type: string
          enum:
            - max_uses_exceeded
            - prompt_too_long
            - too_many_requests
            - overloaded
            - unavailable
            - execution_time_exceeded
            - model_not_found
      required:
        - type
        - error_code
    BetaAdvisorResultBlock:
      type: object
      properties:
        type:
          const: advisor_result
          default: advisor_result
        stop_reason:
          anyOf:
            - type: string
            - type: 'null'
        text:
          type: string
      required:
        - type
        - stop_reason
        - text
    BetaAdvisorRedactedResultBlock:
      type: object
      properties:
        type:
          const: advisor_redacted_result
          default: advisor_redacted_result
        encrypted_content:
          type: string
        stop_reason:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - encrypted_content
        - stop_reason
    BetaCodeExecutionToolResultBlockContent:
      anyOf:
        - $ref: '#/components/schemas/BetaCodeExecutionToolResultErrorObject'
        - $ref: '#/components/schemas/BetaCodeExecutionResultBlock'
        - $ref: '#/components/schemas/BetaEncryptedCodeExecutionResultBlock'
    BetaBashCodeExecutionToolResultErrorObject:
      type: object
      properties:
        type:
          const: bash_code_execution_tool_result_error
          default: bash_code_execution_tool_result_error
        error_code:
          type: string
          enum:
            - invalid_tool_input
            - unavailable
            - too_many_requests
            - execution_time_exceeded
            - output_file_too_large
      required:
        - type
        - error_code
    BetaBashCodeExecutionResultBlock:
      type: object
      properties:
        type:
          const: bash_code_execution_result
          default: bash_code_execution_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/BetaBashCodeExecutionOutputBlock'
        return_code:
          type: number
        stderr:
          type: string
        stdout:
          type: string
      required:
        - type
        - content
        - return_code
        - stderr
        - stdout
    BetaTextEditorCodeExecutionToolResultErrorObject:
      type: object
      properties:
        type:
          const: text_editor_code_execution_tool_result_error
          default: text_editor_code_execution_tool_result_error
        error_code:
          type: string
          enum:
            - invalid_tool_input
            - unavailable
            - too_many_requests
            - execution_time_exceeded
            - file_not_found
        error_message:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - error_code
        - error_message
    BetaTextEditorCodeExecutionViewResultBlock:
      type: object
      properties:
        type:
          const: text_editor_code_execution_view_result
          default: text_editor_code_execution_view_result
        content:
          type: string
        file_type:
          type: string
          enum:
            - text
            - image
            - pdf
        num_lines:
          anyOf:
            - type: number
            - type: 'null'
        start_line:
          anyOf:
            - type: number
            - type: 'null'
        total_lines:
          anyOf:
            - type: number
            - type: 'null'
      required:
        - type
        - content
        - file_type
        - num_lines
        - start_line
        - total_lines
    BetaTextEditorCodeExecutionCreateResultBlock:
      type: object
      properties:
        type:
          const: text_editor_code_execution_create_result
          default: text_editor_code_execution_create_result
        is_file_update:
          type: boolean
      required:
        - type
        - is_file_update
    BetaTextEditorCodeExecutionStrReplaceResultBlock:
      type: object
      properties:
        type:
          const: text_editor_code_execution_str_replace_result
          default: text_editor_code_execution_str_replace_result
        lines:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        new_lines:
          anyOf:
            - type: number
            - type: 'null'
        new_start:
          anyOf:
            - type: number
            - type: 'null'
        old_lines:
          anyOf:
            - type: number
            - type: 'null'
        old_start:
          anyOf:
            - type: number
            - type: 'null'
      required:
        - type
        - lines
        - new_lines
        - new_start
        - old_lines
        - old_start
    BetaToolSearchToolResultErrorObject:
      type: object
      properties:
        type:
          const: tool_search_tool_result_error
          default: tool_search_tool_result_error
        error_code:
          type: string
          enum:
            - invalid_tool_input
            - unavailable
            - too_many_requests
            - execution_time_exceeded
        error_message:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - error_code
        - error_message
    BetaToolSearchToolSearchResultBlock:
      type: object
      properties:
        type:
          const: tool_search_tool_search_result
          default: tool_search_tool_search_result
        tool_references:
          type: array
          items:
            $ref: '#/components/schemas/BetaToolReferenceBlock'
      required:
        - type
        - tool_references
    BetaResponseToolAdditionBlock:
      type: object
      properties:
        type:
          const: tool_addition
          default: tool_addition
        tool:
          anyOf:
            - $ref: '#/components/schemas/BetaResponseToolChangeToolReference'
            - $ref: '#/components/schemas/BetaResponseToolChangeMCPToolReference'
            - $ref: '#/components/schemas/BetaResponseToolChangeMCPToolsetReference'
            - $ref: '#/components/schemas/BetaToolChangeToolDefinition'
      required:
        - type
        - tool
    BetaResponseToolRemovalBlock:
      type: object
      properties:
        type:
          const: tool_removal
          default: tool_removal
        tool:
          anyOf:
            - $ref: '#/components/schemas/BetaResponseToolChangeToolReference'
            - $ref: '#/components/schemas/BetaResponseToolChangeMCPToolReference'
            - $ref: '#/components/schemas/BetaResponseToolChangeMCPToolsetReference'
      required:
        - type
        - tool
    BetaFallbackInfo:
      type: object
      properties:
        model:
          type: string
          examples:
            - claude-opus-5-5
      required:
        - model
    BetaFallbackRefusalTrigger:
      type: object
      properties:
        type:
          const: refusal
          default: refusal
        category:
          anyOf:
            - type: string
              enum:
                - cyber
                - bio
                - frontier_llm
                - reasoning_extraction
                - general_harms
            - type: 'null'
      required:
        - type
        - category
    BetaMCPTool:
      type: object
      properties:
        input_schema:
          type: object
          additionalProperties: {}
        name:
          type: string
        description:
          type: string
      required:
        - input_schema
        - name
    BetaCacheMissModelChanged:
      type: object
      properties:
        type:
          const: model_changed
          default: model_changed
        cache_missed_input_tokens:
          type: number
      required:
        - type
        - cache_missed_input_tokens
    BetaCacheMissSystemChanged:
      type: object
      properties:
        type:
          const: system_changed
          default: system_changed
        cache_missed_input_tokens:
          type: number
      required:
        - type
        - cache_missed_input_tokens
    BetaCacheMissToolsChanged:
      type: object
      properties:
        type:
          const: tools_changed
          default: tools_changed
        cache_missed_input_tokens:
          type: number
      required:
        - type
        - cache_missed_input_tokens
    BetaCacheMissMessagesChanged:
      type: object
      properties:
        type:
          const: messages_changed
          default: messages_changed
        cache_missed_input_tokens:
          type: number
      required:
        - type
        - cache_missed_input_tokens
    BetaCacheMissPreviousMessageNotFound:
      type: object
      properties:
        type:
          const: previous_message_not_found
          default: previous_message_not_found
      required:
        - type
    BetaCacheMissUnavailable:
      type: object
      properties:
        type:
          const: unavailable
          default: unavailable
      required:
        - type
    BetaFallbackCreditRedeemed:
      type: object
      properties:
        type:
          const: redeemed
          default: redeemed
      required:
        - type
    BetaFallbackCreditNotApplied:
      type: object
      properties:
        type:
          const: not_applied
          default: not_applied
        reason:
          type: string
          enum:
            - body_mismatch
            - continuation_excluded
            - continuation_only
            - expired
            - invalid_target_model
            - not_enabled
            - reprice_unavailable
            - temporarily_unavailable
            - variant_fields_present
            - wrong_organization
            - wrong_platform
            - wrong_workspace
        remove_to_redeem:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
      required:
        - type
        - reason
    BetaMessageIterationUsage:
      type: object
      properties:
        type:
          const: message
          default: message
        cache_creation:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheCreation'
            - type: 'null'
        cache_creation_input_tokens:
          type: number
          minimum: 0
          default: 0
        cache_read_input_tokens:
          type: number
          minimum: 0
          default: 0
        input_tokens:
          type: number
          minimum: 0
        model:
          anyOf:
            - type: string
              examples:
                - claude-opus-5-5
            - type: 'null'
        output_tokens:
          type: number
          minimum: 0
      required:
        - type
        - cache_creation
        - cache_creation_input_tokens
        - cache_read_input_tokens
        - input_tokens
        - model
        - output_tokens
    BetaCompactionIterationUsage:
      type: object
      properties:
        type:
          const: compaction
          default: compaction
        cache_creation:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheCreation'
            - type: 'null'
        cache_creation_input_tokens:
          type: number
          minimum: 0
          default: 0
        cache_read_input_tokens:
          type: number
          minimum: 0
          default: 0
        input_tokens:
          type: number
          minimum: 0
        output_tokens:
          type: number
          minimum: 0
      required:
        - type
        - cache_creation
        - cache_creation_input_tokens
        - cache_read_input_tokens
        - input_tokens
        - output_tokens
    BetaAdvisorMessageIterationUsage:
      type: object
      properties:
        type:
          const: advisor_message
          default: advisor_message
        cache_creation:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheCreation'
            - type: 'null'
        cache_creation_input_tokens:
          type: number
          minimum: 0
          default: 0
        cache_read_input_tokens:
          type: number
          minimum: 0
          default: 0
        input_tokens:
          type: number
          minimum: 0
        model:
          type: string
          examples:
            - claude-opus-5-5
        output_tokens:
          type: number
          minimum: 0
      required:
        - type
        - cache_creation
        - cache_creation_input_tokens
        - cache_read_input_tokens
        - input_tokens
        - model
        - output_tokens
    BetaFallbackMessageIterationUsage:
      type: object
      properties:
        type:
          const: fallback_message
          default: fallback_message
        cache_creation:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheCreation'
            - type: 'null'
        cache_creation_input_tokens:
          type: number
          minimum: 0
          default: 0
        cache_read_input_tokens:
          type: number
          minimum: 0
          default: 0
        input_tokens:
          type: number
          minimum: 0
        model:
          type: string
          examples:
            - claude-opus-5-5
        output_tokens:
          type: number
          minimum: 0
      required:
        - type
        - cache_creation
        - cache_creation_input_tokens
        - cache_read_input_tokens
        - input_tokens
        - model
        - output_tokens
    BetaContentBlockParam:
      anyOf:
        - $ref: '#/components/schemas/BetaTextBlockParam'
        - $ref: '#/components/schemas/BetaImageBlockParam'
        - $ref: '#/components/schemas/BetaRequestDocumentBlock'
        - $ref: '#/components/schemas/BetaSearchResultBlockParam'
        - $ref: '#/components/schemas/BetaThinkingBlockParam'
        - $ref: '#/components/schemas/BetaRedactedThinkingBlockParam'
        - $ref: '#/components/schemas/BetaToolUseBlockParam'
        - $ref: '#/components/schemas/BetaToolResultBlockParam'
        - $ref: '#/components/schemas/BetaServerToolUseBlockParam'
        - $ref: '#/components/schemas/BetaWebSearchToolResultBlockParam'
        - $ref: '#/components/schemas/BetaWebFetchToolResultBlockParam'
        - $ref: '#/components/schemas/BetaAdvisorToolResultBlockParam'
        - $ref: '#/components/schemas/BetaCodeExecutionToolResultBlockParam'
        - $ref: '#/components/schemas/BetaBashCodeExecutionToolResultBlockParam'
        - $ref: '#/components/schemas/BetaTextEditorCodeExecutionToolResultBlockParam'
        - $ref: '#/components/schemas/BetaToolSearchToolResultBlockParam'
        - $ref: '#/components/schemas/BetaMCPToolUseBlockParam'
        - $ref: '#/components/schemas/BetaRequestMCPToolResultBlockParam'
        - $ref: '#/components/schemas/BetaContainerUploadBlockParam'
        - $ref: '#/components/schemas/BetaCompactionBlockParam'
        - $ref: '#/components/schemas/BetaRequestToolAdditionBlock'
        - $ref: '#/components/schemas/BetaRequestToolRemovalBlock'
        - $ref: '#/components/schemas/BetaMCPToolListingBlockParam'
        - $ref: '#/components/schemas/BetaFallbackBlockParam'
    BetaToolChangeToolReference:
      type: object
      properties:
        type:
          const: tool_reference
        name:
          type: string
          pattern: ^[a-zA-Z0-9_-]{1,128}$
      required:
        - type
        - name
    BetaToolChangeMCPToolReference:
      type: object
      properties:
        type:
          const: mcp_tool_reference
        name:
          type: string
        server_name:
          type: string
      required:
        - type
        - name
        - server_name
    BetaToolChangeMCPToolsetReference:
      type: object
      properties:
        type:
          const: mcp_toolset_reference
        server_name:
          type: string
      required:
        - type
        - server_name
    BetaToolChangeToolDefinitionParam:
      type: object
      properties:
        type:
          const: tool_definition
        definition:
          $ref: '#/components/schemas/BetaToolUnion'
      required:
        - type
        - definition
    BetaThinkingPrefixMismatchBehavior:
      type: string
      enum:
        - error
        - drop_block
    BetaBrowserTypeConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserCloseTabConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserDoubleClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserFileUploadConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserFindConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserFormInputConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserGetPageTextConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserHoldKeyConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserHoverConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserJavascriptExecConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserKeyConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserLeftClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserLeftClickDragConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserLeftMouseDownConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserLeftMouseUpConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserListTabsConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserMiddleClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserMouseMoveConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserNavigateConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserNewTabConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserReadConsoleConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserReadNetworkConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserReadPageConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserRightClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserScreenshotConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserScrollConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserScrollToConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserSwitchTabConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserTripleClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserWaitConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaBrowserZoomConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerTypeConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerCursorPositionConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerDoubleClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerHoldKeyConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerKeyConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerLeftClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerLeftClickDragConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerLeftMouseDownConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerLeftMouseUpConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerMiddleClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerMouseMoveConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerRightClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerScreenshotConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerScrollConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerTripleClickConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerWaitConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaComputerZoomConfig:
      type: object
      properties:
        defer_loading:
          anyOf:
            - type: boolean
            - type: 'null'
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
    BetaWebFetchURLSourceAll:
      type: object
      properties:
        type:
          const: all
      required:
        - type
    BetaWebFetchURLSourceNone:
      type: object
      properties:
        type:
          const: none
      required:
        - type
    BetaWebFetchURLSourceOnly:
      type: object
      properties:
        type:
          const: only
        tools:
          type: array
          items:
            $ref: '#/components/schemas/BetaWebFetchURLSourceToolReference'
      required:
        - type
        - tools
    BetaWebFetchURLSourceExcept:
      type: object
      properties:
        type:
          const: except
        tools:
          type: array
          items:
            $ref: '#/components/schemas/BetaWebFetchURLSourceToolReference'
      required:
        - type
        - tools
    BetaCitationCharLocation:
      type: object
      properties:
        type:
          const: char_location
          default: char_location
        cited_text:
          type: string
        document_index:
          type: number
          minimum: 0
        document_title:
          anyOf:
            - type: string
            - type: 'null'
        end_char_index:
          type: number
        file_id:
          anyOf:
            - type: string
            - type: 'null'
        start_char_index:
          type: number
          minimum: 0
      required:
        - type
        - cited_text
        - document_index
        - document_title
        - end_char_index
        - file_id
        - start_char_index
    BetaCitationPageLocation:
      type: object
      properties:
        type:
          const: page_location
          default: page_location
        cited_text:
          type: string
        document_index:
          type: number
          minimum: 0
        document_title:
          anyOf:
            - type: string
            - type: 'null'
        end_page_number:
          type: number
        file_id:
          anyOf:
            - type: string
            - type: 'null'
        start_page_number:
          type: number
          minimum: 1
      required:
        - type
        - cited_text
        - document_index
        - document_title
        - end_page_number
        - file_id
        - start_page_number
    BetaCitationContentBlockLocation:
      type: object
      properties:
        type:
          const: content_block_location
          default: content_block_location
        cited_text:
          type: string
        document_index:
          type: number
          minimum: 0
        document_title:
          anyOf:
            - type: string
            - type: 'null'
        end_block_index:
          type: number
        file_id:
          anyOf:
            - type: string
            - type: 'null'
        start_block_index:
          type: number
          minimum: 0
      required:
        - type
        - cited_text
        - document_index
        - document_title
        - end_block_index
        - file_id
        - start_block_index
    BetaCitationsWebSearchResultLocation:
      type: object
      properties:
        type:
          const: web_search_result_location
          default: web_search_result_location
        cited_text:
          type: string
        encrypted_index:
          type: string
        title:
          anyOf:
            - type: string
            - type: 'null'
          maxLength: 512
        url:
          type: string
      required:
        - type
        - cited_text
        - encrypted_index
        - title
        - url
    BetaCitationSearchResultLocation:
      type: object
      properties:
        type:
          const: search_result_location
          default: search_result_location
        cited_text:
          type: string
        end_block_index:
          type: number
        search_result_index:
          type: number
          minimum: 0
        source:
          type: string
        start_block_index:
          type: number
          minimum: 0
        title:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - cited_text
        - end_block_index
        - search_result_index
        - source
        - start_block_index
        - title
    BetaWebSearchToolResultErrorObject:
      type: object
      properties:
        type:
          const: web_search_tool_result_error
          default: web_search_tool_result_error
        error_code:
          $ref: '#/components/schemas/BetaWebSearchToolResultErrorCode'
      required:
        - type
        - error_code
    BetaWebSearchResultBlock:
      type: object
      properties:
        type:
          const: web_search_result
          default: web_search_result
        encrypted_content:
          type: string
        page_age:
          anyOf:
            - type: string
            - type: 'null'
        title:
          type: string
        url:
          type: string
      required:
        - type
        - encrypted_content
        - page_age
        - title
        - url
    BetaWebFetchToolResultErrorCode:
      type: string
      enum:
        - invalid_tool_input
        - url_too_long
        - url_not_allowed
        - url_not_in_prior_context
        - url_not_accessible
        - unsupported_content_type
        - too_many_requests
        - max_uses_exceeded
        - unavailable
        - content_too_large
    BetaDocumentBlock:
      type: object
      properties:
        type:
          const: document
          default: document
        citations:
          anyOf:
            - $ref: '#/components/schemas/BetaCitationConfig'
            - type: 'null'
        source:
          anyOf:
            - $ref: '#/components/schemas/BetaBase64PDFSource'
            - $ref: '#/components/schemas/BetaPlainTextSource'
        title:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - citations
        - source
        - title
    BetaCodeExecutionToolResultErrorObject:
      type: object
      properties:
        type:
          const: code_execution_tool_result_error
          default: code_execution_tool_result_error
        error_code:
          $ref: '#/components/schemas/BetaCodeExecutionToolResultErrorCode'
      required:
        - type
        - error_code
    BetaCodeExecutionResultBlock:
      type: object
      properties:
        type:
          const: code_execution_result
          default: code_execution_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/BetaCodeExecutionOutputBlock'
        return_code:
          type: number
        stderr:
          type: string
        stdout:
          type: string
      required:
        - type
        - content
        - return_code
        - stderr
        - stdout
    BetaEncryptedCodeExecutionResultBlock:
      type: object
      properties:
        type:
          const: encrypted_code_execution_result
          default: encrypted_code_execution_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/BetaCodeExecutionOutputBlock'
        encrypted_stdout:
          type: string
        return_code:
          type: number
        stderr:
          type: string
      required:
        - type
        - content
        - encrypted_stdout
        - return_code
        - stderr
    BetaBashCodeExecutionOutputBlock:
      type: object
      properties:
        type:
          const: bash_code_execution_output
          default: bash_code_execution_output
        file_id:
          type: string
      required:
        - type
        - file_id
    BetaToolReferenceBlock:
      type: object
      properties:
        type:
          const: tool_reference
          default: tool_reference
        tool_name:
          type: string
          minLength: 1
          maxLength: 256
          pattern: ^[a-zA-Z0-9_-]{1,256}$
      required:
        - type
        - tool_name
    BetaResponseToolChangeToolReference:
      type: object
      properties:
        type:
          const: tool_reference
          default: tool_reference
        name:
          type: string
      required:
        - type
        - name
    BetaResponseToolChangeMCPToolReference:
      type: object
      properties:
        type:
          const: mcp_tool_reference
          default: mcp_tool_reference
        name:
          type: string
        server_name:
          type: string
      required:
        - type
        - name
        - server_name
    BetaResponseToolChangeMCPToolsetReference:
      type: object
      properties:
        type:
          const: mcp_toolset_reference
          default: mcp_toolset_reference
        server_name:
          type: string
      required:
        - type
        - server_name
    BetaToolChangeToolDefinition:
      type: object
      properties:
        type:
          const: tool_definition
          default: tool_definition
        definition:
          $ref: '#/components/schemas/BetaResponseToolUnion'
      required:
        - type
        - definition
    BetaImageBlockParam:
      type: object
      properties:
        type:
          const: image
        source:
          anyOf:
            - $ref: '#/components/schemas/BetaBase64ImageSource'
            - $ref: '#/components/schemas/BetaURLImageSource'
            - $ref: '#/components/schemas/BetaFileImageSource'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        transformations:
          anyOf:
            - $ref: '#/components/schemas/BetaImageTransformationsParam'
            - type: 'null'
      required:
        - type
        - source
    BetaRequestDocumentBlock:
      type: object
      properties:
        type:
          const: document
        source:
          anyOf:
            - $ref: '#/components/schemas/BetaBase64PDFSource'
            - $ref: '#/components/schemas/BetaPlainTextSource'
            - $ref: '#/components/schemas/BetaContentBlockSource'
            - $ref: '#/components/schemas/BetaURLPDFSource'
            - $ref: '#/components/schemas/BetaFileDocumentSource'
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        citations:
          anyOf:
            - $ref: '#/components/schemas/BetaCitationsConfigParam'
            - type: 'null'
        context:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
        title:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 500
      required:
        - type
        - source
    BetaSearchResultBlockParam:
      type: object
      properties:
        type:
          const: search_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/BetaTextBlockParam'
        source:
          type: string
        title:
          type: string
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        citations:
          $ref: '#/components/schemas/BetaCitationsConfigParam'
      required:
        - type
        - content
        - source
        - title
    BetaThinkingBlockParam:
      type: object
      properties:
        type:
          const: thinking
        signature:
          type: string
        thinking:
          type: string
      required:
        - type
        - signature
        - thinking
    BetaRedactedThinkingBlockParam:
      type: object
      properties:
        type:
          const: redacted_thinking
        data:
          type: string
      required:
        - type
        - data
    BetaToolUseBlockParam:
      type: object
      properties:
        type:
          const: tool_use
        id:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        input:
          type: object
          additionalProperties: {}
        name:
          type: string
          minLength: 1
          maxLength: 200
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        caller:
          anyOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller20260120'
        toolset_name:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 64
          pattern: ^[a-zA-Z0-9_-]+$
      required:
        - type
        - id
        - input
        - name
    BetaToolResultBlockParam:
      type: object
      properties:
        type:
          const: tool_result
        tool_use_id:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        content:
          anyOf:
            - type: string
            - type: array
              items:
                anyOf:
                  - $ref: '#/components/schemas/BetaTextBlockParam'
                  - $ref: '#/components/schemas/BetaImageBlockParam'
                  - $ref: '#/components/schemas/BetaSearchResultBlockParam'
                  - $ref: '#/components/schemas/BetaRequestDocumentBlock'
                  - $ref: '#/components/schemas/BetaToolReferenceBlockParam'
                  - $ref: '#/components/schemas/BetaBrowserStateBlockParam'
        is_error:
          type: boolean
        toolset_name:
          anyOf:
            - type: string
            - type: 'null'
          minLength: 1
          maxLength: 64
          pattern: ^[a-zA-Z0-9_-]+$
      required:
        - type
        - tool_use_id
    BetaServerToolUseBlockParam:
      type: object
      properties:
        type:
          const: server_tool_use
        id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        input:
          type: object
          additionalProperties: {}
        name:
          type: string
          enum:
            - advisor
            - web_search
            - web_fetch
            - code_execution
            - bash_code_execution
            - text_editor_code_execution
            - tool_search_tool_regex
            - tool_search_tool_bm25
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        caller:
          anyOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller20260120'
      required:
        - type
        - id
        - input
        - name
    BetaWebSearchToolResultBlockParam:
      type: object
      properties:
        type:
          const: web_search_tool_result
        content:
          $ref: '#/components/schemas/BetaWebSearchToolResultBlockParamContent'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        caller:
          anyOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller20260120'
      required:
        - type
        - content
        - tool_use_id
    BetaWebFetchToolResultBlockParam:
      type: object
      properties:
        type:
          const: web_fetch_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaWebFetchToolResultErrorBlockParam'
            - $ref: '#/components/schemas/BetaWebFetchBlockParam'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        caller:
          anyOf:
            - $ref: '#/components/schemas/BetaDirectCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller'
            - $ref: '#/components/schemas/BetaServerToolCaller20260120'
      required:
        - type
        - content
        - tool_use_id
    BetaAdvisorToolResultBlockParam:
      type: object
      properties:
        type:
          const: advisor_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaAdvisorToolResultErrorParam'
            - $ref: '#/components/schemas/BetaAdvisorResultBlockParam'
            - $ref: '#/components/schemas/BetaAdvisorRedactedResultBlockParam'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
      required:
        - type
        - content
        - tool_use_id
    BetaCodeExecutionToolResultBlockParam:
      type: object
      properties:
        type:
          const: code_execution_tool_result
        content:
          $ref: '#/components/schemas/BetaCodeExecutionToolResultBlockParamContent'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
      required:
        - type
        - content
        - tool_use_id
    BetaBashCodeExecutionToolResultBlockParam:
      type: object
      properties:
        type:
          const: bash_code_execution_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaBashCodeExecutionToolResultErrorParam'
            - $ref: '#/components/schemas/BetaBashCodeExecutionResultBlockParam'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
      required:
        - type
        - content
        - tool_use_id
    BetaTextEditorCodeExecutionToolResultBlockParam:
      type: object
      properties:
        type:
          const: text_editor_code_execution_tool_result
        content:
          anyOf:
            - $ref: >-
                #/components/schemas/BetaTextEditorCodeExecutionToolResultErrorParam
            - $ref: >-
                #/components/schemas/BetaTextEditorCodeExecutionViewResultBlockParam
            - $ref: >-
                #/components/schemas/BetaTextEditorCodeExecutionCreateResultBlockParam
            - $ref: >-
                #/components/schemas/BetaTextEditorCodeExecutionStrReplaceResultBlockParam
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
      required:
        - type
        - content
        - tool_use_id
    BetaToolSearchToolResultBlockParam:
      type: object
      properties:
        type:
          const: tool_search_tool_result
        content:
          anyOf:
            - $ref: '#/components/schemas/BetaToolSearchToolResultErrorParam'
            - $ref: '#/components/schemas/BetaToolSearchToolSearchResultBlockParam'
        tool_use_id:
          type: string
          pattern: ^srvtoolu_[a-zA-Z0-9_]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
      required:
        - type
        - content
        - tool_use_id
    BetaMCPToolUseBlockParam:
      type: object
      properties:
        type:
          const: mcp_tool_use
        id:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        input:
          type: object
          additionalProperties: {}
        name:
          type: string
        server_name:
          type: string
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
      required:
        - type
        - id
        - input
        - name
        - server_name
    BetaRequestMCPToolResultBlockParam:
      type: object
      properties:
        type:
          const: mcp_tool_result
        tool_use_id:
          type: string
          pattern: ^[a-zA-Z0-9_-]+$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        content:
          anyOf:
            - type: string
            - type: array
              items:
                $ref: '#/components/schemas/BetaTextBlockParam'
        is_error:
          type: boolean
      required:
        - type
        - tool_use_id
    BetaContainerUploadBlockParam:
      type: object
      properties:
        type:
          const: container_upload
        file_id:
          type: string
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
      required:
        - type
        - file_id
    BetaCompactionBlockParam:
      type: object
      properties:
        type:
          const: compaction
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        content:
          anyOf:
            - type: string
            - type: 'null'
        encrypted_content:
          anyOf:
            - type: string
            - type: 'null'
        signature:
          anyOf:
            - type: string
            - type: 'null'
        tool_changes:
          anyOf:
            - type: array
              items:
                anyOf:
                  - $ref: '#/components/schemas/BetaRequestToolAdditionBlock'
                  - $ref: '#/components/schemas/BetaRequestToolRemovalBlock'
            - type: 'null'
      required:
        - type
    BetaMCPToolListingBlockParam:
      type: object
      properties:
        type:
          const: mcp_tool_listing
        mcp_server_name:
          type: string
          minLength: 1
          maxLength: 255
        tools:
          type: array
          items:
            $ref: '#/components/schemas/BetaMCPToolParam'
      required:
        - type
        - mcp_server_name
        - tools
    BetaFallbackBlockParam:
      type: object
      properties:
        type:
          const: fallback
        from:
          $ref: '#/components/schemas/BetaFallbackInfoParam'
        to:
          $ref: '#/components/schemas/BetaFallbackInfoParam'
        trigger: {}
      required:
        - type
        - from
        - to
    BetaWebFetchURLSourceToolReference:
      type: object
      properties:
        type:
          const: tool_reference
        name:
          type: string
      required:
        - type
        - name
    BetaWebSearchToolResultErrorCode:
      type: string
      enum:
        - invalid_tool_input
        - unavailable
        - max_uses_exceeded
        - too_many_requests
        - query_too_long
        - request_too_large
    BetaCitationConfig:
      type: object
      properties:
        enabled:
          type: boolean
          default: false
      required:
        - enabled
    BetaBase64PDFSource:
      type: object
      properties:
        type:
          const: base64
        data:
          type: string
        media_type:
          const: application/pdf
      required:
        - type
        - data
        - media_type
    BetaPlainTextSource:
      type: object
      properties:
        type:
          const: text
        data:
          type: string
        media_type:
          const: text/plain
      required:
        - type
        - data
        - media_type
    BetaCodeExecutionToolResultErrorCode:
      type: string
      enum:
        - invalid_tool_input
        - unavailable
        - too_many_requests
        - execution_time_exceeded
    BetaCodeExecutionOutputBlock:
      type: object
      properties:
        type:
          const: code_execution_output
          default: code_execution_output
        file_id:
          type: string
      required:
        - type
        - file_id
    BetaResponseToolUnion:
      anyOf:
        - $ref: '#/components/schemas/BetaResponseTool'
        - $ref: '#/components/schemas/BetaToolBash20241022'
        - $ref: '#/components/schemas/BetaToolBash20250124'
        - $ref: '#/components/schemas/BetaCodeExecutionTool20250522'
        - $ref: '#/components/schemas/BetaCodeExecutionTool20250825'
        - $ref: '#/components/schemas/BetaCodeExecutionTool20260120'
        - $ref: '#/components/schemas/BetaCodeExecutionTool20260521'
        - $ref: '#/components/schemas/BetaBrowserToolset20260801'
        - $ref: '#/components/schemas/BetaToolComputerUse20241022'
        - $ref: '#/components/schemas/BetaMemoryTool20250818'
        - $ref: '#/components/schemas/BetaToolComputerUse20250124'
        - $ref: '#/components/schemas/BetaToolTextEditor20241022'
        - $ref: '#/components/schemas/BetaToolComputerUse20251124'
        - $ref: '#/components/schemas/BetaComputerToolset20260801'
        - $ref: '#/components/schemas/BetaToolTextEditor20250124'
        - $ref: '#/components/schemas/BetaToolTextEditor20250429'
        - $ref: '#/components/schemas/BetaToolTextEditor20250728'
        - $ref: '#/components/schemas/BetaWebSearchTool20250305'
        - $ref: '#/components/schemas/BetaWebFetchTool20250910'
        - $ref: '#/components/schemas/BetaWebSearchTool20260209'
        - $ref: '#/components/schemas/BetaWebFetchTool20260209'
        - $ref: '#/components/schemas/BetaWebFetchTool20260309'
        - $ref: '#/components/schemas/BetaWebSearchTool20260318'
        - $ref: '#/components/schemas/BetaWebFetchTool20260318'
        - $ref: '#/components/schemas/BetaAdvisorTool20260301'
        - $ref: '#/components/schemas/BetaToolSearchToolBm25_20251119'
        - $ref: '#/components/schemas/BetaToolSearchToolRegex20251119'
        - $ref: '#/components/schemas/BetaMCPToolset'
    BetaBase64ImageSource:
      type: object
      properties:
        type:
          const: base64
        data:
          type: string
        media_type:
          type: string
          enum:
            - image/jpeg
            - image/png
            - image/gif
            - image/webp
      required:
        - type
        - data
        - media_type
    BetaURLImageSource:
      type: object
      properties:
        type:
          const: url
        url:
          type: string
      required:
        - type
        - url
    BetaFileImageSource:
      type: object
      properties:
        type:
          const: file
        file_id:
          type: string
      required:
        - type
        - file_id
    BetaImageTransformationsParam:
      type: object
      properties:
        oversized_image:
          type: string
          enum:
            - downsize
            - error
    BetaContentBlockSource:
      type: object
      properties:
        type:
          const: content
        content:
          anyOf:
            - type: string
            - type: array
              items:
                anyOf:
                  - $ref: '#/components/schemas/BetaTextBlockParam'
                  - $ref: '#/components/schemas/BetaImageBlockParam'
      required:
        - type
        - content
    BetaURLPDFSource:
      type: object
      properties:
        type:
          const: url
        url:
          type: string
      required:
        - type
        - url
    BetaFileDocumentSource:
      type: object
      properties:
        type:
          const: file
        file_id:
          type: string
      required:
        - type
        - file_id
    BetaToolReferenceBlockParam:
      type: object
      properties:
        type:
          const: tool_reference
        tool_name:
          type: string
          minLength: 1
          maxLength: 256
          pattern: ^[a-zA-Z0-9_-]{1,256}$
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
      required:
        - type
        - tool_name
    BetaBrowserStateBlockParam:
      type: object
      properties:
        type:
          const: browser_state
        tabs:
          type: array
          items:
            $ref: '#/components/schemas/BetaBrowserStateTabEntry'
          maxItems: 100
        cache_control:
          anyOf:
            - $ref: '#/components/schemas/BetaCacheControlEphemeral'
            - type: 'null'
        state_changes:
          anyOf:
            - type: array
              items:
                $ref: '#/components/schemas/BetaBrowserStateChange'
            - type: 'null'
          minItems: 1
          maxItems: 200
      required:
        - type
        - tabs
    BetaWebSearchToolResultBlockParamContent:
      anyOf:
        - type: array
          items:
            $ref: '#/components/schemas/BetaWebSearchResultBlockParam'
        - $ref: '#/components/schemas/BetaWebSearchToolRequestErrorObject'
    BetaWebFetchToolResultErrorBlockParam:
      type: object
      properties:
        type:
          const: web_fetch_tool_result_error
        error_code:
          $ref: '#/components/schemas/BetaWebFetchToolResultErrorCode'
      required:
        - type
        - error_code
    BetaWebFetchBlockParam:
      type: object
      properties:
        type:
          const: web_fetch_result
        content:
          $ref: '#/components/schemas/BetaRequestDocumentBlock'
        url:
          type: string
        retrieved_at:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - content
        - url
    BetaAdvisorToolResultErrorParam:
      type: object
      properties:
        type:
          const: advisor_tool_result_error
        error_code:
          type: string
          enum:
            - max_uses_exceeded
            - prompt_too_long
            - too_many_requests
            - overloaded
            - unavailable
            - execution_time_exceeded
            - model_not_found
      required:
        - type
        - error_code
    BetaAdvisorResultBlockParam:
      type: object
      properties:
        type:
          const: advisor_result
        text:
          type: string
        stop_reason:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - text
    BetaAdvisorRedactedResultBlockParam:
      type: object
      properties:
        type:
          const: advisor_redacted_result
        encrypted_content:
          type: string
        stop_reason:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - encrypted_content
    BetaCodeExecutionToolResultBlockParamContent:
      anyOf:
        - $ref: '#/components/schemas/BetaCodeExecutionToolResultErrorParam'
        - $ref: '#/components/schemas/BetaCodeExecutionResultBlockParam'
        - $ref: '#/components/schemas/BetaEncryptedCodeExecutionResultBlockParam'
    BetaBashCodeExecutionToolResultErrorParam:
      type: object
      properties:
        type:
          const: bash_code_execution_tool_result_error
        error_code:
          type: string
          enum:
            - invalid_tool_input
            - unavailable
            - too_many_requests
            - execution_time_exceeded
            - output_file_too_large
      required:
        - type
        - error_code
    BetaBashCodeExecutionResultBlockParam:
      type: object
      properties:
        type:
          const: bash_code_execution_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/BetaBashCodeExecutionOutputBlockParam'
        return_code:
          type: number
        stderr:
          type: string
        stdout:
          type: string
      required:
        - type
        - content
        - return_code
        - stderr
        - stdout
    BetaTextEditorCodeExecutionToolResultErrorParam:
      type: object
      properties:
        type:
          const: text_editor_code_execution_tool_result_error
        error_code:
          type: string
          enum:
            - invalid_tool_input
            - unavailable
            - too_many_requests
            - execution_time_exceeded
            - file_not_found
        error_message:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - error_code
    BetaTextEditorCodeExecutionViewResultBlockParam:
      type: object
      properties:
        type:
          const: text_editor_code_execution_view_result
        content:
          type: string
        file_type:
          type: string
          enum:
            - text
            - image
            - pdf
        num_lines:
          anyOf:
            - type: number
            - type: 'null'
        start_line:
          anyOf:
            - type: number
            - type: 'null'
        total_lines:
          anyOf:
            - type: number
            - type: 'null'
      required:
        - type
        - content
        - file_type
    BetaTextEditorCodeExecutionCreateResultBlockParam:
      type: object
      properties:
        type:
          const: text_editor_code_execution_create_result
        is_file_update:
          type: boolean
      required:
        - type
        - is_file_update
    BetaTextEditorCodeExecutionStrReplaceResultBlockParam:
      type: object
      properties:
        type:
          const: text_editor_code_execution_str_replace_result
        lines:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
        new_lines:
          anyOf:
            - type: number
            - type: 'null'
        new_start:
          anyOf:
            - type: number
            - type: 'null'
        old_lines:
          anyOf:
            - type: number
            - type: 'null'
        old_start:
          anyOf:
            - type: number
            - type: 'null'
      required:
        - type
    BetaToolSearchToolResultErrorParam:
      type: object
      properties:
        type:
          const: tool_search_tool_result_error
        error_code:
          type: string
          enum:
            - invalid_tool_input
            - unavailable
            - too_many_requests
            - execution_time_exceeded
        error_message:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - error_code
    BetaToolSearchToolSearchResultBlockParam:
      type: object
      properties:
        type:
          const: tool_search_tool_search_result
        tool_references:
          type: array
          items:
            $ref: '#/components/schemas/BetaToolReferenceBlockParam'
      required:
        - type
        - tool_references
    BetaFallbackInfoParam:
      type: object
      properties:
        model:
          type: string
          examples:
            - claude-opus-5-5
      required:
        - model
    BetaResponseTool:
      type: object
      properties:
        type:
          anyOf:
            - const: custom
            - type: 'null'
        input_schema:
          $ref: '#/components/schemas/BetaResponseToolInputSchema'
        name:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[a-zA-Z0-9_-]{1,128}$
        allowed_callers:
          type: array
          items:
            type: string
            enum:
              - direct
              - code_execution_20250825
              - code_execution_20260120
              - code_execution_20260521
        defer_loading:
          type: boolean
        description:
          type: string
        eager_input_streaming:
          anyOf:
            - type: boolean
            - type: 'null'
        input_examples:
          type: array
          items:
            type: object
            additionalProperties: {}
        strict:
          type: boolean
      required:
        - input_schema
        - name
    BetaBrowserStateTabEntry:
      type: object
      properties:
        tab_id:
          type: string
          minLength: 1
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        title:
          type: string
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        url:
          type: string
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        active:
          type: boolean
      required:
        - tab_id
        - title
        - url
    BetaBrowserStateChange:
      anyOf:
        - $ref: '#/components/schemas/BetaBrowserStateChangeTabOpened'
        - $ref: '#/components/schemas/BetaBrowserStateChangeDownloadStarted'
        - $ref: '#/components/schemas/BetaBrowserStateChangeDownloadCompleted'
        - $ref: '#/components/schemas/BetaBrowserStateChangeDownloadFailed'
    BetaWebSearchResultBlockParam:
      type: object
      properties:
        type:
          const: web_search_result
        encrypted_content:
          type: string
        title:
          type: string
        url:
          type: string
        page_age:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - type
        - encrypted_content
        - title
        - url
    BetaWebSearchToolRequestErrorObject:
      type: object
      properties:
        type:
          const: web_search_tool_result_error
        error_code:
          $ref: '#/components/schemas/BetaWebSearchToolResultErrorCode'
      required:
        - type
        - error_code
    BetaCodeExecutionToolResultErrorParam:
      type: object
      properties:
        type:
          const: code_execution_tool_result_error
        error_code:
          $ref: '#/components/schemas/BetaCodeExecutionToolResultErrorCode'
      required:
        - type
        - error_code
    BetaCodeExecutionResultBlockParam:
      type: object
      properties:
        type:
          const: code_execution_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/BetaCodeExecutionOutputBlockParam'
        return_code:
          type: number
        stderr:
          type: string
        stdout:
          type: string
      required:
        - type
        - content
        - return_code
        - stderr
        - stdout
    BetaEncryptedCodeExecutionResultBlockParam:
      type: object
      properties:
        type:
          const: encrypted_code_execution_result
        content:
          type: array
          items:
            $ref: '#/components/schemas/BetaCodeExecutionOutputBlockParam'
        encrypted_stdout:
          type: string
        return_code:
          type: number
        stderr:
          type: string
      required:
        - type
        - content
        - encrypted_stdout
        - return_code
        - stderr
    BetaBashCodeExecutionOutputBlockParam:
      type: object
      properties:
        type:
          const: bash_code_execution_output
        file_id:
          type: string
      required:
        - type
        - file_id
    BetaResponseToolInputSchema:
      type: object
      properties:
        type:
          const: object
        properties:
          anyOf:
            - type: object
              additionalProperties: {}
            - type: 'null'
        required:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
      required:
        - type
    BetaBrowserStateChangeTabOpened:
      type: object
      properties:
        type:
          const: tab_opened
        tab_id:
          type: string
          minLength: 1
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
      required:
        - type
        - tab_id
    BetaBrowserStateChangeDownloadStarted:
      type: object
      properties:
        type:
          const: download_started
        download_id:
          type: string
          minLength: 1
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        url:
          type: string
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
      required:
        - type
        - download_id
        - url
    BetaBrowserStateChangeDownloadCompleted:
      type: object
      properties:
        type:
          const: download_completed
        download_id:
          type: string
          minLength: 1
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        url:
          type: string
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        path:
          anyOf:
            - type: string
            - type: 'null'
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        size_bytes:
          anyOf:
            - type: number
            - type: 'null'
          minimum: 0
      required:
        - type
        - download_id
        - url
    BetaBrowserStateChangeDownloadFailed:
      type: object
      properties:
        type:
          const: download_failed
        download_id:
          type: string
          minLength: 1
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        url:
          type: string
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
        error:
          anyOf:
            - type: string
            - type: 'null'
          maxLength: 4096
          pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
      required:
        - type
        - download_id
        - url
    BetaCodeExecutionOutputBlockParam:
      type: object
      properties:
        type:
          const: code_execution_output
        file_id:
          type: string
      required:
        - type
        - file_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API认证token
    apiKeyAuth:
      type: apiKey
      in: header
      name: GeekAI-API-Key
      description: API密钥认证

````

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