{"agent_procedure":[{"method":"GET","name":"discover","note":"Read recommended_payment, start_here, and payment_discovery. Treat payment_discovery.l402.available as the only L402 availability signal. Curl-only helper: https://api.loopxxi.com/examples/agent-buy.sh","step":1,"url":"https://api.loopxxi.com/.well-known/agent-payments.json"},{"body":{"amount_sats":5000},"example":"https://api.loopxxi.com/examples/topup.json","method":"POST","min_amount_sats":5000,"name":"topup","note":"Preferred prepaid path. Response includes token (loop_…) and invoice (BOLT11). Optional external_id is opaque attribution, not KYC.","step":2,"url":"https://api.loopxxi.com/v1/topup"},{"name":"pay","note":"Pay only the returned BOLT11 from your own wallet after checking it against your budget. This document does not pay. Unpaid tokens return HTTP 401 on balance and chat.","step":3},{"method":"GET","name":"balance","note":"Authorization: Bearer \u003ctoken\u003e. Confirm available credit after settlement. The response includes spend_policy when a cap is set.","step":4,"url":"https://api.loopxxi.com/v1/balance"},{"body":{"max_tokens":16,"messages":[{"content":"ping","role":"user"}],"model":"openai/gpt-4o-mini"},"example":"https://api.loopxxi.com/examples/chat-ping.json","method":"POST","name":"chat","note":"Same prepaid bearer token. Copy a current model id from GET /v1/models if this example id is absent.","step":5,"url":"https://api.loopxxi.com/v1/chat/completions"}],"api_base":"https://api.loopxxi.com/v1","balance":"https://api.loopxxi.com/v1/balance","chat_completions":"https://api.loopxxi.com/v1/chat/completions","clients":{"agent_buy_sh":{"kind":"script","note":"curl-only prepaid procedure (discover → topup → pay → balance → chat). Default command is discover and pays nothing. Does not embed a wallet.","path":"examples/agent-buy.sh","url":"https://api.loopxxi.com/examples/agent-buy.sh"},"bolthub":{"client":"L402Client","kind":"sdk","note":"BoltHub L402Client / @bolthub/pay. Same L402 rail as lnget. Check available before paying.","source":"https://docs.bolthub.ai/docs/sdks/pay"},"lnget":{"kind":"cli","note":"Lightning Labs lnget. L402 HTTP client. Read payment_discovery.l402.available before paying. Preferred first purchase is still prepaid POST /v1/topup.","source":"https://github.com/lightninglabs/lightning-agent-tools"},"loop_buy":{"first":"loop-buy first","install":"https://api.loopxxi.com/install/loop-buy.sh","kind":"cli","note":"Stock Loop Gateway buyer. One-command install from the public URL (curl; no private-repo clone). Prepaid first. Does not embed a wallet. first walks topup → wait for settlement → paid chat → receipt and does not pay the invoice.","path":"cmd/loop-buy"}},"documentation":"https://api.loopxxi.com/llms.txt","examples":{"agent_buy":"https://api.loopxxi.com/examples/agent-buy.sh","chat_ping":"https://api.loopxxi.com/examples/chat-ping.json","topup":"https://api.loopxxi.com/examples/topup.json"},"install":"https://api.loopxxi.com/install/loop-buy.sh","models":"https://api.loopxxi.com/v1/models","notice":"Start with POST /v1/topup (prepaid Lightning). Check current rail availability before paying. A listed discovery URL or configured pack is not proof that checkout or settlement is enabled. Credit buys API usage, not company ownership or treasury exposure. Unauthenticated chat completions return HTTP 402 L402; read payment.min_sats and payment_discovery.l402.min_amount_sats before paying a one-off invoice.","operator":"Loop XXI LLC","payment_discovery":{"l402":{"available":true,"method":"POST","min_amount_sats":1,"note":"Pay-per-request L402 for lnget / BoltHub L402Client. Challenge amount is the estimated request cost (minimum 1 sat). Unauthenticated POST /v1/chat/completions returns HTTP 402 with WWW-Authenticate: L402 macaroon=\"...\", invoice=\"...\". Preferred first purchase is still prepaid POST /v1/topup.","preferred":false,"url":"https://api.loopxxi.com/v1/chat/completions"},"lightning":{"method":"POST","min_amount_sats":5000,"note":"POST /v1/topup with {\"amount_sats\":5000}. Optional opaque external_id is persisted for caller bookkeeping (not KYC). Preferred prepaid Lightning path.","preferred":true,"url":"https://api.loopxxi.com/v1/topup"},"spend_policy":{"method":"PUT","note":"Optional per-request auto_approve_sats on a prepaid loop_ token. Daily budgets are not enforced yet. GET /v1/receipts lists settled inference usage, not Lightning invoices.","url":"https://api.loopxxi.com/v1/spend-policy"},"stripe":{"method":"GET","url":"https://api.loopxxi.com/v1/credits/packs"},"x402":{"method":"GET","url":"https://api.loopxxi.com/v1/x402/payment-required"}},"pricing":"https://api.loopxxi.com/v1/pricing","purchase":"https://gateway.loopxxi.com/buy","receipts":"https://api.loopxxi.com/v1/receipts","recommended_payment":"lightning_prepaid","schema_version":1,"service":"Loop Gateway","skill":"https://api.loopxxi.com/skills/loop-gateway/SKILL.md","start_here":[{"body":{"amount_sats":5000},"example":"https://api.loopxxi.com/examples/topup.json","method":"POST","min_amount_sats":5000,"note":"Prepaid Lightning credit. Preferred agent purchase path. Response includes a bearer token and a BOLT11 invoice. Pay that invoice from your own wallet before GET /v1/balance. Optional external_id is opaque attribution for the caller's books, not identity.","step":1,"url":"https://api.loopxxi.com/v1/topup"},{"method":"GET","note":"Authorization: Bearer \u003ctoken\u003e. Confirm credit after the invoice settles. Pending invoices and unknown loop_* tokens return HTTP 401 code=unknown_prepaid_token and do not create an account. The response includes spend_policy when a cap is set.","step":2,"url":"https://api.loopxxi.com/v1/balance"},{"body":{"auto_approve_sats":50},"method":"PUT","note":"Optional. Cap each prepaid request. Over-cap calls return HTTP 402 type=human_above code=budget_exceeded and do not deduct. GET /v1/receipts lists settled inference usage (not Lightning invoices) for this token.","step":3,"url":"https://api.loopxxi.com/v1/spend-policy"},{"body":{"max_tokens":16,"messages":[{"content":"ping","role":"user"}],"model":"openai/gpt-4o-mini"},"example":"https://api.loopxxi.com/examples/chat-ping.json","method":"POST","note":"Same prepaid bearer token. Copy a current model id from GET /v1/models if this example id is absent.","step":4,"url":"https://api.loopxxi.com/v1/chat/completions"}]}