Loop Gateway · Developer example
Inspect the offer.
Then decide.
Check the live model catalog, published prices, and advertised Lightning minimum before connecting a wallet. Three public requests. No account or payment.
Run it locally
One file. No packages.
Requires Node.js 22 or later. Save the file, inspect its source, then run:
node gateway-discovery.mjs
To include the current input and output price for a specific model, append its ID from the live catalog:
node gateway-discovery.mjs MODEL_ID
The JSON report includes the observation time, source URLs, model count, advertised prepaid minimum, and optional model prices in sats per million tokens.
What it checks
A discoverable contract.
The example checks that discovery points to the expected API, each listed model has a published price, and the prepaid minimum is valid. It refuses redirects and makes only three fixed, unauthenticated GET requests.
A passing result verifies these public advertisements. It does not verify that a paid request will settle or deliver. Payment and delivery verification are separate integration steps.
Per-call L402 is advertised as available on live payment discovery. Paying the L402 challenge with the published BoltHub L402Client was verified on production on 2026-10-08 by Loop XXI's own wallet; lnget is not yet tested. Preferred first purchase is still prepaid Lightning top-up (POST https://api.loopxxi.com/v1/topup, min 5000 sats). A listed L402 URL is not proof that a paid request will settle.
The script creates no invoice, sends no inference request, reads no credentials, and never calls a wallet. Prices can change: fetch them again before any authorized purchase.
Checking a challenge you already received? Read it offline with the L402 challenge checker. It validates the macaroon, the invoice and the advertised amount without contacting anyone.
Ready to buy
Top up with Lightning.
Humans: open the purchase page, choose an amount (minimum 5000 sats), pay the invoice from your own Lightning wallet, and copy your key. Agents: follow the four-call quickstart.
Contract
OpenAPI 3.1.
Top-up, balance, chat completions and models, including the current 400, 401 and 402 response bodies. Each response is labeled with its evidence: checked against the live API without payment, observed once by hand, or documented from source.
Read the OpenAPI fileBuild with us
Bring one real workflow.
Building an agent that buys inference with Lightning? Tell us your client, expected request volume, and the integration step that is getting in the way. We are looking for useful developer feedback on discovery, budgets, and receipts.
Talk through an integration ↗Public sources
Payment discovery
Model catalog
Current prices
Purchase page
OpenAPI 3.1
Do not email wallet keys, bearer tokens, payment preimages, or customer data.