顯示通道權杖
anthropic-beta: mcp-tunnels-2026-06-22. Learn how to send beta headers.Tunnels API 目前為研究預覽版。它需要 anthropic-beta: mcp-tunnels-2026-06-22 標頭,且可能在沒有棄用期的情況下變更。它取代了位於 /v1/organizations/tunnels 的 Admin API 端點,這些端點在遷移期間內仍可使用。
顯示通道的連接器權杖。每次呼叫時都會即時擷取該值;Anthropic 不會儲存它。在權杖輪替之前,重複呼叫會傳回相同的值。此端點以 POST 形式公開,以免權杖出現在中介存取記錄中。
Parameters
ID of the tunnel (tnl_...).
body BetaTunnelRevealTokenParams
Betas []AnthropicBeta OptionalHeader parameterThis endpoint is in beta: requests must send mcp-tunnels-2026-06-22 in this header.
This endpoint is in beta: requests must send mcp-tunnels-2026-06-22 in this header.
const AnthropicBetaMessageBatches2024_09_24 AnthropicBeta = "message-batches-2024-09-24"Deprecated
const AnthropicBetaPromptCaching2024_07_31 AnthropicBeta = "prompt-caching-2024-07-31"Deprecated
const AnthropicBetaPDFs2024_09_25 AnthropicBeta = "pdfs-2024-09-25"Deprecated
const AnthropicBetaTokenCounting2024_11_01 AnthropicBeta = "token-counting-2024-11-01"Deprecated
const AnthropicBetaTokenEfficientTools2025_02_19 AnthropicBeta = "token-efficient-tools-2025-02-19"Deprecated
const AnthropicBetaFilesAPI2025_04_14 AnthropicBeta = "files-api-2025-04-14"Deprecated
const AnthropicBetaExtendedCacheTTL2025_04_11 AnthropicBeta = "extended-cache-ttl-2025-04-11"Deprecated
const AnthropicBetaSkills2025_10_02 AnthropicBeta = "skills-2025-10-02"Deprecated
const AnthropicBetaCacheDiagnosis2026_04_07 AnthropicBeta = "cache-diagnosis-2026-04-07"Deprecated
const AnthropicBetaCEUserManagement2026_07_13 AnthropicBeta = "ce-user-management-2026-07-13"Deprecated
WorkspaceID param.Opt[string] OptionalHeader parameterOptional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).
Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).
Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.
Returns
type BetaTunnelToken struct { Type: "tunnel_token"; ID; TunnelToken }A tunnel's connector token.
A tunnel's connector token.
Stable identifier for the current token value. Changes when the token is rotated.
The connector token used to run the tunnel. Treat as a credential.
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go/v2"
"github.com/anthropics/anthropic-sdk-go/v2/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)
}{
"id": "id",
"tunnel_token": "tunnel_token",
"type": "tunnel_token"
}Returns Examples
{
"id": "id",
"tunnel_token": "tunnel_token",
"type": "tunnel_token"
}