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

# 获取会话线程

> 通过 OMA API 获取会话线程。

<Info>每个请求都必须发送 `?beta=true`。</Info>


## OpenAPI

````yaml /openapi/oma.zh.json get /v1/sessions/{session_id}/threads/{thread_id}
openapi: 3.1.0
info:
  title: OMA API 参考
  version: 1.0.0
  description: Open Managed Agents 应用 API 参考。
servers:
  - url: http://localhost:38080
    description: 本地 OMA 服务器
security:
  - omaApiKey: []
  - omaBearer: []
paths:
  /v1/sessions/{session_id}/threads/{thread_id}:
    get:
      summary: 获取会话线程
      operationId: BetaGetSessionThread
      parameters:
        - name: beta
          in: query
          required: true
          description: 为此接口启用 Beta API 合同，必须为 `true`。
          schema:
            type: boolean
            enum:
              - true
        - name: anthropic-version
          in: header
          required: false
          schema:
            type: string
        - name: anthropic-beta
          in: header
          required: false
          schema:
            type: string
            items:
              type: string
            x-stainless-override-schema:
              x-stainless-param: betas
              x-stainless-extend-default: true
              type: array
              description: 用于指定一个或多个 Beta 版本的可选请求头。
              items:
                $ref: '#/components/schemas/AnthropicBeta'
            x-default: managed-agents-2026-04-01
        - name: session_id
          in: path
          required: true
          schema:
            type: string
          description: 会话标识符。
          example: sesn_011CZkZAtmR3yMPDzynEDxu7
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
          description: 会话线程标识符。
          example: sthr_011CZkZVWa6oIjw0rgXZpnBt
      responses:
        '200':
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsSessionThread'
        '400':
          description: Invalid argument - 客户端指定了无效的参数
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '401':
          description: 未认证 - 请求没有有效的认证凭据
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '403':
          description: 权限被拒绝 - 调用方没有执行指定操作的权限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '404':
          description: 未找到 - 请求的某个实体不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '408':
          description: 超出截止时间 - 截止时间在操作完成之前已过期
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '409':
          description: 已中止 - 该操作因并发问题而被中止
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '412':
          description: 前置条件不满足 - 由于系统未处于所需状态，操作被拒绝
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '413':
          description: Out of range - 尝试的操作超出了有效范围
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '429':
          description: 资源耗尽 - 某些资源已被耗尽（限流）
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '431':
          description: 请求头字段过大 - 请求元数据过大
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '499':
          description: Cancelled - 操作已被客户端取消
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '500':
          description: Internal - 内部服务器错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '501':
          description: 未实现 - 该操作未实现或不受支持
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '503':
          description: 不可用 - 服务当前不可用
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
        '504':
          description: 超时 - 上游服务未及时响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaErrorResponse'
