English ← MyDocs

隧道证书

创建隧道证书

post /v1/organizations/tunnels/{tunnel_id}/certificates

为隧道注册公共 CA 证书。

Anthropic 在终止内部 TLS 会话时,会根据此 CA 验证网关的服务器证书。PEM 内容必须恰好包含一个 X.509 证书,且不包含私钥材料。一个隧道最多可持有两个未归档的证书。

路径参数

  • tunnel_id: string

    隧道的 ID。

请求头参数

  • "anthropic-beta": array of "mcp-tunnels-2026-05-19"

    所有隧道端点都需要此参数。

    • "mcp-tunnels-2026-05-19"

请求体参数

  • ca_certificate_pem: string

    PEM 编码的 X.509 CA 证书。必须恰好包含一个证书,且不包含私钥材料。

返回值

  • id: string

    隧道证书的 ID。

  • archived_at: string

    RFC 3339 日期时间字符串,表示证书被归档的时间,如果未归档则为 null

  • created_at: string

    RFC 3339 日期时间字符串,表示证书的注册时间。

  • expires_at: string

    RFC 3339 日期时间字符串,表示证书的过期时间,如果不过期则为 null

  • fingerprint: string

    证书的 SHA-256 指纹,以小写十六进制字符串表示。

  • tunnel_id: string

    该证书注册所属隧道的 ID。

  • type: "tunnel_certificate"

    对象类型。隧道证书始终为 tunnel_certificate

    • "tunnel_certificate"

示例

curl https://api.anthropic.com/v1/organizations/tunnels/$TUNNEL_ID/certificates \
    -H 'Content-Type: application/json' \
    -H 'anthropic-version: 2023-06-01' \
    -H "Authorization: Bearer $ANTHROPIC_WIF_BEARER_TOKEN" \
    -d '{
          "ca_certificate_pem": "-----BEGIN CERTIFICATE-----\\nMIIBexampleEXAMPLEexampleEXAMPLEexampleEXAMPLEexampleEXAMPLEexa\\n...illustrative placeholder, not a real certificate...\\n-----END CERTIFICATE-----\\n"
        }'

响应

{
  "id": "tcrt_01JmWq4ZxnBvR7tKpY2sLdH9",
  "archived_at": "2024-11-01T23:59:27.427722Z",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "expires_at": "2024-10-30T23:58:27.427722Z",
  "fingerprint": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
  "tunnel_id": "tnl_01Hx9Kp2RtQvMn3sWbYdLcF8",
  "type": "tunnel_certificate"
}

获取隧道证书

get /v1/organizations/tunnels/{tunnel_id}/certificates/{certificate_id}

根据 ID 检索隧道上注册的单个证书。

路径参数

  • tunnel_id: string

    隧道的 ID。

  • certificate_id: string

    隧道证书的 ID。

请求头参数

  • "anthropic-beta": array of "mcp-tunnels-2026-05-19"

    所有隧道端点都需要此参数。

    • "mcp-tunnels-2026-05-19"

返回值

  • id: string

    隧道证书的 ID。

  • archived_at: string

    RFC 3339 日期时间字符串,表示证书被归档的时间,如果未归档则为 null

  • created_at: string

    RFC 3339 日期时间字符串,表示证书的注册时间。

  • expires_at: string

    RFC 3339 日期时间字符串,表示证书的过期时间,如果不过期则为 null

  • fingerprint: string

    证书的 SHA-256 指纹,以小写十六进制字符串表示。

  • tunnel_id: string

    该证书注册所属隧道的 ID。

  • type: "tunnel_certificate"

    对象类型。隧道证书始终为 tunnel_certificate

    • "tunnel_certificate"

示例

curl https://api.anthropic.com/v1/organizations/tunnels/$TUNNEL_ID/certificates/$CERTIFICATE_ID \
    -H 'anthropic-version: 2023-06-01' \
    -H "Authorization: Bearer $ANTHROPIC_WIF_BEARER_TOKEN"

响应

