1. 📡 Discovery
TunnelSats Public Wireguard API
  • Announcements
    • 👋 About our team
    • 💫 What is TunnelSats?
    • 🚀 Introducing the TunnelSats Public API v1
    • 🧩 How the TunnelSats StartOS Package Uses the Public API
    • How TunnelSats Leverages Public APIs for Confined VPN Management
    • 🤖 Autonomous Agent Payments (L402 & x402) & Level 5 Agent-Native Architecture
  • 📡 Discovery
    • List Available WireGuard Servers & Regions
      GET
    • L402 Agent Payment Gateway Discovery Metadata
      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
    • Autonomous Agent HTTP 402 Gateway (L402 Purchase + Claim)
      POST
  • 🔄 Lifecycle
    • Get Subscription & Bandwidth Status by WireGuard Public Key
      POST
    • Sync Subscription (Real-Time Server Refresh)
      POST
    • Renew an Existing VPN Subscription (Anonymous)
      POST
    • Request Bandwidth Top-Up ($1 Usage Reset)
      POST
  • 🔑 Account
    • List Account Subscriptions (Authenticated)
      GET
    • Create Referral Code
      POST
    • Get Referral Code
      GET
    • Referral History
      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 Usage Reset)
    • 🛡️ Security & Authentication
    • 🎁 Referral Program: Earn Bonus Months
    • 🛑 Error Codes & Troubleshooting
    • 🤖 Agent Payments: L402 & x402 Protocol
  • Schemas
    • Server
    • InvoiceOrder
    • SubscriptionStatus
    • NodeLookup
    • ConnectivityResult
    • ApiError
    • ClaimResult
    • BandwidthResetResponse
    • PublicKeyStatusResponse
    • SubscriptionListItem
    • ReferralCode
    • ReferralHistory
    • BandwidthResetPaymentStatus
    • RenewalOrder
    • SyncResult
Tunnelsats Github
Tunnelsats Telegram
  1. 📡 Discovery

L402 Agent Payment Gateway Discovery Metadata

GET
https://tunnelsats.com/api/v1
Safe read-only discovery endpoint describing the POST /api/v1 L402 purchase and redemption flow and linking /openapi.json. Does not emit a fake WWW-Authenticate: L402 challenge or placeholder BOLT11 invoice. Rate limit: 60 requests/min per IP.

Request

Header Params

Responses

🟢200OK
application/json
L402 Agent Payment Gateway discovery metadata and step-by-step instructions
Bodyapplication/json

🟠429Too Many Requests
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://tunnelsats.com/api/v1' \
--header 'Accept: application/json'
Response Response Example
200 - Discovery Metadata (200 OK)
{
  "service": "TunnelSats L402 & x402 Agent Payment Gateway",
  "protocol": "L402",
  "endpoint": "https://tunnelsats.com/api/v1",
  "method": "POST",
  "openapiUrl": "https://tunnelsats.com/openapi.json",
  "instructions": {
    "step1": "POST /api/v1 with JSON body { serverId, duration, wgPublicKey } to receive an HTTP 402 L402 challenge (live BOLT11 invoice + binary V2 macaroon).",
    "step2": "Pay the BOLT11 Lightning invoice and obtain the 32-byte payment preimage (64-char hex).",
    "step3": "Replay POST /api/v1 with header Authorization: L402 <macaroon>:<preimage> (and matching wgPublicKey) to claim your WireGuard tunnel."
  }
}
Modified at 2026-10-16 18:50:40
Previous
List Available WireGuard Servers & Regions
Next
Create a New WireGuard Subscription (Invoice Generation)
Built with