--daemon runs a tunnel or webhook endpoint as a detached background process that survives closing the terminal. Pricing is the same as in the foreground: 1 credit per hour, and never more than $3 per rolling 30 days. The --ttl flag is a safety auto-stop, not a price.
npx otterkit tunnel <port> --daemon [--ttl <duration>]
npx otterkit webhook --daemon [--ttl <duration>]| Flag | Meaning | Default |
|---|---|---|
--daemon | Detach and keep running after the terminal closes | off |
--ttl <duration> | Auto-stop after e.g. 45m, 4h, 3d, or "never" | 24h |
--json | Print the result as one JSON object (needs --daemon) | off |
# Background tunnel, auto-stops after 24h (the default)
npx otterkit tunnel 3000 --daemon
# Auto-stop after 4 hours
npx otterkit tunnel 8080 --daemon --ttl 4h
# Always-on webhook endpoint until you stop it
npx otterkit webhook --daemon --subdomain stripe-dev --ttl neverJSON output#
With --json, the command prints the session details and exits, which suits agents and scripts:
{
"mode": "tunnel",
"subdomain": "tunnel-a1b2c3d4",
"publicUrl": "https://tunnel-a1b2c3d4.otterkit.app",
"target": "127.0.0.1:3000",
"pid": 51423,
"ttl": "24h",
"expiresAt": "2026-10-03T09:00:00.000Z",
"capture": true,
"auth": false
}Lifecycle#
A daemon tunnel ends when its process exits, because nothing else can serve it. A daemon webhook endpoint is answered by OtterKit's servers, so it stays live until its TTL runs out or you stop it, even if the local process dies. otterkit stop kills the process and also shuts down the endpoint on the server, which stops billing. See Status & Stop.