Releases

Why I Built an Open Source Tunnel with Pay-as-you-go Pricing

The tunneling space is broken — fixed monthly tiers, vendor lock-in, and pricing that doesn't match how developers actually work. Here's why rustunnel does it differently.

João Henrique··5 min read

Every tunnel tool I've used has the same pricing problem. You pay a fixed monthly fee for a tier, and either you're overpaying for usage you don't have, or you're constantly bumping against limits that force you to upgrade.

ngrok charges $8/month for their basic plan and $20/month for Pay as you Go plan. Cloudflare Tunnel is free but ties you to their ecosystem. Localtunnel is unmaintained. None of them feel right for how developers actually work — you spin up a tunnel when you need it, use it for a while, and then stop.

I wanted something different. So I built rustunnel with a pricing model that matches real usage: $3/month minimum, $0.10 per GB after that. Here's why.

The Problem with Fixed Tiers

Most tunnel services structure pricing around feature gates. Want custom subdomains? That's the $20 tier. Want more tunnels? Upgrade. Want API access? Different plan entirely.

This creates two bad outcomes:

  • Overpaying — you're paying $20/month for features you use twice a week
  • Underpaying — you're on the free tier but constantly hitting limits, making the tool unreliable

Neither is good. Developers end up frustrated either way.

Bandwidth is the Only Fair Meter

When I thought about what actually costs money to run a tunnel service, the answer is simple: bandwidth. Every byte proxied through the server has a real infrastructure cost. Connections, tunnels, and subdomains are essentially free to provision.

So I metered the only thing that matters: bytes proxied. The billing is transparent — $0.10 per GB, tracked in the tunnel_log table, summed up at the end of each billing period.

COALESCE(SUM(tunnel_log.bytes_proxied), 0)::bigint AS bytes_proxied

No per-request charges. No per-tunnel fees. No games.

The $3 Floor Covers 30 GB

The pay-as-you-go plan has a $3/month minimum. That's not a fee — it's a floor that covers your first 30 GB of bandwidth ($3 / $0.10 per GB). Most developers doing webhook testing, local development, and CI/CD tunneling will stay well under that.

If you proxy 50 GB in a month, your bill is $5. Not $35. Not $8 plus an overage you didn't expect. Five dollars.

The math is simple: max($3, actual_usage × $0.10). If you use less than 30 GB, you pay $3. If you use more, you pay for what you actually used.

Spend Caps Put Users in Control

One thing I've always hated about metered billing is the fear of a surprise bill. What if something goes wrong — a loop, a misconfigured CI pipeline, a traffic spike — and you wake up to a $200 charge?

rustunnel has a spend cap. You set a dollar amount — say $50/month — and when your estimated usage hits that ceiling, your tunnels are automatically suspended. Not charged beyond it. Suspended. You can raise or remove the cap anytime from the dashboard.

# Set a $50/month cap via the dashboard
# Or programmatically via the API
PATCH /billing/spend-cap
{ "spend_cap_cents": 5000 }

This runs as a daily job at 04:00 UTC. For every PAYG user with a cap, it checks estimated month-to-date usage and suspends tokens if the threshold is crossed. Tokens are automatically unsuspended at the start of the next billing period.

Open Source is the Default, Not the Upsell

Every feature in rustunnel is open source under AGPL. The self-hosted option is free forever — unlimited tunnels, custom subdomains, TLS termination, the full client binary. No feature is gated behind a proprietary license.

The managed service at rustunnel.com exists for convenience. Some people don't want to manage a VPS, deal with Let's Encrypt, or maintain their own server. That's fine — they can use the hosted service and pay for bandwidth. But the self-hosted path is always there, always free, always fully functional.

The three-tier model reflects this philosophy:

HobbyPay-as-you-goSelf-host
Price$0$3/mo + $0.10/GBFree
Tunnels2UnlimitedUnlimited
Custom subdomainsYesYes
TLSYesYesYes
Source codeOpen (AGPL)Open (AGPL)Open (AGPL)

Stripe, but Simple

Payments are handled by Stripe — subscriptions, invoices, the customer portal for managing cards. But the integration is deliberately minimal:

  • One recurring price for the $3/month base fee
  • One metered price for bandwidth overage ($0.10/GB)
  • An invoice.created webhook that adds overage line items when usage exceeds 30 GB
  • A customer portal so users manage their own payment methods

No complex proration logic. No mid-cycle plan changes. No confusion.

What's Next

The current model works well for individual developers and small teams. But I'm already thinking about what comes next:

  • Per-team billing — organizations with multiple developers sharing a tunnel infrastructure
  • Committed use discounts — predictable high-volume users who commit to a minimum monthly bandwidth get a lower per-GB rate
  • x402 USDC micropayments — for AI agents and automated workflows that need to provision tunnels programmatically, a crypto payment rail avoids traditional payment friction

These are all extensions of the same principle: price based on what you use, not what you might use.

Try It

If you're tired of overpaying for tunnel services or hitting arbitrary limits on free tiers, give rustunnel a shot. The Hobby plan is free, the self-hosted option is free forever, and the pay-as-you-go plan starts at $3/month.

brew tap joaoh82/rustunnel
brew install rustunnel
rustunnel setup
rustunnel http 3000

Your tunnel is live in under a minute.