SPB Git

Repository Public

create.md 3.9 KB 181 lines markdown

1---2title: Create Tunnel3url: https://platform.claude.com/docs/en/api/beta/tunnels/create4---56# Create Tunnel78**POST** `/v1/tunnels`910The Tunnels API is in research preview. It requires the `anthropic-beta: mcp-tunnels-2026-06-22` header and may change without a deprecation period. It supersedes the Admin API endpoints at `/v1/organizations/tunnels`, which remain available during a migration window.1112Creates a tunnel. Creation allocates a fresh hostname and provisions the tunnel; it is not idempotent. The new tunnel rejects MCP traffic until at least one CA certificate is added.1314## Headers1516- `"anthropic-beta": optional array of AnthropicBeta`1718  Optional header to specify the beta version(s) you want to use.1920  - `string`2122  - `"message-batches-2024-09-24" or "prompt-caching-2024-07-31" or "computer-use-2024-10-22" or 43 more`2324    - `"message-batches-2024-09-24"`2526    - `"prompt-caching-2024-07-31"`2728    - `"computer-use-2024-10-22"`2930    - `"computer-use-2025-01-24"`3132    - `"pdfs-2024-09-25"`3334    - `"token-counting-2024-11-01"`3536    - `"token-efficient-tools-2025-02-19"`3738    - `"output-128k-2025-02-19"`3940    - `"files-api-2025-04-14"`4142    - `"mcp-client-2025-04-04"`4344    - `"mcp-client-2025-11-20"`4546    - `"dev-full-thinking-2025-05-14"`4748    - `"interleaved-thinking-2025-05-14"`4950    - `"code-execution-2025-05-22"`5152    - `"extended-cache-ttl-2025-04-11"`5354    - `"context-1m-2025-08-07"`5556    - `"context-management-2025-06-27"`5758    - `"model-context-window-exceeded-2025-08-26"`5960    - `"skills-2025-10-02"`6162    - `"fast-mode-2026-02-01"`6364    - `"output-300k-2026-03-24"`6566    - `"user-profiles-2026-03-24"`6768    - `"user-profiles-2026-08-18"`6970    - `"user-profiles-2026-09-04"`7172    - `"advisor-tool-2026-03-01"`7374    - `"managed-agents-2026-04-01"`7576    - `"cache-diagnosis-2026-04-07"`7778    - `"dreaming-2026-04-21"`7980    - `"thinking-token-count-2026-05-13"`8182    - `"server-side-fallback-2026-06-01"`8384    - `"server-side-fallback-2026-07-01"`8586    - `"fallback-credit-2026-06-01"`8788    - `"fallback-credit-2026-07-01"`8990    - `"agent-memory-2026-07-22"`9192    - `"mid-conversation-tool-changes-2026-07-01"`9394    - `"compact-2026-01-12"`9596    - `"computer-use-2025-11-24"`9798    - `"mcp-tunnels-2026-06-22"`99100    - `"structured-outputs-2025-11-13"`101102    - `"task-budgets-2026-03-13"`103104    - `"thinking-display-updates-2026-08-18"`105106    - `"ce-user-management-2026-07-13"`107108    - `"mid-conversation-output-config-2026-07-01"`109110    - `"thinking-binding-controls-2026-08-01"`111112    - `"mid-conversation-system-clear-at-2026-08-21"`113114    - `"compact-2026-09-04"`115116- `"anthropic-workspace-id": optional string`117118## Body parameters119120- `display_name: optional string or null`121122  Optional human-readable name for the tunnel (1-255 characters).123124  minLength: 1, maxLength: 255125126## Returns127128- `BetaTunnel object`129130  An MCP tunnel.131132  - `type: "tunnel"`133134  - `id: string`135136    Unique identifier for the tunnel, prefixed with `tnl_`.137138  - `archived_at: string or null`139140    A timestamp in RFC 3339 format141142    format: date-time143144  - `created_at: string`145146    A timestamp in RFC 3339 format147148    format: date-time149150  - `display_name: string or null`151152    Human-readable name for the tunnel (1-255 characters). Null if unset.153154  - `domain: string`155156    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.157158## Example159160```bash161curl https://api.anthropic.com/v1/tunnels \162    -H 'Content-Type: application/json' \163    -H 'anthropic-version: 2023-06-01' \164    -H 'anthropic-beta: mcp-tunnels-2026-06-22' \165    -H "X-Api-Key: $ANTHROPIC_API_KEY" \166    -d '{}'167```168169### Response (200)170171```json172{173  "id": "id",174  "archived_at": "2019-12-27T18:11:19.117Z",175  "created_at": "2019-12-27T18:11:19.117Z",176  "display_name": "display_name",177  "domain": "domain",178  "type": "tunnel"179}180```181
Files main
Menu

Theme