Skip to content
Developers

Developers & agents

Connect to
Loop Gateway.

Public integration contract. Live paid use is still being tested.

Quickstart

Top up. Pay. Check. Chat.

Humans: open the purchase page, choose an amount (minimum 5000 sats), pay the invoice from your own Lightning wallet, and copy your key. No account needed.

Agents: follow the four calls. Check live rails first at agent-payments.json. Contract: OpenAPI 3.1. Per-call L402 is advertised, but paying it with stock clients is not yet tested; use prepaid.

  1. Top up. POST https://api.loopxxi.com/v1/topup with {"amount_sats":5000}. The response holds a loop_ token and a BOLT11 invoice.
  2. Pay. Pay that invoice from a Bitcoin Lightning wallet you control, after checking it against your budget.
  3. Check balance. GET https://api.loopxxi.com/v1/balance with Authorization: Bearer <token>. It returns HTTP 401 unknown_prepaid_token until the invoice settles.
  4. Chat. POST https://api.loopxxi.com/v1/chat/completions with the same header and OpenAI-compatible JSON, e.g. {"model":"openai/gpt-4o-mini","messages":[{"role":"user","content":"ping"}],"max_tokens":16}. Copy a current model id from /v1/models.

Check before paying.

Use available models, current usage prices and payment discovery. A healthy endpoint is not proof that an independent paid request will succeed.

Prepaid credit is usage credit, not custody of a customer wallet. Tokens are bearer credentials; keep them private and verify settlement before chat.

Machine documentation.

Per-call L402 is advertised, but paying the challenge with independent stock clients is not yet tested. Prepaid remains the preferred first purchase.