{"openapi":"3.1.0","info":{"title":"NanProxy API","version":"1.0.0","description":"Buy private HTTPS/SOCKS5 and MTProto proxies with crypto (XNO, BTC, USDT, USDC, NANUSD and more). No account needed. Flow: GET /catalog -> GET /price -> POST /buy -> pay payinAmount of payinCurrency to payinAddress (or open paymentLink) -> poll GET /order with the returned token until status is active -> read proxies. Use POST /extend with the same token to renew before expiresAt."},"servers":[{"url":"https://api.nanproxy.com"}],"components":{"securitySchemes":{"orderToken":{"type":"http","scheme":"bearer","description":"The token returned once by POST /buy. Keep it: it is the only way to access the proxies and extend them."}},"schemas":{"Product":{"type":"string","enum":["ipv6","ipv4","ipv4-shared","mtproto"],"description":"ipv6: individual IPv6 (only IPv6-enabled sites). ipv4: individual IPv4 (all sites). ipv4-shared: IPv4 shared by up to 3 users. mtproto: Telegram only."},"Period":{"type":"integer","enum":[3,7,14,30,60,90],"description":"Rental duration in days. 3 days is only available for ipv6; see products[].periods in GET /catalog."},"Payment":{"type":"object","properties":{"kind":{"type":"string","enum":["buy","extend"]},"status":{"type":"string","enum":["waiting","paid","fulfilling","fulfilled","fulfill-error","failed"]},"periodDays":{"type":"integer"},"priceUsd":{"type":"number"},"paymentLink":{"type":"string","description":"Nanswap Pay checkout page"},"payinCurrency":{"type":"string","description":"Ticker to send. Missing if not chosen yet (pick it on paymentLink)."},"payinAddress":{"type":"string","description":"Address to send payinAmount of payinCurrency to"},"payinAmount":{"type":"number"},"expireAt":{"type":"string","format":"date-time"},"depositDetectedAt":{"type":"string","format":"date-time","description":"Set as soon as the deposit is seen on-chain (feeless coins), before delivery"}}},"Order":{"type":"object","properties":{"orderId":{"type":"string"},"status":{"type":"string","enum":["awaiting-payment","active","expired","cancelled","error"]},"product":{"$ref":"#/components/schemas/Product"},"country":{"type":"string"},"type":{"type":"string","enum":["http","socks","mtproto"]},"count":{"type":"integer"},"periodDays":{"type":"integer"},"expiresAt":{"type":"string","format":"date-time"},"proxies":{"type":"array","items":{"type":"object","properties":{"host":{"type":"string","description":"Connect to host:port"},"port":{"type":"string"},"user":{"type":"string"},"pass":{"type":"string"},"ip":{"type":"string","description":"Exit IP"},"type":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"}}}},"payments":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}}}},"Error":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/catalog":{"get":{"summary":"List products, countries with stock, periods, prices and featured payment currencies","description":"Refreshed every 5 minutes. products[].stock maps ISO2 country -> available proxies. products[].unitPricesUsd maps period (days) -> price of one proxy. Order total = max(minOrderUsd, ceil(unitPricesUsd[period] * count, priceDecimals)). payinCurrencies lists featured coins with name, image and minUsd (minimum order total to pay with that coin; null = feeless, no minimum). /buy and /extend return 400 when the order is below minUsd.","responses":{"200":{"description":"Catalog"}}}},"/countries":{"get":{"summary":"List ISO2 country codes available for a product","parameters":[{"name":"product","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Product"}}],"responses":{"200":{"description":"{ product, countries: string[] }"}}}},"/price":{"get":{"summary":"Get the USD price for a product, count and period (and stock if country is given)","parameters":[{"name":"product","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Product"}},{"name":"period","in":"query","required":true,"schema":{"$ref":"#/components/schemas/Period"}},{"name":"count","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":1}},{"name":"country","in":"query","schema":{"type":"string","example":"us"}}],"responses":{"200":{"description":"{ product, count, periodDays, priceUsd, available? }"}}}},"/payin-currencies":{"get":{"summary":"Crypto tickers accepted as payinCurrency (e.g. XNO, BTC, USDT-TRX, USDC-BASE, NANUSD)","responses":{"200":{"description":"{ featured: [{ticker,name,image}], all: string[] }"}}}},"/buy":{"post":{"summary":"Create an order and a crypto invoice","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["product","country","period"],"properties":{"product":{"$ref":"#/components/schemas/Product"},"country":{"type":"string","example":"us"},"period":{"$ref":"#/components/schemas/Period"},"count":{"type":"integer","minimum":1,"maximum":100,"default":1},"type":{"type":"string","enum":["http","socks","mtproto"],"description":"Protocol. Defaults to http (HTTPS), mtproto for the mtproto product."},"payinCurrency":{"type":"string","example":"XNO","description":"Ticker to pay with. If omitted, payinAddress is empty and the payer chooses on paymentLink."}}},"example":{"product":"ipv4","country":"us","period":7,"count":1,"type":"socks","payinCurrency":"XNO"}}}},"responses":{"201":{"description":"{ token, orderId, orderUrl, priceUsd, payment: Payment }. The token is shown only once."},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Not enough stock"}}}},"/order":{"get":{"summary":"Get order status, proxy credentials and expiry. Poll every ~10s while awaiting payment.","security":[{"orderToken":[]}],"responses":{"200":{"description":"Order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"401":{"description":"Invalid token"}}}},"/extend":{"post":{"summary":"Create an invoice to extend all proxies of an active order","security":[{"orderToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["period"],"properties":{"period":{"$ref":"#/components/schemas/Period"},"payinCurrency":{"type":"string","example":"XNO"}}}}}},"responses":{"201":{"description":"{ orderId, priceUsd, payment: Payment }"}}}},"/order/stream":{"get":{"summary":"Server-Sent Events stream of the order: one \"order\" event now, then one on every change (deposit detected, paid, delivered). Use instead of polling GET /order.","security":[{"orderToken":[]}],"responses":{"200":{"description":"text/event-stream; each event data is an Order (payments[].depositDetectedAt is set as soon as the deposit is seen)"},"401":{"description":"Invalid token"}}}}}}