1. 🔄 Lifecycle
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
    • Check Region Switch Eligibility
      POST
    • Create or Reuse Region Switch Invoice
      POST
    • Claim Client-Held Region Switch Parameters
      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
    • ReferralHistory
    • ReferralCode
    • SubscriptionListItem
    • PublicKeyStatusResponse
    • BandwidthResetResponse
    • ApiError
    • ClaimResult
    • BandwidthResetPaymentStatus
    • RegionSwitchServer
    • RegionSwitchCheckResult
    • RenewalOrder
    • RegionSwitchInvoice
    • RegionSwitchClaimResult
    • RegionSwitchPaymentStatus
    • SyncResult
Tunnelsats Github
Tunnelsats Telegram
  1. 🔄 Lifecycle

Check Region Switch Eligibility

POST
https://tunnelsats.com/api/public/v1/subscription/migrate/check
Locate the current key across offered gateways (and test gateways only when enabled). serverId optionally selects the source gateway ID. Requires strictly more than 24 hours remaining. Returns shared 2/UTC-month quota and 72-hour/2000 MB grace rules. Eligible sources receive a durable ten-minute X25519 challenge. Quota-exhausted sources may also receive a challenge to recover an exact existing unpaid invoice; the challenge reserves no slot. Expired invoices release quota only after authoritative unpaid confirmation. Rate limit: 10 requests/min per IP (rolling window). Request bodies are limited to 8192 bytes.

Request

Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
Advisory eligibility, quota, and optional ownership challenge.
Headers

Bodyapplication/json

🟠400
🟠403
🟠404
🟠409
🟠413
🟠429
🔴500
🔴503
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://tunnelsats.com/api/public/v1/subscription/migrate/check' \
--header 'Content-Type: application/json' \
--data '{
    "wgPublicKey": "hSDwCYkwp1R0i33ctD73Wg2/Og0mOBr066SpjqqbTmo=",
    "serverId": "eu-de"
}'
Response Response Example
200 - Success Example
{
    "eligible": true,
    "reason": null,
    "currentServer": {
        "id": "eu-de",
        "domain": "de2.tunnelsats.com",
        "country": "Germany",
        "city": "Nuremberg",
        "flag": "🇩🇪"
    },
    "subscriptionEnd": "2027-03-01T12:34:56.000Z",
    "resetsThisMonth": 0,
    "maxResetsPerMonth": 2,
    "remainingSlots": 2,
    "grace": {
        "maxHours": 72,
        "additionalMb": 2000,
        "cappedAtSourceAllowance": true,
        "unlimited": false
    },
    "challengePubKey": "V4TFx8LMrIYdUKJeXVi7/H5CYHrWE1UlX6WTxD063wY=",
    "challengeWindow": 123,
    "challengeExpiresAt": "2026-11-02T12:10:00.000Z"
}
Modified at 2026-11-06 19:55:30
Previous
Request Bandwidth Top-Up ($1 Usage Reset)
Next
Create or Reuse Region Switch Invoice
Built with