顯示通道權杖
POST/v1/tunnels/{tunnel_id}/reveal_token
Tunnels API 目前為研究預覽版。它需要 anthropic-beta: mcp-tunnels-2026-06-22 標頭,且可能在沒有棄用期的情況下變更。它取代了位於 /v1/organizations/tunnels 的 Admin API 端點,這些端點在遷移期間內仍可使用。
顯示通道的連接器權杖。每次呼叫時都會即時擷取該值;Anthropic 不會儲存它。在權杖輪替之前,重複呼叫會傳回相同的值。此端點以 POST 形式公開,以免權杖出現在中介存取記錄中。
Parameters
Returns
顯示通道權杖
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
betaTunnelToken, err := client.Beta.Tunnels.RevealToken(
context.TODO(),
"tunnel_id",
anthropic.BetaTunnelRevealTokenParams{},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", betaTunnelToken.ID)
}Response 200
{
"id": "id",
"tunnel_token": "tunnel_token",
"type": "tunnel_token"
}Returns Examples
Response 200
{
"id": "id",
"tunnel_token": "tunnel_token",
"type": "tunnel_token"
}