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"
}