> ## 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/vaults/{vault_id}/credentials
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/vaults/{vault_id}/credentials:
    get:
      summary: 列出凭据
      operationId: BetaListCredentials
      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: vault_id
          in: path
          required: true
          schema:
            type: string
          description: 密钥库标识符。
          example: vlt_011CZkZDLs7fYzm1hXNPeRjv
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            format: int32
          description: 每页返回的最大凭据数量。默认为 20，最大为 100。
        - name: page
          in: query
          required: false
          schema:
            type: string
          description: 来自上一个 `list_credentials` 响应的不透明分页令牌。
        - name: include_archived
          in: query
          required: false
          schema:
            type: boolean
          description: 是否在结果中包含已归档的凭证。
      responses:
        '200':
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BetaManagedAgentsListCredentialsResponse'
        '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:
    BetaManagedAgentsListCredentialsResponse:
      description: 包含凭证分页列表的响应。
      type: object
      additionalProperties: false
      properties:
        data:
          description: 凭证列表。
          type: array
          items:
            $ref: '#/components/schemas/BetaManagedAgentsCredential'
          examples:
            - - type: vault_credential
                id: vcrd_011CZkZEMt8gZan2iYOQfSkw
                vault_id: vlt_011CZkZDLs7fYzm1hXNPeRjv
                display_name: 示例凭证
                metadata:
                  environment: production
                created_at: '2026-03-15T10:00:00Z'
                updated_at: '2026-03-15T10:00:00Z'
                archived_at: null
                auth:
                  type: static_bearer
                  mcp_server_url: https://example-server.modelcontextprotocol.io/sse
        next_page:
          description: 下一页的分页令牌；没有更多结果时为 null。
          type: string
          nullable: true
          examples:
            - page_MjAyNS0wNS0xNFQwMDowMDowMFo=
      example:
        data:
          - type: vault_credential
            id: vcrd_011CZkZEMt8gZan2iYOQfSkw
            vault_id: vlt_011CZkZDLs7fYzm1hXNPeRjv
            display_name: 示例凭证
            metadata:
              environment: production
            created_at: '2026-03-15T10:00:00Z'
            updated_at: '2026-03-15T10:00:00Z'
            archived_at: null
            auth:
              type: static_bearer
              mcp_server_url: https://example-server.modelcontextprotocol.io/sse
        next_page: page_MjAyNS0wNS0xNFQwMDowMDowMFo=
    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
    BetaManagedAgentsCredential:
      description: 存储在密钥库中的凭据。敏感字段永远不会在响应中返回。
      type: object
      additionalProperties: false
      required:
        - type
        - id
        - vault_id
        - metadata
        - created_at
        - updated_at
        - archived_at
        - auth
      properties:
        type:
          type: string
          enum:
            - vault_credential
          examples:
            - vault_credential
        id:
          description: 凭据的唯一标识符。
          type: string
          examples:
            - vcrd_011CZkZEMt8gZan2iYOQfSkw
        vault_id:
          description: 该 credential 所属密钥库的标识符。
          type: string
          examples:
            - vlt_011CZkZDLs7fYzm1hXNPeRjv
        display_name:
          description: 凭据的人类可读名称。
          type: string
          nullable: true
          examples:
            - 示例凭证
        metadata:
          description: 附加到该凭证的任意键值元数据。
          type: object
          additionalProperties:
            type: string
          examples:
            - environment: production
        created_at:
          $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:00:00Z'
        updated_at:
          $ref: '#/components/schemas/BetaTimestamp'
          examples:
            - '2026-03-15T10:00:00Z'
        archived_at:
          description: 凭证的归档时间。未归档时为 null。
          allOf:
            - $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
          examples:
            - null
        auth:
          description: 此 credential 的认证配置。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsCredentialAuth'
          examples:
            - type: static_bearer
              mcp_server_url: https://example-server.modelcontextprotocol.io/sse
      example:
        type: vault_credential
        id: vcrd_011CZkZEMt8gZan2iYOQfSkw
        vault_id: vlt_011CZkZDLs7fYzm1hXNPeRjv
        display_name: 示例凭证
        metadata:
          environment: production
        created_at: '2026-03-15T10:00:00Z'
        updated_at: '2026-03-15T10:00:00Z'
        archived_at: null
        auth:
          type: static_bearer
          mcp_server_url: https://example-server.modelcontextprotocol.io/sse
    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
    BetaTimestamp:
      description: RFC 3339 格式的时间戳
      type: string
      format: date-time
    BetaManagedAgentsCredentialAuth:
      description: 凭据的认证详情。
      type: object
      discriminator:
        propertyName: type
        mapping:
          mcp_oauth:
            $ref: '#/components/schemas/BetaManagedAgentsMcpOauthAuthResponse'
          static_bearer:
            $ref: '#/components/schemas/BetaManagedAgentsStaticBearerAuthResponse'
          environment_variable:
            $ref: >-
              #/components/schemas/BetaManagedAgentsEnvironmentVariableAuthResponse
      oneOf:
        - $ref: '#/components/schemas/BetaManagedAgentsMcpOauthAuthResponse'
        - $ref: '#/components/schemas/BetaManagedAgentsStaticBearerAuthResponse'
        - $ref: >-
            #/components/schemas/BetaManagedAgentsEnvironmentVariableAuthResponse
      example:
        type: static_bearer
        mcp_server_url: https://example-server.modelcontextprotocol.io/sse
    BetaManagedAgentsMcpOauthAuthResponse:
      description: MCP 服务器的 OAuth 凭据详情。
      type: object
      additionalProperties: false
      required:
        - type
        - mcp_server_url
      properties:
        type:
          type: string
          enum:
            - mcp_oauth
        mcp_server_url:
          description: 此凭据用于认证的 MCP 服务器的 URL。
          type: string
        expires_at:
          $ref: '#/components/schemas/BetaTimestamp'
          nullable: true
        refresh:
          description: 刷新令牌配置（如果凭据支持令牌刷新）。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsMcpOauthRefreshResponse'
          nullable: true
    BetaManagedAgentsStaticBearerAuthResponse:
      description: MCP 服务器的静态 bearer 令牌凭证详情。
      type: object
      additionalProperties: false
      required:
        - type
        - mcp_server_url
      properties:
        type:
          type: string
          enum:
            - static_bearer
          examples:
            - static_bearer
        mcp_server_url:
          description: 此凭据用于认证的 MCP 服务器的 URL。
          type: string
          examples:
            - https://example-server.modelcontextprotocol.io/sse
      example:
        type: static_bearer
        mcp_server_url: https://example-server.modelcontextprotocol.io/sse
    BetaManagedAgentsEnvironmentVariableAuthResponse:
      description: 环境变量凭据详情。机密值永远不会返回。
      type: object
      additionalProperties: false
      required:
        - type
        - secret_name
        - networking
        - injection_location
      properties:
        type:
          type: string
          enum:
            - environment_variable
        secret_name:
          description: 环境变量的名称。
          type: string
        networking:
          description: 机密值在其上被替换的出站主机。
          allOf:
            - $ref: >-
                #/components/schemas/BetaManagedAgentsCredentialNetworkingResponse
        injection_location:
          description: 密钥值在出站请求中被替换的位置。
          allOf:
            - $ref: '#/components/schemas/BetaManagedAgentsInjectionLocationResponse'
    BetaManagedAgentsMcpOauthRefreshResponse:
      description: 凭据响应中返回的 OAuth 刷新令牌配置。
      type: object
      additionalProperties: false
      required:
        - token_endpoint
        - client_id
        - token_endpoint_auth
      properties:
        token_endpoint:
          description: 用于刷新访问令牌的令牌端点 URL。
          type: string
        client_id:
          description: OAuth 客户端 ID。
          type: string
        resource:
          description: OAuth 资源指示符。
          type: string
          nullable: true
        scope:
          description: 刷新请求的 OAuth 作用域。
          type: string
          nullable: true
        token_endpoint_auth:
          type: object
          discriminator:
            propertyName: type
            mapping:
              none:
                $ref: >-
                  #/components/schemas/BetaManagedAgentsTokenEndpointAuthNoneResponse
              client_secret_basic:
                $ref: >-
                  #/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicResponse
              client_secret_post:
                $ref: >-
                  #/components/schemas/BetaManagedAgentsTokenEndpointAuthPostResponse
          oneOf:
            - $ref: >-
                #/components/schemas/BetaManagedAgentsTokenEndpointAuthNoneResponse
            - $ref: >-
                #/components/schemas/BetaManagedAgentsTokenEndpointAuthBasicResponse
            - $ref: >-
                #/components/schemas/BetaManagedAgentsTokenEndpointAuthPostResponse
    BetaManagedAgentsCredentialNetworkingResponse:
      type: object
      discriminator:
        propertyName: type
        mapping:
          unrestricted:
            $ref: >-
              #/components/schemas/BetaManagedAgentsUnrestrictedCredentialNetworkingResponse
          limited:
            $ref: >-
              #/components/schemas/BetaManagedAgentsLimitedCredentialNetworkingResponse
      oneOf:
        - $ref: >-
            #/components/schemas/BetaManagedAgentsUnrestrictedCredentialNetworkingResponse
        - $ref: >-
            #/components/schemas/BetaManagedAgentsLimitedCredentialNetworkingResponse
    BetaManagedAgentsInjectionLocationResponse:
      description: 密钥值在出站请求中被替换的位置。
      type: object
      additionalProperties: false
      required:
        - header
        - body
      properties:
        header:
          description: 占位符是否在请求头值中被替换。
          type: boolean
        body:
          description: 占位符是否在请求体中被替换。
          type: boolean
    BetaManagedAgentsTokenEndpointAuthNoneResponse:
      description: 令牌端点无需客户端认证。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - none
    BetaManagedAgentsTokenEndpointAuthBasicResponse:
      description: 令牌端点使用客户端凭据进行 HTTP Basic 认证。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - client_secret_basic
    BetaManagedAgentsTokenEndpointAuthPostResponse:
      description: 令牌端点使用客户端凭据进行 POST 请求体认证。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - client_secret_post
    BetaManagedAgentsUnrestrictedCredentialNetworkingResponse:
      description: 在会话的环境网络策略允许出站访问的任何主机上，该密钥都会被替换。
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - unrestricted
    BetaManagedAgentsLimitedCredentialNetworkingResponse:
      description: 该密钥仅在请求所列出的主机时被替换。
      type: object
      additionalProperties: false
      required:
        - type
        - allowed_hosts
      properties:
        type:
          type: string
          enum:
            - limited
        allowed_hosts:
          description: 将替换该密钥的主机名。条目与请求主机精确匹配；带 `*.` 前缀的条目匹配指定域名的任何子域名，但不匹配该域名本身。
          type: array
          items:
            type: string
  securitySchemes:
    omaApiKey:
      type: apiKey
      in: header
      name: X-Api-Key
      description: OMA 工作区 API 密钥。
      x-default: sk-ant-local-default
    omaBearer:
      type: http
      scheme: bearer
      description: 以 Bearer 令牌形式发送的 OMA 工作区 API 密钥。

````