{
  "id": "tcrt_01JmWq4ZxnBvR7tKpY2sLdH9",
  "archived_at": "2024-11-01T23:59:27.427722Z",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "expires_at": "2024-10-30T23:58:27.427722Z",
  "fingerprint": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
  "tunnel_id": "tnl_01Hx9Kp2RtQvMn3sWbYdLcF8",
  "type": "tunnel_certificate"
}

列出隧道证书

get /v1/organizations/tunnels/{tunnel_id}/certificates

列出隧道上注册的证书。

除非设置 include_archived,否则已归档的证书将被排除。

路径参数

  • tunnel_id: string

    隧道的 ID。

查询参数

  • include_archived: optional boolean

    在结果中包含已归档的证书。默认情况下排除已归档的证书。

  • limit: optional number

    返回的最大证书数量。

  • page: optional string

    一个隧道最多有两个活跃证书,因此此列表不分页。

请求头参数

  • "anthropic-beta": array of "mcp-tunnels-2026-05-19"

    所有隧道端点都需要此参数。

    • "mcp-tunnels-2026-05-19"

返回值

  • data: array of object { id, archived_at, created_at, 4 more }

    • id: string

      隧道证书的 ID。

    • archived_at: string

      RFC 3339 日期时间字符串,表示证书被归档的时间,如果未归档则为 null

    • created_at: string

      RFC 3339 日期时间字符串,表示证书的注册时间。

    • expires_at: string

      RFC 3339 日期时间字符串,表示证书的过期时间,如果不过期则为 null

    • fingerprint: string

      证书的 SHA-256 指纹,以小写十六进制字符串表示。

    • tunnel_id: string

      该证书注册所属隧道的 ID。

    • type: "tunnel_certificate"

      对象类型。隧道证书始终为 tunnel_certificate

      • "tunnel_certificate"
  • next_page: string

    下一页的不透明游标,如果没有更多结果则为 null

示例

curl https://api.anthropic.com/v1/organizations/tunnels/$TUNNEL_ID/certificates \
    -H 'anthropic-version: 2023-06-01' \
    -H "Authorization: Bearer $ANTHROPIC_WIF_BEARER_TOKEN"

响应