components:
  schemas:
    BetaManagedAgentsSessionThread:
      description: '`session` 内的一条执行线程。每个会话有一个主线程，以及由协调器派生的零个或多个子线程。'
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - session_id
        - status
        - agent
        - parent_thread_id
        - created_at
        - updated_at
        - archived_at
        - usage
        - stats
      properties:
        type:
          type: string
          enum:
            - session_thread
          examples:
            - session_thread
        id:
          description: 此线程的唯一标识符。
          type: string
          examples:
            - sthr_011CZkZVWa6oIjw0rgXZpnBt
        session_id:
          description: 此线程所属的会话。
          type: string
          examples:
            - sesn_011CZkZAtmR3yMPDzynEDxu7
        status:
          description: 线程的当前执行状态。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSessionThreadStatus'
          examples:
            - idle
        agent:
          description: 此线程已解析的智能体定义。线程创建时该智能体的快照。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSessionRosterEntry'
          examples:
            - type: agent
              id: agent_011CZkYqphY8vELVzwCUpqiQ
              version: 1
              name: Researcher
              description: 一个专注的调研子智能体。
              model:
                id: claude-sonnet-4-6
                speed: standard
              system: 你是一个研究型子智能体，负责为协调智能体收集并总结资料来源。
              tools:
                - type: agent_toolset_20260401
                  default_config:
                    enabled: true
                    permission_policy:
                      type: always_ask
                  configs: []
              mcp_servers: []
              skills: []
        parent_thread_id:
          description: 创建此线程的父线程。主线程为 null。
          type: string
          nullable: true
          examples:
            - null
        created_at:
          description: 线程创建的时间。
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:00:00Z'
        updated_at:
          description: 线程的最后更新时间。
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:00:00Z'
        archived_at:
          description: 线程的归档时间。未归档时为 null。
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
          examples:
            - null
        usage:
          description: 该线程的累计令牌用量。在线程首次转入空闲之前为 null。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSessionThreadUsage'
          nullable: true
          examples:
            - input_tokens: 0
              output_tokens: 0
              cache_read_input_tokens: 0
              cache_creation:
                ephemeral_5m_input_tokens: 0
                ephemeral_1h_input_tokens: 0
        stats:
          description: 该线程的计时统计信息。在线程首次状态转换之前为 null。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSessionThreadStats'
          nullable: true
          examples:
            - duration_seconds: 0
              startup_seconds: 0
              active_seconds: 0
      example:
        type: session_thread
        id: sthr_011CZkZVWa6oIjw0rgXZpnBt
        session_id: sesn_011CZkZAtmR3yMPDzynEDxu7
        status: idle
        agent:
          type: agent
          id: agent_011CZkYqphY8vELVzwCUpqiQ
          version: 1
          name: Researcher
          description: 一个专注的调研子智能体。
          model:
            id: claude-sonnet-4-6
            speed: standard
          system: 你是一个研究型子智能体，负责为协调智能体收集并总结资料来源。
          tools:
            - type: agent_toolset_20260401
              default_config:
                enabled: true
                permission_policy:
                  type: always_ask
              configs: []
          mcp_servers: []
          skills: []
        parent_thread_id: null
        created_at: '2026-03-15T10:00:00Z'
        updated_at: '2026-03-15T10:00:00Z'
        archived_at: null
        usage:
          input_tokens: 0
          output_tokens: 0
          cache_read_input_tokens: 0
          cache_creation:
            ephemeral_5m_input_tokens: 0
            ephemeral_1h_input_tokens: 0
        stats:
          duration_seconds: 0
          startup_seconds: 0
          active_seconds: 0
    BetaErrorResponse:
      properties:
        error:
          discriminator:
            mapping:
              api_error:
                $ref: '#/components/schemas/BetaAPIError'
              authentication_error:
                $ref: '#/components/schemas/BetaAuthenticationError'
              billing_error:
                $ref: '#/components/schemas/BetaBillingError'
              invalid_request_error:
                $ref: '#/components/schemas/BetaInvalidRequestError'
              not_found_error:
                $ref: '#/components/schemas/BetaNotFoundError'
              overloaded_error:
                $ref: '#/components/schemas/BetaOverloadedError'
              permission_error:
                $ref: '#/components/schemas/BetaPermissionError'
              rate_limit_error:
                $ref: '#/components/schemas/BetaRateLimitError'
              timeout_error:
                $ref: '#/components/schemas/BetaGatewayTimeoutError'
            propertyName: type
          oneOf:
            - $ref: '#/components/schemas/BetaInvalidRequestError'
            - $ref: '#/components/schemas/BetaAuthenticationError'
            - $ref: '#/components/schemas/BetaBillingError'
            - $ref: '#/components/schemas/BetaPermissionError'
            - $ref: '#/components/schemas/BetaNotFoundError'
            - $ref: '#/components/schemas/BetaRateLimitError'
            - $ref: '#/components/schemas/BetaGatewayTimeoutError'
            - $ref: '#/components/schemas/BetaAPIError'
            - $ref: '#/components/schemas/BetaOverloadedError'
          title: 错误
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: 请求 ID
        type:
          const: error
          default: error
          title: 类型
          type: string
      required:
        - error
        - request_id
        - type
      title: ErrorResponse
      type: object
    BetaManagedAgentsSessionThreadStatus:
      type: string
      description: SessionThreadStatus 枚举
      enum:
        - running
        - idle
        - rescheduling
        - terminated
    BetaManagedAgentsSessionRosterEntry:
      description: 由会话解析的 multiagent 名册条目。
      discriminator:
        propertyName: type
        mapping:
          agent:
            $ref: '#/components/schemas/BetaManagedAgentsSessionThreadAgent'
          advisor:
            $ref: '#/components/schemas/BetaManagedAgentsAdvisor'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsSessionThreadAgent'
        - $ref: '#/components/schemas/BetaManagedAgentsAdvisor'
    BetaTimestamp:
      description: RFC 3339 格式的时间戳
      type: string
      format: date-time
    BetaManagedAgentsSessionThreadUsage:
      description: 会话线程在所有轮次中的累计令牌用量。
      type: object
      additionalProperties: false
      properties:
        input_tokens:
          description: 所有轮次消耗的输入令牌总数。
          type: integer
          format: int32
        output_tokens:
          description: 所有轮次生成的输出令牌总数。
          type: integer
          format: int32
        cache_read_input_tokens:
          description: 从提示缓存读取的令牌总数。
          type: integer
          format: int32
        cache_creation:
          description: 用于创建提示缓存条目的令牌数量，按缓存 TTL 细分。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsCacheCreationUsage'
        list_cost:
          description: >-
            该线程跨所有轮次的累计列表价成本，按公开列表价计价。在线程的成本跟踪可用之前该字段缺省。每个数值都独立四舍五入到最接近的美分，且会话的汇总
            `usage.list_cost` 还包含会话运行时，因此各线程成本之和不会精确等于会话数值；会话数值为权威值，也是预算强制执行的依据。
          allOf:
            - $ref: '#/components/schemas/BetaMonetaryAmount'
          nullable: true
        active_seconds:
          description: >-
            此线程处于 running 状态的累计时间（秒）。等于
            `stats.active_seconds`；在此处展示是为了让线程的使用量包含其费用计价所依据的全部量。
          type: number
          format: double
        server_tool_use:
          description: 该线程所有轮次中服务器端执行工具的累计使用量。在该线程支持服务器端工具跟踪之前，该字段不存在。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsServerToolUsage'
          nullable: true
    BetaManagedAgentsSessionThreadStats:
      description: 会话线程的耗时统计。
      type: object
      additionalProperties: false
      properties:
        duration_seconds:
          description: 自线程创建以来经过的时长（以秒为单位）。对于已归档线程，冻结在最后一次更新时刻。
          type: number
          format: double
        startup_seconds:
          description: 线程开始运行所需的时长（秒）。子线程为 0，立即启动。
          type: number
          format: double
        active_seconds:
          description: 线程处于活跃运行状态的累计时间（秒）。不包含空闲时间。
          type: number
          format: double
    BetaAPIError:
      properties:
        message:
          default: Internal server error
          title: 消息
          type: string
        type:
          const: api_error
          default: api_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: APIError
      type: object
    BetaAuthenticationError:
      properties:
        message:
          default: Authentication error
          title: 消息
          type: string
        type:
          const: authentication_error
          default: authentication_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: AuthenticationError
      type: object
    BetaBillingError:
      properties:
        message:
          default: Billing error
          title: 消息
          type: string
        type:
          const: billing_error
          default: billing_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: BillingError
      type: object
    BetaInvalidRequestError:
      properties:
        message:
          default: Invalid request
          title: 消息
          type: string
        type:
          const: invalid_request_error
          default: invalid_request_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: InvalidRequestError
      type: object
    BetaNotFoundError:
      properties:
        message:
          default: Not found
          title: 消息
          type: string
        type:
          const: not_found_error
          default: not_found_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: NotFoundError
      type: object
    BetaOverloadedError:
      properties:
        message:
          default: Overloaded
          title: 消息
          type: string
        type:
          const: overloaded_error
          default: overloaded_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: OverloadedError
      type: object
    BetaPermissionError:
      properties:
        message:
          default: Permission denied
          title: 消息
          type: string
        type:
          const: permission_error
          default: permission_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: PermissionError
      type: object
    BetaRateLimitError:
      properties:
        message:
          default: Rate limited
          title: 消息
          type: string
        type:
          const: rate_limit_error
          default: rate_limit_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: RateLimitError
      type: object
    BetaGatewayTimeoutError:
      properties:
        message:
          default: Request timeout
          title: 消息
          type: string
        type:
          const: timeout_error
          default: timeout_error
          title: 类型
          type: string
      required:
        - message
        - type
      title: GatewayTimeoutError
      type: object
    BetaManagedAgentsSessionThreadAgent:
      description: >-
        单个 `session_thread` 所解析出的 `agent` 定义，是线程创建时该智能体的快照。多智能体名册不会在此重复；请从
        `Session.agent` 读取。
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - version
        - name
        - description
        - model
        - system
        - tools
        - mcp_servers
        - skills
      properties:
        type:
          type: string
          enum:
            - agent
          examples:
            - agent
        id:
          type: string
          examples:
            - agent_011CZkYqphY8vELVzwCUpqiQ
        version:
          type: integer
          format: int32
          examples:
            - 1
        name:
          type: string
          examples:
            - Researcher
        description:
          type: string
          nullable: true
          examples:
            - 一个专注于研究的子智能体。
        model:
          $ref: '#/components/schemas/BetaManagedAgentsModelConfig'
          examples:
            - id: claude-sonnet-4-6
              speed: standard
        system:
          type: string
          nullable: true
          examples:
            - 你是一个研究型子智能体，负责为协调智能体收集并总结资料来源。
        tools:
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsAgentTool'
          examples:
            - - type: agent_toolset_20260401
                default_config:
                  enabled: true
                  permission_policy:
                    type: always_ask
                configs: []
        mcp_servers:
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsMCPServer'
          examples:
            - []
        skills:
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsSkill'
          examples:
            - []
      example:
        type: agent
        id: agent_011CZkYqphY8vELVzwCUpqiQ
        version: 1
        name: Researcher
        description: 一个专注的调研子智能体。
        model:
          id: claude-sonnet-4-6
          speed: standard
        system: 你是一个研究型子智能体，负责为协调智能体收集并总结资料来源。
        tools:
          - type: agent_toolset_20260401
            default_config:
              enabled: true
              permission_policy:
                type: always_ask
            configs: []
        mcp_servers: []
        skills: []
    BetaManagedAgentsAdvisor:
      description: 平台顾问名册条目：会话主线程在轮次中可咨询的模型。
      type: object
      additionalProperties: false
      required:
        - model
        - type
      properties:
        model:
          description: 顾问模型 ID。
          type: string
        type:
          type: string
          enum:
            - advisor
    BetaManagedAgentsCacheCreationUsage:
      description: 按缓存存活时间细分的提示缓存创建令牌用量。
      type: object
      additionalProperties: false
      properties:
        ephemeral_1h_input_tokens:
          description: 用于创建 1 小时期临时缓存条目的令牌。
          type: integer
          format: int32
        ephemeral_5m_input_tokens:
          description: 用于创建 5 分钟期临时缓存条目的令牌。
          type: integer
          format: int32
    BetaMonetaryAmount:
      description: 特定货币的金额。
      type: object
      additionalProperties: false
      required:
        - currency
        - amount
      properties:
        currency:
          description: 大写的 ISO-4217 货币代码。`USD` 是目前唯一支持的货币；可接受的集合是封闭的，仅在为新货币定价时才会扩充。
          allOf:
            - $ref: '#/components/schemas/BetaCurrency'
          examples:
            - USD
        amount:
          description: >-
            以货币最小单位表示的金额，为不带前导零的十进制整数字符串："2500" 表示 $25.00，"50" 表示 50
            美分。使用字符串而非数字，以避免应用任何浮点舍入。
          type: string
          examples:
            - '2500'
      example:
        currency: USD
        amount: '2500'
    BetaManagedAgentsServerToolUsage:
      description: 由服务器执行的工具调用的累计次数，按工具分别统计。
      type: object
      additionalProperties: false
      properties:
        web_search_requests:
          description: 服务器执行的网页搜索请求数。
          type: integer
          format: int32
          examples:
            - 3
        web_fetch_requests:
          description: 服务器执行的网页抓取请求数。
          type: integer
          format: int32
          examples:
            - 0
      example:
        web_search_requests: 3
        web_fetch_requests: 0
    BetaManagedAgentsModelConfig:
      description: 模型标识符和配置。
      type: object
      additionalProperties: false
      required:
        - id
      properties:
        id:
          $ref: '#/components/schemas/BetaManagedAgentsModel'
        effort:
          description: >-
            模型在每次推理调用中的努力程度。取值为 `low`、`medium`、`high`、`xhigh`、`max`
            之一。始终存在；未提供时会在保存时解析为对应模型的默认值。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsEffort'
          examples:
            - type: low
        inference_geo:
          description: 模型推理的地理区域。未设置时，请求将回退到工作区的 default_inference_geo。
          type: string
          examples:
            - inference_geo
        speed:
          description: >-
            推理速度模式。`fast` 以较高价格提供显著更快的输出令牌生成速度。默认为 `standard`。并非所有模型都支持
            `fast`；无效组合会在创建时被拒绝。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSpeed'
          examples:
            - standard
      example:
        id: claude-sonnet-4-6
        effort:
          type: low
        inference_geo: inference_geo
        speed: standard
    BetaManagedAgentsAgentTool:
      description: API 响应中返回的工具配置的联合类型。
      type: object
      discriminator:
        propertyName: type
        mapping:
          agent_toolset_20260401:
            $ref: '#/components/schemas/BetaManagedAgentsAgentToolset20260401'
          mcp_toolset:
            $ref: '#/components/schemas/BetaManagedAgentsMCPToolset'
          custom:
            $ref: '#/components/schemas/BetaManagedAgentsCustomTool'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsAgentToolset20260401'
        - $ref: '#/components/schemas/BetaManagedAgentsMCPToolset'
        - $ref: '#/components/schemas/BetaManagedAgentsCustomTool'
    BetaManagedAgentsMCPServer:
      description: API 响应中返回的 MCP 服务器连接定义的联合类型。
      type: object
      discriminator:
        propertyName: type
        mapping:
          url:
            $ref: '#/components/schemas/BetaManagedAgentsMCPServerURLDefinition'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsMCPServerURLDefinition'
    BetaManagedAgentsSkill:
      description: API 响应中返回的已解析技能。
      discriminator:
        propertyName: type
        mapping:
          anthropic:
            $ref: '#/components/schemas/BetaManagedAgentsAnthropicSkill'
          custom:
            $ref: '#/components/schemas/BetaManagedAgentsCustomSkill'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsAnthropicSkill'
        - $ref: '#/components/schemas/BetaManagedAgentsCustomSkill'
    BetaCurrency:
      type: string
      enum:
        - USD
    BetaManagedAgentsModel:
      title: BetaManagedAgentsModel
      description: |-
        为你的智能体提供支持的模型。

        更多详情和选项请参阅[模型列表](/docs/zh/api/models/list-models)。
      anyOf:
        - type: string
        - const: claude-sonnet-5
          description: 面向编程与智能体的高性能模型
          x-stainless-nominal: false
        - const: claude-fable-5
          description: 面向最艰难的知识工作与编程问题的下一代智能
          x-stainless-nominal: false
        - const: claude-opus-5
          description: 面向长时间运行智能体和编程的强大智能
          x-stainless-nominal: false
        - const: claude-opus-4-8
          description: 面向长时间运行智能体和编程的强大智能
          x-stainless-nominal: false
        - const: claude-opus-4-7
          description: 面向长时间运行智能体和编程的强大智能
          x-stainless-nominal: false
        - const: claude-opus-4-6
          description: 面向长时间运行智能体和编程的强大智能
          x-stainless-nominal: false
        - const: claude-sonnet-4-6
          description: 速度与智能的最佳组合
          x-stainless-nominal: false
        - const: claude-haiku-4-5
          description: 具备接近前沿智能的最快模型
          x-stainless-nominal: false
        - const: claude-haiku-4-5-20251001
          description: 具备接近前沿智能的最快模型
          x-stainless-nominal: false
        - const: claude-opus-4-5
          description: 面向长时间运行智能体和编程的强大智能
          x-stainless-nominal: false
        - const: claude-opus-4-5-20251101
          description: 面向长时间运行智能体和编程的强大智能
          x-stainless-nominal: false
        - const: claude-sonnet-4-5
          description: 面向智能体与编程的高性能模型
          x-stainless-nominal: false
        - const: claude-sonnet-4-5-20250929
          description: 面向智能体与编程的高性能模型
          x-stainless-nominal: false
    BetaManagedAgentsEffort:
      description: 模型在每轮中的努力程度。为该会话发起的每个 Messages 调用设置 `output_config.effort`。
      type: object
      discriminator:
        propertyName: type
        mapping:
          low:
            $ref: '#/components/schemas/BetaManagedAgentsEffortLow'
          medium:
            $ref: '#/components/schemas/BetaManagedAgentsEffortMedium'
          high:
            $ref: '#/components/schemas/BetaManagedAgentsEffortHigh'
          xhigh:
            $ref: '#/components/schemas/BetaManagedAgentsEffortXhigh'
          max:
            $ref: '#/components/schemas/BetaManagedAgentsEffortMax'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsEffortLow'
        - $ref: '#/components/schemas/BetaManagedAgentsEffortMedium'
        - $ref: '#/components/schemas/BetaManagedAgentsEffortHigh'
        - $ref: '#/components/schemas/BetaManagedAgentsEffortXhigh'
        - $ref: '#/components/schemas/BetaManagedAgentsEffortMax'
    BetaManagedAgentsSpeed:
      type: string
      description: 推理速度模式。`fast` 以较高价格提供显著更快的输出令牌生成速度。并非所有模型都支持 `fast`；无效组合会在创建时被拒绝。
      enum:
        - standard
        - fast
    BetaManagedAgentsAgentToolset20260401:
      type: object
      additionalProperties: false
      required:
        - configs
        - default_config
        - type
      properties:
        configs:
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsAgentToolConfig'
        default_config:
          $ref: '#/components/schemas/BetaManagedAgentsAgentToolsetDefaultConfig'
        type:
          type: string
          enum:
            - agent_toolset_20260401
    BetaManagedAgentsMCPToolset:
      type: object
      additionalProperties: false
      required:
        - configs
        - default_config
        - mcp_server_name
        - type
      properties:
        configs:
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsMCPToolConfig'
        default_config:
          $ref: '#/components/schemas/BetaManagedAgentsMCPToolsetDefaultConfig'
        mcp_server_name:
          type: string
        type:
          type: string
          enum:
            - mcp_toolset
    BetaManagedAgentsCustomTool:
      description: API 响应中返回的自定义工具。
      type: object
      additionalProperties: false
      required:
        - description
        - input_schema
        - name
        - type
      properties:
        description:
          type: string
        input_schema:
          $ref: '#/components/schemas/BetaManagedAgentsCustomToolInputSchema'
        name:
          type: string
        type:
          type: string
          enum:
            - custom
    BetaManagedAgentsMCPServerURLDefinition:
      description: API 响应中返回的基于 URL 的 MCP 服务器连接。
      type: object
      additionalProperties: false
      required:
        - name
        - type
        - url
      properties:
        name:
          type: string
          examples:
            - example-mcp
        type:
          type: string
          enum:
            - url
          examples:
            - url
        url:
          type: string
          examples:
            - https://example-server.modelcontextprotocol.io/sse
      example:
        type: url
        name: example-mcp
        url: https://example-server.modelcontextprotocol.io/sse
    BetaManagedAgentsAnthropicSkill:
      description: 已解析的 OMA 托管技能。
      type: object
      additionalProperties: false
      required:
        - skill_id
        - type
        - version
      properties:
        skill_id:
          type: string
          examples:
            - xlsx
        type:
          type: string
          enum:
            - anthropic
          examples:
            - anthropic
        version:
          type: string
          examples:
            - '1'
      example:
        type: anthropic
        skill_id: xlsx
        version: '1'
    BetaManagedAgentsCustomSkill:
      description: 已解析的用户创建的自定义技能。
      type: object
      additionalProperties: false
      required:
        - skill_id
        - type
        - version
      properties:
        skill_id:
          type: string
          examples:
            - skill_011CZkZFNu9hAbo3jZPRgTlx
        type:
          type: string
          enum:
            - custom
          examples:
            - custom
        version:
          type: string
          examples:
            - '2'
      example:
        type: custom
        skill_id: skill_011CZkZFNu9hAbo3jZPRgTlx
        version: '2'
    BetaManagedAgentsEffortLow:
      description: 低推理强度。优先考虑延迟而非推理深度。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - low
    BetaManagedAgentsEffortMedium:
      description: 中等努力级别。平衡延迟与推理深度。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - medium
    BetaManagedAgentsEffortHigh:
      description: 高努力级别。偏向推理深度。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - high
    BetaManagedAgentsEffortXhigh:
      description: 超高努力级别。并非所有模型都接受此级别。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - xhigh
    BetaManagedAgentsEffortMax:
      description: 最高努力级别。倾向于推理深度而非延迟。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - max
    BetaManagedAgentsAgentToolConfig:
      description: 特定智能体工具的配置。
      type: object
      additionalProperties: false
      required:
        - enabled
        - name
        - permission_policy
      properties:
        enabled:
          type: boolean
        name:
          $ref: '#/components/schemas/BetaManagedAgentsAgentToolName'
        permission_policy:
          $ref: '#/components/schemas/BetaManagedAgentsPermissionPolicy'
    BetaManagedAgentsAgentToolsetDefaultConfig:
      description: 智能体工具的已解析默认配置。
      type: object
      additionalProperties: false
      required:
        - enabled
        - permission_policy
      properties:
        enabled:
          type: boolean
        permission_policy:
          $ref: '#/components/schemas/BetaManagedAgentsPermissionPolicy'
    BetaManagedAgentsMCPToolConfig:
      description: 特定 MCP 工具的已解析配置。
      type: object
      additionalProperties: false
      required:
        - enabled
        - name
        - permission_policy
      properties:
        enabled:
          type: boolean
        name:
          type: string
        permission_policy:
          $ref: '#/components/schemas/BetaManagedAgentsPermissionPolicy'
    BetaManagedAgentsMCPToolsetDefaultConfig:
      description: 已解析的来自 MCP 服务器的所有工具的默认配置。
      type: object
      additionalProperties: false
      required:
        - enabled
        - permission_policy
      properties:
        enabled:
          type: boolean
        permission_policy:
          $ref: '#/components/schemas/BetaManagedAgentsPermissionPolicy'
    BetaManagedAgentsCustomToolInputSchema:
      additionalProperties: true
      description: 自定义工具输入参数的 JSON 架构。
      properties:
        type:
          const: object
          title: 类型
          type: string
        properties:
          anyOf:
            - type: object
              additionalProperties: true
            - type: 'null'
          title: 属性
          x-stainless-skip:
            - terraform
        required:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: 必填字段
      required:
        - type
      type: object
    BetaManagedAgentsAgentToolName:
      type: string
      description: 内置智能体工具标识符。
      enum:
        - bash
        - edit
        - read
        - write
        - glob
        - grep
        - web_fetch
        - web_search
    BetaManagedAgentsPermissionPolicy:
      description: 工具执行的权限策略。
      type: object
      discriminator:
        propertyName: type
        mapping:
          always_allow:
            $ref: '#/components/schemas/BetaManagedAgentsAlwaysAllowPolicy'
          always_ask:
            $ref: '#/components/schemas/BetaManagedAgentsAlwaysAskPolicy'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsAlwaysAllowPolicy'
        - $ref: '#/components/schemas/BetaManagedAgentsAlwaysAskPolicy'
    BetaManagedAgentsAlwaysAllowPolicy:
      description: 工具调用无需用户确认即自动批准。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - always_allow
    BetaManagedAgentsAlwaysAskPolicy:
      description: 工具调用在执行前需要用户确认。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - always_ask
  securitySchemes:
    omaApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: OMA 工作区 API 密钥。
      x-default: sk-ant-local-default
    omaBearer:
      type: http
      scheme: bearer
      description: 以 Bearer 令牌形式发送的 OMA 工作区 API 密钥。

````