Claude Platform Docs

轮换隧道令牌

$ ant beta:tunnels rotate-token
POST/v1/tunnels/{tunnel_id}/rotate_token

Tunnels API 目前处于研究预览阶段。它需要 anthropic-beta: mcp-tunnels-2026-06-22 请求头,并且可能在没有弃用期的情况下发生变更。它取代了位于 /v1/organizations/tunnels 的 Admin API 端点,这些端点在迁移窗口期内仍然可用。

轮换隧道的连接器令牌。轮换会使当前令牌对新连接失效,并返回一个新值;已建立的连接不会被切断。轮换后重启的连接器必须使用新值。

Parameters
--tunnel-id: string

Path param: Path parameter tunnel_id

--reason: optional string

Body param: Optional free-text reason for the rotation, recorded for audit.

maxLength1024
--beta: optional array of AnthropicBeta

Header param: Optional header to specify the beta version(s) you want to use.

Returns
beta_tunnel_token: object{ id, tunnel_token, type }

A tunnel's connector token.

id: string

Stable identifier for the current token value. Changes when the token is rotated.

tunnel_token: string

The connector token used to run the tunnel. Treat as a credential.

type: "tunnel_token"
轮换隧道令牌
ant beta:tunnels rotate-token \
  --api-key my-anthropic-api-key \
  --tunnel-id tunnel_id
Returns Examples
Response 200
{
  "id": "id",
  "tunnel_token": "tunnel_token",
  "type": "tunnel_token"
}