Claude Platform Docs

顯示通道權杖

$client->beta->tunnels->revealToken(string tunnelID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaTunnelToken
POST/v1/tunnels/{tunnel_id}/reveal_token

Tunnels API 目前為研究預覽版。它需要 anthropic-beta: mcp-tunnels-2026-06-22 標頭,且可能在沒有棄用期的情況下變更。它取代了位於 /v1/organizations/tunnels 的 Admin API 端點,這些端點在遷移期間內仍可使用。

顯示通道的連接器權杖。每次呼叫時都會即時擷取該值;Anthropic 不會儲存它。在權杖輪替之前,重複呼叫會傳回相同的值。此端點以 POST 形式公開,以免權杖出現在中介存取記錄中。

Parameters
tunnelID: string
betas?:optional list<AnthropicBeta>

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

workspaceID?:optional string
Returns
class BetaTunnelToken { $type = 'tunnel_token'; $id; $tunnelToken; }
"tunnel_token" type
string id

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

string tunnelToken

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

顯示通道權杖
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

$client = new Client(apiKey: 'my-anthropic-api-key');

$betaTunnelToken = $client->beta->tunnels->revealToken(
  'tunnel_id',
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
  workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy',
);

var_dump($betaTunnelToken);
Returns Examples
Response 200
{
  "id": "id",
  "tunnel_token": "tunnel_token",
  "type": "tunnel_token"
}