Skip to main content
Cloudflare tunnels expose your local container via Cloudflare. Use them when you need stable public URLs or when your infra already uses Cloudflare.

Modes

  • Quick tunnels: ephemeral URLs, no Cloudflare API key
  • Managed tunnels: stable subdomains, requires API key

Quick tunnels

Ephemeral URLs via Cloudflare’s public service.
from synth_ai.core.tunnels import SynthTunnel, TunnelBackend

tunnel = await SynthTunnel.create(
    local_port=8001,
    backend=TunnelBackend.CloudflareQuickTunnel,
)
print(tunnel.url)

Managed tunnels

Stable subdomains that persist across sessions.
tunnel = await SynthTunnel.create(
    local_port=8001,
    backend=TunnelBackend.CloudflareManagedLease,
    api_key="sk_live_...",
)

Auth

Use the container API key:
job = OfflineJob.from_dict(
    config,
    container_url=tunnel.url,
    container_api_key=env_api_key,
)

CLI strict

cloudflared tunnel --config /dev/null --url http://127.0.0.1:8001

Non-SDK usage (Go, TypeScript, other)

If you are not using the Python SDK, you can still expose a local container by running cloudflared directly and passing the resulting public URL to your job config (SDK, CLI, or API).

Go

Start your Go container locally, then tunnel it:
go run ./cmd/taskapp
cloudflared tunnel --config /dev/null --url http://127.0.0.1:8001

TypeScript

Start your TS container locally, then tunnel it:
pnpm dev  # or npm run dev
cloudflared tunnel --config /dev/null --url http://127.0.0.1:8001

Other runtimes

As long as your container is reachable on localhost:<port>, you can tunnel it the same way and use the public URL in your job configuration.

Install cloudflared

brew install cloudflared