Claude Platform Docs

Buat Tunnel

$client->beta->tunnels->create(?string displayName, ?list<AnthropicBeta> betas, ?string workspaceID): BetaTunnel
POST/v1/tunnels

Tunnels API sedang dalam pratinjau riset. API ini memerlukan header anthropic-beta: mcp-tunnels-2026-06-22 dan dapat berubah tanpa periode penghentian. API ini menggantikan endpoint Admin API di /v1/organizations/tunnels, yang tetap tersedia selama jendela migrasi.

Membuat tunnel. Pembuatan mengalokasikan hostname baru dan menyediakan tunnel; operasi ini tidak idempoten. Tunnel baru menolak lalu lintas MCP hingga setidaknya satu sertifikat CA ditambahkan.

Parameters
displayName?:optional string

Optional human-readable name for the tunnel (1-255 characters).

betas?:optional list<AnthropicBeta>

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

workspaceID?:optional string
Returns
class BetaTunnel { $type = 'tunnel'; $id; $archivedAt; /* 3 more */ }
"tunnel" type
string id

Unique identifier for the tunnel, prefixed with tnl_.

?\Datetime archivedAt

A timestamp in RFC 3339 format

\Datetime createdAt

A timestamp in RFC 3339 format

?string displayName

Human-readable name for the tunnel (1-255 characters). Null if unset.

string domain

Anthropic-assigned hostname for the tunnel. MCP server URLs whose host is a subdomain of this value are routed through the tunnel. Globally unique and never reused, even after the tunnel is archived.

Buat Tunnel
<?php

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

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

$betaTunnel = $client->beta->tunnels->create(
  displayName: 'x',
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
  workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy',
);

var_dump($betaTunnel);
Returns Examples
Response 200
{
  "id": "id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "created_at": "2019-12-27T18:11:19.117Z",
  "display_name": "display_name",
  "domain": "domain",
  "type": "tunnel"
}