{
  "data": [
    {
      "id": "tcrt_01JmWq4ZxnBvR7tKpY2sLdH9",
      "archived_at": "2024-11-01T23:59:27.427722Z",
      "created_at": "2024-10-30T23:58:27.427722Z",
      "expires_at": "2024-10-30T23:58:27.427722Z",
      "fingerprint": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "tunnel_id": "tnl_01Hx9Kp2RtQvMn3sWbYdLcF8",
      "type": "tunnel_certificate"
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}

归档隧道证书

post /v1/organizations/tunnels/{tunnel_id}/certificates/{certificate_id}/archive

归档证书,将其从 Anthropic 为该隧道信任的证书集合中移除。

证书记录将被保留。允许归档最后一个未归档的证书;在添加新证书之前,隧道将拒绝 MCP 流量。

路径参数

  • tunnel_id: string

    隧道的 ID。

  • certificate_id: string

    隧道证书的 ID。

请求头参数

  • "anthropic-beta": array of "mcp-tunnels-2026-05-19"

    所有隧道端点都需要此参数。

    • "mcp-tunnels-2026-05-19"

返回值

  • id: string

    隧道证书的 ID。

  • archived_at: string

    RFC 3339 日期时间字符串,表示证书被归档的时间,如果未归档则为 null

  • created_at: string

    RFC 3339 日期时间字符串,表示证书的注册时间。

  • expires_at: string

    RFC 3339 日期时间字符串,表示证书的过期时间,如果不过期则为 null

  • fingerprint: string

    证书的 SHA-256 指纹,以小写十六进制字符串表示。

  • tunnel_id: string

    该证书注册所属隧道的 ID。

  • type: "tunnel_certificate"

    对象类型。隧道证书始终为 tunnel_certificate

    • "tunnel_certificate"

示例

curl https://api.anthropic.com/v1/organizations/tunnels/$TUNNEL_ID/certificates/$CERTIFICATE_ID/archive \
    -X POST \
    -H 'anthropic-version: 2023-06-01' \
    -H "Authorization: Bearer $ANTHROPIC_WIF_BEARER_TOKEN"

响应

{
  "id": "tcrt_01JmWq4ZxnBvR7tKpY2sLdH9",
  "archived_at": "2024-11-01T23:59:27.427722Z",
  "created_at": "2024-10-30T23:58:27.427722Z",
  "expires_at": "2024-10-30T23:58:27.427722Z",
  "fingerprint": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
  "tunnel_id": "tnl_01Hx9Kp2RtQvMn3sWbYdLcF8",
  "type": "tunnel_certificate"
}

领域类型

隧道证书创建响应

  • TunnelCertificateCreateResponse object { id, archived_at, created_at, 4 more }

    • id: string

      隧道证书的 ID。

    • archived_at: string

      RFC 3339 日期时间字符串,表示证书被归档的时间,如果未归档则为 null

    • created_at: string

      RFC 3339 日期时间字符串,表示证书的注册时间。

    • expires_at: string

      RFC 3339 日期时间字符串,表示证书的过期时间,如果不过期则为 null

    • fingerprint: string

      证书的 SHA-256 指纹,以小写十六进制字符串表示。

    • tunnel_id: string

      该证书注册所属隧道的 ID。

    • type: "tunnel_certificate"

      对象类型。隧道证书始终为 tunnel_certificate

      • "tunnel_certificate"

隧道证书检索响应

  • TunnelCertificateRetrieveResponse object { id, archived_at, created_at, 4 more }

    • id: string

      隧道证书的 ID。

    • archived_at: string

      RFC 3339 日期时间字符串,表示证书被归档的时间,如果未归档则为 null

    • created_at: string

      RFC 3339 日期时间字符串,表示证书的注册时间。

    • expires_at: string

      RFC 3339 日期时间字符串,表示证书的过期时间,如果不过期则为 null

    • fingerprint: string

      证书的 SHA-256 指纹,以小写十六进制字符串表示。

    • tunnel_id: string

      该证书注册所属隧道的 ID。

    • type: "tunnel_certificate"

      对象类型。隧道证书始终为 tunnel_certificate

      • "tunnel_certificate"

隧道证书列表响应

  • TunnelCertificateListResponse object { data, next_page }

    • data: array of object { id, archived_at, created_at, 4 more }

      • id: string

        隧道证书的 ID。

      • archived_at: string

        RFC 3339 日期时间字符串,表示证书被归档的时间,如果未归档则为 null

      • created_at: string

        RFC 3339 日期时间字符串,表示证书的注册时间。

      • expires_at: string

        RFC 3339 日期时间字符串,表示证书的过期时间,如果不过期则为 null

      • fingerprint: string

        证书的 SHA-256 指纹,以小写十六进制字符串表示。

      • tunnel_id: string

        该证书注册所属隧道的 ID。

      • type: "tunnel_certificate"

        对象类型。隧道证书始终为 tunnel_certificate

        • "tunnel_certificate"
    • next_page: string

      下一页的不透明游标,如果没有更多结果则为 null

隧道证书归档响应

  • TunnelCertificateArchiveResponse object { id, archived_at, created_at, 4 more }

    • id: string

      隧道证书的 ID。

    • archived_at: string

      RFC 3339 日期时间字符串,表示证书被归档的时间,如果未归档则为 null

    • created_at: string

      RFC 3339 日期时间字符串,表示证书的注册时间。

    • expires_at: string

      RFC 3339 日期时间字符串,表示证书的过期时间,如果不过期则为 null

    • fingerprint: string

      证书的 SHA-256 指纹,以小写十六进制字符串表示。

    • tunnel_id: string

      该证书注册所属隧道的 ID。

    • type: "tunnel_certificate"

      对象类型。隧道证书始终为 tunnel_certificate

      • "tunnel_certificate"