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. Preferred first purchase is still prepaid Lightning top-up (POST /v1/topup, min 5000 sats) or /ai-credits. 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.
Build 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
Do not email wallet keys, bearer tokens, payment preimages, or customer data.