1. Cookbook
TunnelSats Public Wireguard API
  • Announcements
    • 👋 About our team
    • 💫 What is TunnelSats?
    • 🚀 Introducing the TunnelSats Public API v1
    • How TunnelSats Leverages Public APIs for Confined VPN Management
  • 📡 Discovery
    • List Available WireGuard Servers & Regions
      GET
  • ⚡ Purchase
    • Create a New WireGuard Subscription (Invoice Generation)
      POST
    • Check Invoice Status & Polling by Payment Hash
      GET
    • Claim WireGuard Configuration After Payment Settlement
      POST
  • 🔄 Lifecycle
    • Get Subscription & Bandwidth Status by WireGuard Public Key
      POST
    • Renew an Existing VPN Subscription (Anonymous)
      POST
    • Sync Subscription (Real-Time Server Refresh)
      POST
    • Request Bandwidth Top-Up ($1 for +100GB)
      POST
  • 🔑 Account
    • List Account Subscriptions (Authenticated)
      GET
  • 🔧 Tools
    • Lightning Node Network Address Discovery
      POST
    • Universal Connectivity & Latency Probe
      POST
  • Cookbook
    • 🛠️ Automation & Code Examples
    • 🐚 Bash One-Liners
    • 🚑 Node Health & Upkeep
    • ⚡ Bandwidth Top-Up ($1 for +100GB)
    • 🛡️ Security & Authentication
    • 🎁 Referral Program: Earn Bonus Months
    • 🛑 Error Codes & Troubleshooting
  • Schemas
    • Server
    • InvoiceOrder
    • SubscriptionStatus
    • NodeLookup
    • ConnectivityResult
    • ApiError
    • ClaimResult
    • BandwidthResetResponse
    • PublicKeyStatusResponse
    • RenewalOrder
    • SubscriptionListItem
    • SyncResult
Tunnelsats Github
Tunnelsats Telegram
  1. Cookbook

🐚 Bash One-Liners

For sysadmins who prefer the terminal, you can interact with TunnelSats using standard curl and jq.

1. Get a Lightning Invoice#

Generate a 1-month invoice for a specific region directly to your console.
Create Subscription

2. Check Payment Status#

Replace <payment_hash> with the hash returned from the previous step.
Check Status / Heal

3. Claim & Save Config (Dual-Key Support)#

Once paid, run this to save your WireGuard config. Note that we handle both .fullConfig and .config keys to ensure compatibility.
Claim Subscription

4. Check Bandwidth & Expiry by WireGuard Key#

Query real-time subscription status using your WireGuard public key (no auth needed).

5. Sync Subscription (Authenticated, Real-Time Refresh)#

Force a real-time data sync from the VPN server. Requires an API key.

6. List All Subscriptions (Snake Case Alert)#

When listing all subscriptions for an authenticated account, the API returns snake_case keys (e.g., payment_hash instead of paymentHash).

7. Auto-Renewal Cron Job#

Add this script to your crontab to check expiry and generate a new invoice if needed.

8. Bandwidth Top-Up ($1 for +100GB)#

For the full bandwidth reset workflow including threshold validation and payment settlement, see ⚡ Bandwidth Top-Up.
Modified at 2026-09-02 07:46:21
Previous
🛠️ Automation & Code Examples
Next
🚑 Node Health & Upkeep
Built with