> ## 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`、`anthropic-version: 2023-06-01` 与 `anthropic-beta: managed-agents-2026-04-01`。</Info>


## OpenAPI

````yaml /openapi/oma.zh.json get /v1/deployments/{deployment_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/deployments/{deployment_id}:
    get:
      summary: 获取部署
      operationId: BetaGetDeployment
      parameters:
        - name: beta
          in: query
          required: true
          description: 为此接口启用 Beta API 合同，必须为 `true`。
          schema:
            type: boolean
            enum:
              - true
        - name: anthropic-version
          in: header
          required: true
          schema:
            type: string
            x-default: '2023-06-01'
        - name: anthropic-beta
          in: header
          required: true
          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: deployment_id
          in: path
          required: true
          schema:
            type: string
          description: 部署标识符。
          example: depl_011CZkZcDH3vPqd7xnEfwTai
      responses:
        '200':
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsDeployment'
        '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:
    BetaManagedAgentsDeployment:
      description: 部署是智能体的一个已配置实例——它将智能体绑定到自主运行所需的一切：环境、凭据、初始事件，以及可选的调度计划。
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - name
        - description
        - agent
        - environment_id
        - vault_ids
        - initial_events
        - resources
        - metadata
        - schedule
        - status
        - paused_reason
        - created_at
        - updated_at
        - archived_at
      properties:
        type:
          type: string
          enum:
            - deployment
          examples:
            - deployment
        id:
          description: 此部署的唯一标识符。
          type: string
          examples:
            - depl_011CZkZcDH3vPqd7xnEfwTai
        name:
          description: 人类可读的名称。
          type: string
          examples:
            - 每日订单报告
        description:
          description: 对部署功能的描述。
          type: string
          nullable: true
          examples:
            - 每个工作日早晨将昨天的订单汇总为报告。
        agent:
          description: 该部署所运行的智能体的引用，已解析为具体版本。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsAgentReference'
          examples:
            - type: agent
              id: agent_011CZkYpogX7uDKUyvBTophP
              version: 1
        environment_id:
          description: 会话运行所在 `environment` 的 ID。
          type: string
          examples:
            - env_011CZkZ9X2dpNyB7HsEFoRfW
        vault_ids:
          description: 为从此部署创建的会话提供已存储凭据的密钥库 ID 列表。
          type: array
          items:
            type: string
          examples:
            - - vlt_011CZkZDLs7fYzm1hXNPeRjv
        initial_events:
          description: 每个会话创建后立即发送的事件。
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsDeploymentInitialEvent'
          examples:
            - - type: user.message
                content:
                  - type: text
                    text: 将昨天的订单汇总到 report.md。
        resources:
          description: 附加到此部署所创建会话的资源。回显输入内容，但不包括只写凭据。
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsSessionResourceConfig'
          examples:
            - []
        metadata:
          description: 任意键值元数据。最多 16 对。
          type: object
          additionalProperties:
            type: string
          examples:
            - {}
        schedule:
          description: >-
            周期性 cron 调度。存在时启用计划执行；为 null 表示仅手动执行。cron
            变体包含计算得出的时间戳（下次触发时间、上次运行时间）。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsSchedule'
          nullable: true
          examples:
            - type: cron
              expression: 0 9 * * 1-5
              timezone: America/Los_Angeles
              last_run_at: '2026-03-16T16:00:09Z'
              upcoming_runs_at:
                - '2026-03-17T16:00:00Z'
                - '2026-03-18T16:00:00Z'
        status:
          description: 部署的计算状态：`active` 或 `paused`。已归档的部署会报告为 `active`，同时已设置 `archived_at`。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsDeploymentStatus'
          examples:
            - active
        paused_reason:
          description: 部署被暂停的原因。仅当 status 为 paused 时非空；否则为 null。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsDeploymentPausedReason'
          nullable: true
          examples:
            - null
        budget:
          description: 为该部署创建的每个会话设定的消费上限。未设置预算时不存在。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsBudget'
          nullable: true
        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
      example:
        type: deployment
        id: depl_011CZkZcDH3vPqd7xnEfwTai
        name: 每日订单报告
        description: 每个工作日早晨将前一天的订单汇总为报告。
        agent:
          type: agent
          id: agent_011CZkYpogX7uDKUyvBTophP
          version: 1
        environment_id: env_011CZkZ9X2dpNyB7HsEFoRfW
        vault_ids:
          - vlt_011CZkZDLs7fYzm1hXNPeRjv
        initial_events:
          - type: user.message
            content:
              - type: text
                text: 将昨天的订单汇总到 report.md。
        resources: []
        metadata: {}
        schedule:
          type: cron
          expression: 0 9 * * 1-5
          timezone: America/Los_Angeles
          last_run_at: '2026-03-16T16:00:09Z'
          upcoming_runs_at:
            - '2026-03-17T16:00:00Z'
            - '2026-03-18T16:00:00Z'
        status: active
        paused_reason: null
        created_at: '2026-03-15T10:00:00Z'
        updated_at: '2026-03-15T10:00:00Z'
        archived_at: null
    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
    BetaManagedAgentsAgentReference:
      description: 已解析出具体版本的智能体引用。
      type: object
      additionalProperties: false
      required:
        - id
        - type
        - version
      properties:
        id:
          type: string
          examples:
            - agent_011CZkYqphY8vELVzwCUpqiQ
        type:
          type: string
          enum:
            - agent
          examples:
            - agent
        version:
          type: integer
          format: int32
          examples:
            - 1
      example:
        type: agent
        id: agent_011CZkYqphY8vELVzwCUpqiQ
        version: 1
    BetaManagedAgentsDeploymentInitialEvent:
      description: >-
        在会话创建后立即向其发送的事件。支持 `user.message`、`user.define_outcome` 和
        `system.message`。
      type: object
      discriminator:
        propertyName: type
        mapping:
          user.message:
            $ref: '#/components/schemas/BetaManagedAgentsDeploymentUserMessageEvent'
          user.define_outcome:
            $ref: >-
              #/components/schemas/BetaManagedAgentsDeploymentUserDefineOutcomeEvent
          system.message:
            $ref: '#/components/schemas/BetaManagedAgentsDeploymentSystemMessageEvent'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsDeploymentUserMessageEvent'
        - $ref: >-
            #/components/schemas/BetaManagedAgentsDeploymentUserDefineOutcomeEvent
        - $ref: '#/components/schemas/BetaManagedAgentsDeploymentSystemMessageEvent'
    BetaManagedAgentsSessionResourceConfig:
      description: 已配置的会话资源。回显输入内容，但不包含只写凭据。
      type: object
      discriminator:
        propertyName: type
        mapping:
          github_repository:
            $ref: >-
              #/components/schemas/BetaManagedAgentsGitHubRepositoryResourceConfig
          file:
            $ref: '#/components/schemas/BetaManagedAgentsFileResourceConfig'
          memory_store:
            $ref: '#/components/schemas/BetaManagedAgentsMemoryStoreResourceConfig'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsGitHubRepositoryResourceConfig'
        - $ref: '#/components/schemas/BetaManagedAgentsFileResourceConfig'
        - $ref: '#/components/schemas/BetaManagedAgentsMemoryStoreResourceConfig'
    BetaManagedAgentsSchedule:
      description: 带有计算所得运行时间戳的循环调度计划。可辨识联合 —— 目前仅支持 cron。
      type: object
      discriminator:
        propertyName: type
        mapping:
          cron:
            $ref: '#/components/schemas/BetaManagedAgentsCronSchedule'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsCronSchedule'
    BetaManagedAgentsDeploymentStatus:
      type: string
      description: 部署的生命周期状态。
      enum:
        - active
        - paused
    BetaManagedAgentsDeploymentPausedReason:
      description: 部署被暂停的原因。仅当 `status` 为 `paused` 时非空。
      type: object
      discriminator:
        propertyName: type
        mapping:
          manual:
            $ref: '#/components/schemas/BetaManagedAgentsManualDeploymentPausedReason'
          error:
            $ref: '#/components/schemas/BetaManagedAgentsErrorDeploymentPausedReason'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsManualDeploymentPausedReason'
        - $ref: '#/components/schemas/BetaManagedAgentsErrorDeploymentPausedReason'
    BetaManagedAgentsBudget:
      description: 对会话强制执行的消费上限。按 `type` 区分；`limit` 是目前唯一支持的类型。
      type: object
      discriminator:
        propertyName: type
        mapping:
          limit:
            $ref: '#/components/schemas/BetaManagedAgentsBudgetLimit'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsBudgetLimit'
    BetaTimestamp:
      description: RFC 3339 格式的时间戳
      type: string
      format: date-time
    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
    BetaManagedAgentsDeploymentUserMessageEvent:
      description: 发送到会话的用户消息。
      type: object
      additionalProperties: false
      required:
        - type
        - content
      properties:
        type:
          type: string
          enum:
            - user.message
        content:
          description: 用户消息的内容块数组。
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsUserContentBlock'
    BetaManagedAgentsDeploymentUserDefineOutcomeEvent:
      description: 智能体应努力达成的结果。智能体在收到后即开始工作。
      type: object
      additionalProperties: false
      required:
        - type
        - description
        - rubric
      properties:
        type:
          type: string
          enum:
            - user.define_outcome
        description:
          description: 智能体应产出的内容。这是任务说明。
          type: string
        rubric:
          description: 如何评估结果。文本或文件引用。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsRubric'
        max_iterations:
          description: 放弃前的评估→修订循环次数。默认为 3，最大为 20。
          type: integer
          format: int32
          nullable: true
    BetaManagedAgentsDeploymentSystemMessageEvent:
      description: '适用于随附轮次及所有后续轮次的特权上下文，以 `role: "system"` 轮次的形式追加到会话的系统上下文中，而不是替换顶层系统提示词。'
      type: object
      additionalProperties: false
      required:
        - type
        - content
      properties:
        type:
          type: string
          enum:
            - system.message
        content:
          description: 要追加的系统内容块。仅限文本。
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsSystemContentBlock'
    BetaManagedAgentsGitHubRepositoryResourceConfig:
      description: 挂载到每个会话容器中的 GitHub 仓库。授权令牌为只写，不会被返回。
      type: object
      additionalProperties: false
      required:
        - type
        - url
      properties:
        type:
          type: string
          enum:
            - github_repository
        url:
          description: GitHub 仓库地址
          type: string
        mount_path:
          description: 容器内的挂载路径。默认为 `/workspace/<repo-name>`。
          type: string
          nullable: true
        checkout:
          description: 要检出的分支或提交。默认为仓库的默认分支。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsRepositoryCheckout'
          nullable: true
    BetaManagedAgentsFileResourceConfig:
      description: 挂载到每个会话容器中的文件。
      type: object
      additionalProperties: false
      required:
        - type
        - file_id
      properties:
        type:
          type: string
          enum:
            - file
        file_id:
          description: 先前上传文件的 ID。
          type: string
        mount_path:
          description: 容器内的挂载路径。默认为 `/mnt/session/uploads/<file_id>`。
          type: string
          nullable: true
    BetaManagedAgentsMemoryStoreResourceConfig:
      description: 附加到从此部署创建的每个会话的记忆存储。
      type: object
      additionalProperties: false
      required:
        - type
        - memory_store_id
      properties:
        type:
          type: string
          enum:
            - memory_store
        memory_store_id:
          description: 记忆存储 ID（memstore_...）。必须属于调用方所在的组织和工作区。
          type: string
        access:
          description: 已挂载存储的访问模式。默认为 read_write。read_only 会将该存储挂载为只读文件系统。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsMountMode'
          nullable: true
        instructions:
          description: 每次挂载时为智能体提供的使用此存储的指引。将渲染到系统提示词的记忆部分。最多 4096 个字符。
          type: string
          nullable: true
    BetaManagedAgentsCronSchedule:
      description: 带有计算出的运行时时间戳的 5 字段 POSIX cron 调度。
      type: object
      additionalProperties: false
      required:
        - type
        - expression
        - timezone
      properties:
        type:
          type: string
          enum:
            - cron
          examples:
            - cron
        expression:
          description: >-
            5 字段 POSIX cron 表达式：分钟小时日月星期几（例如 "0 9 * * 1-5" 表示工作日上午 9 点）。星期几取值
            0-7，其中 0 和 7 均表示星期日。不支持扩展 cron 语法（秒或年字段，以及特殊字符
            L、W、#、?），也不支持预定义快捷方式（@daily）。
          type: string
          minLength: 1
          maxLength: 256
          examples:
            - 0 9 * * 1-5
        timezone:
          description: IANA 时区标识符（例如 "America/Los_Angeles"、"UTC"）。
          type: string
          minLength: 1
          examples:
            - America/Los_Angeles
        last_run_at:
          description: 最近一次计划运行实际开始的时间。在一次计划运行完成之前为 null；部署被归档后仍会保留。手动运行不会更新该值。
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
          examples:
            - '2026-03-16T16:00:09Z'
        upcoming_runs_at:
          description: >-
            未来 cron 触发时刻，最多 5 个。对于 active 和 paused
            状态的部署为非空（反映计划恢复后调度的行为）；部署归档后（`archived_at`
            已设置）为空。每次触发都会附加一个小的按调度抖动偏移，因此实际运行会在所列时刻或稍后开始。
          type: array
          items:
            $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - - '2026-03-17T16:00:00Z'
              - '2026-03-18T16:00:00Z'
      example:
        type: cron
        expression: 0 9 * * 1-5
        timezone: America/Los_Angeles
        last_run_at: '2026-03-16T16:00:09Z'
        upcoming_runs_at:
          - '2026-03-17T16:00:00Z'
          - '2026-03-18T16:00:00Z'
    BetaManagedAgentsManualDeploymentPausedReason:
      description: 调用方在该部署上调用了暂停端点。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - manual
    BetaManagedAgentsErrorDeploymentPausedReason:
      description: 一次定时触发记录了一次失败的运行，其错误导致部署自动暂停。
      type: object
      additionalProperties: false
      required:
        - type
        - error
      properties:
        type:
          type: string
          enum:
            - error
        error:
          description: 失败运行的错误。
          allOf:
            - $ref: >-
                #/components/schemas/BetaManagedAgentsDeploymentPausedReasonError
    BetaManagedAgentsBudgetLimit:
      description: 硬性支出上限。一旦跟踪到的列表价成本达到 `max_list_cost`，会话便停止发起新的模型请求。
      type: object
      additionalProperties: false
      required:
        - type
        - max_list_cost
      properties:
        type:
          type: string
          enum:
            - limit
        max_list_cost:
          description: 会话可累计的最高标价费用。无论是否存在协商折扣，均按标价计算，因此该上限会在实际费用达到之时或之前触发。
          allOf:
            - $ref: '#/components/schemas/BetaMonetaryAmount'
    BetaManagedAgentsUserContentBlock:
      description: 用户消息中的内容块。可以是 `text`、`image` 或 `document`。
      type: object
      discriminator:
        propertyName: type
        mapping:
          text:
            $ref: '#/components/schemas/BetaManagedAgentsTextBlock'
          image:
            $ref: '#/components/schemas/BetaManagedAgentsImageBlock'
          document:
            $ref: '#/components/schemas/BetaManagedAgentsDocumentBlock'
          redacted:
            $ref: '#/components/schemas/BetaManagedAgentsRedactedBlock'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsTextBlock'
        - $ref: '#/components/schemas/BetaManagedAgentsImageBlock'
        - $ref: '#/components/schemas/BetaManagedAgentsDocumentBlock'
        - $ref: '#/components/schemas/BetaManagedAgentsRedactedBlock'
    BetaManagedAgentsRubric:
      description: 用于评估结果质量的评分标准。
      discriminator:
        propertyName: type
        mapping:
          file:
            $ref: '#/components/schemas/BetaManagedAgentsFileRubric'
          text:
            $ref: '#/components/schemas/BetaManagedAgentsTextRubric'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsFileRubric'
        - $ref: '#/components/schemas/BetaManagedAgentsTextRubric'
    BetaManagedAgentsSystemContentBlock:
      description: 对话中途的 system 消息中的内容块。仅支持文本。
      type: object
      discriminator:
        propertyName: type
        mapping:
          text:
            $ref: '#/components/schemas/BetaManagedAgentsTextBlock'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsTextBlock'
    BetaManagedAgentsRepositoryCheckout:
      type: object
      discriminator:
        propertyName: type
        mapping:
          branch:
            $ref: '#/components/schemas/BetaManagedAgentsBranchCheckout'
          commit:
            $ref: '#/components/schemas/BetaManagedAgentsCommitCheckout'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsBranchCheckout'
        - $ref: '#/components/schemas/BetaManagedAgentsCommitCheckout'
    BetaManagedAgentsMountMode:
      type: string
      description: 已附加记忆存储的访问模式。
      enum:
        - read_write
        - read_only
    BetaManagedAgentsDeploymentPausedReasonError:
      description: 触发自动暂停的错误。与失败运行的 `error.type` 一致。
      type: object
      discriminator:
        propertyName: type
        mapping:
          environment_archived_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError
          agent_archived_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsAgentArchivedDeploymentPausedReasonError
          environment_not_found_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError
          vault_not_found_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError
          file_not_found_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsFileNotFoundDeploymentPausedReasonError
          session_resource_not_found_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError
          workspace_archived_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError
          organization_disabled_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError
          memory_store_archived_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError
          skill_not_found_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsSkillNotFoundDeploymentPausedReasonError
          vault_archived_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsVaultArchivedDeploymentPausedReasonError
          unknown_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsUnknownDeploymentPausedReasonError
          self_hosted_resources_unsupported_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError
          mcp_egress_blocked_error:
            $ref: >-
              #/components/schemas/BetaManagedAgentsMcpEgressBlockedDeploymentPausedReasonError
      oneOf:
        - $ref: >-
            #/components/schemas/BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsAgentArchivedDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsFileNotFoundDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsSkillNotFoundDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsVaultArchivedDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsUnknownDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError
        - $ref: >-
            #/components/schemas/BetaManagedAgentsMcpEgressBlockedDeploymentPausedReasonError
    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'
    BetaManagedAgentsTextBlock:
      description: 普通文本内容。
      type: object
      additionalProperties: false
      required:
        - type
        - text
      properties:
        type:
          type: string
          enum:
            - text
          examples:
            - text
        text:
          description: 文本内容。
          type: string
          minLength: 1
          examples:
            - '我的订单 #1234 到哪里了？'
      example:
        type: text
        text: '我的订单 #1234 到哪里了？'
    BetaManagedAgentsImageBlock:
      description: 直接以 base64 数据指定，或通过 URL 引用指定的图片内容。
      type: object
      additionalProperties: false
      required:
        - type
        - source
      properties:
        type:
          type: string
          enum:
            - image
        source:
          description: 图像数据的来源。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsImageSource'
    BetaManagedAgentsDocumentBlock:
      description: 文档内容，可直接指定为 base64 数据、文本，或通过 URL 引用。
      type: object
      additionalProperties: false
      required:
        - type
        - source
      properties:
        type:
          type: string
          enum:
            - document
        source:
          description: 文档数据的来源。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsDocumentSource'
        title:
          description: 文档的标题。
          type: string
          nullable: true
        context:
          description: 为模型提供的有关该文档的附加上下文。
          type: string
          nullable: true
    BetaManagedAgentsRedactedBlock:
      description: 被 OMA 模型策略屏蔽的内容的占位符。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - redacted
    BetaManagedAgentsFileRubric:
      description: 通过文件 API 上传的文件所引用的评分标准。
      type: object
      additionalProperties: false
      required:
        - type
        - file_id
      properties:
        type:
          type: string
          enum:
            - file
        file_id:
          description: rubric 文件的 ID。
          type: string
    BetaManagedAgentsTextRubric:
      description: 以文本形式内联提供的评分标准内容。
      type: object
      additionalProperties: false
      required:
        - type
        - content
      properties:
        type:
          type: string
          enum:
            - text
        content:
          description: 评分标准内容。纯文本或 markdown — 评分器将其视为自由格式文本。
          type: string
    BetaManagedAgentsBranchCheckout:
      type: object
      additionalProperties: false
      required:
        - type
        - name
      properties:
        type:
          type: string
          enum:
            - branch
          examples:
            - branch
        name:
          description: 要检出的分支名称。
          type: string
          minLength: 1
          maxLength: 255
          examples:
            - main
      example:
        type: branch
        name: main
    BetaManagedAgentsCommitCheckout:
      type: object
      additionalProperties: false
      required:
        - type
        - sha
      properties:
        type:
          type: string
          enum:
            - commit
        sha:
          description: 要检出的完整提交 SHA。
          type: string
          minLength: 7
          maxLength: 64
    BetaManagedAgentsEnvironmentArchivedDeploymentPausedReasonError:
      description: 该部署的环境已归档。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - environment_archived_error
    BetaManagedAgentsAgentArchivedDeploymentPausedReasonError:
      description: 该部署的智能体已被归档。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - agent_archived_error
    BetaManagedAgentsEnvironmentNotFoundDeploymentPausedReasonError:
      description: 该部署的环境已不存在。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - environment_not_found_error
    BetaManagedAgentsVaultNotFoundDeploymentPausedReasonError:
      description: 部署所引用的密钥库已不存在。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - vault_not_found_error
    BetaManagedAgentsFileNotFoundDeploymentPausedReasonError:
      description: 部署引用的某个文件资源已不存在。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - file_not_found_error
    BetaManagedAgentsSessionResourceNotFoundDeploymentPausedReasonError:
      description: 某个被引用的资源已不存在，且未报告其类型。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - session_resource_not_found_error
    BetaManagedAgentsWorkspaceArchivedDeploymentPausedReasonError:
      description: 该部署的工作区已归档。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - workspace_archived_error
    BetaManagedAgentsOrganizationDisabledDeploymentPausedReasonError:
      description: 该部署的组织已被禁用。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - organization_disabled_error
    BetaManagedAgentsMemoryStoreArchivedDeploymentPausedReasonError:
      description: 部署所引用的记忆存储已被归档。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - memory_store_archived_error
    BetaManagedAgentsSkillNotFoundDeploymentPausedReasonError:
      description: 部署的智能体引用的某个技能已不存在。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - skill_not_found_error
    BetaManagedAgentsVaultArchivedDeploymentPausedReasonError:
      description: 该部署引用的一个密钥库已被归档。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - vault_archived_error
    BetaManagedAgentsUnknownDeploymentPausedReasonError:
      description: 无法识别的错误自动暂停了部署。这是兜底变体；匹配 `error.type` 为 `unknown_error` 的运行。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - unknown_error
    BetaManagedAgentsSelfHostedResourcesUnsupportedDeploymentPausedReasonError:
      description: 该部署配置了资源，但其环境为自托管，无法挂载这些资源。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - self_hosted_resources_unsupported_error
    BetaManagedAgentsMcpEgressBlockedDeploymentPausedReasonError:
      description: 该部署的智能体所使用的某个 MCP 服务器主机被环境的网络策略阻止。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - mcp_egress_blocked_error
    BetaCurrency:
      type: string
      enum:
        - USD
    BetaManagedAgentsImageSource:
      description: 图片来源变体的联合类型。
      type: object
      discriminator:
        propertyName: type
        mapping:
          base64:
            $ref: '#/components/schemas/BetaManagedAgentsBase64ImageSource'
          url:
            $ref: '#/components/schemas/BetaManagedAgentsURLImageSource'
          file:
            $ref: '#/components/schemas/BetaManagedAgentsFileImageSource'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsBase64ImageSource'
        - $ref: '#/components/schemas/BetaManagedAgentsURLImageSource'
        - $ref: '#/components/schemas/BetaManagedAgentsFileImageSource'
    BetaManagedAgentsDocumentSource:
      description: 文档来源变体的联合类型。
      type: object
      discriminator:
        propertyName: type
        mapping:
          base64:
            $ref: '#/components/schemas/BetaManagedAgentsBase64DocumentSource'
          text:
            $ref: '#/components/schemas/BetaManagedAgentsPlainTextDocumentSource'
          url:
            $ref: '#/components/schemas/BetaManagedAgentsURLDocumentSource'
          file:
            $ref: '#/components/schemas/BetaManagedAgentsFileDocumentSource'
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsBase64DocumentSource'
        - $ref: '#/components/schemas/BetaManagedAgentsPlainTextDocumentSource'
        - $ref: '#/components/schemas/BetaManagedAgentsURLDocumentSource'
        - $ref: '#/components/schemas/BetaManagedAgentsFileDocumentSource'
    BetaManagedAgentsBase64ImageSource:
      description: Base64 编码的图像数据。
      type: object
      additionalProperties: false
      required:
        - type
        - media_type
        - data
      properties:
        type:
          type: string
          enum:
            - base64
        media_type:
          description: 图片的 MIME 类型（例如 "image/png"、"image/jpeg"、"image/gif"、"image/webp"）。
          type: string
          minLength: 1
        data:
          description: Base64 编码的图像数据。
          type: string
          minLength: 1
    BetaManagedAgentsURLImageSource:
      description: 通过 URL 引用的图片。
      type: object
      additionalProperties: false
      required:
        - type
        - url
      properties:
        type:
          type: string
          enum:
            - url
        url:
          description: 要获取的图像 URL。
          type: string
          minLength: 1
    BetaManagedAgentsFileImageSource:
      description: 通过文件 ID 引用的图像。
      type: object
      additionalProperties: false
      required:
        - type
        - file_id
      properties:
        type:
          type: string
          enum:
            - file
        file_id:
          description: 先前上传文件的 ID。
          type: string
          minLength: 1
    BetaManagedAgentsBase64DocumentSource:
      description: Base64 编码的文档数据。
      type: object
      additionalProperties: false
      required:
        - type
        - media_type
        - data
      properties:
        type:
          type: string
          enum:
            - base64
        media_type:
          description: 文档的 MIME 类型（例如 "application/pdf"）。
          type: string
          minLength: 1
        data:
          description: Base64 编码的文档数据。
          type: string
          minLength: 1
    BetaManagedAgentsPlainTextDocumentSource:
      description: 纯文本文档内容。
      type: object
      additionalProperties: false
      required:
        - type
        - media_type
        - data
      properties:
        type:
          type: string
          enum:
            - text
        media_type:
          description: 文本内容的 MIME 类型。必须为 "text/plain"。
          type: string
          enum:
            - text/plain
        data:
          description: 纯文本内容。
          type: string
          minLength: 1
    BetaManagedAgentsURLDocumentSource:
      description: 通过 URL 引用的文档。
      type: object
      additionalProperties: false
      required:
        - type
        - url
      properties:
        type:
          type: string
          enum:
            - url
        url:
          description: 要获取的文档 URL。
          type: string
          minLength: 1
    BetaManagedAgentsFileDocumentSource:
      description: 按文件 ID 引用的文档。
      type: object
      additionalProperties: false
      required:
        - type
        - file_id
      properties:
        type:
          type: string
          enum:
            - file
        file_id:
          description: 先前上传文件的 ID。
          type: string
          minLength: 1
  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 密钥。

````