Skip to content

Example: L402-paywalled API endpoints for testing #21

Description

@joelklabo

Great work on the L402 tool support. I run a couple of live L402 endpoints that could be useful as integration examples or for testing the L402 flow:

Text Generation (21 sats/query)

# Step 1: Get invoice
curl -X POST https://maximumsats.com/api/dvm \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Explain the Lightning Network in one sentence"}'
# Returns 402 + Lightning invoice

# Step 2: Pay invoice, then retry with payment hash
curl -X POST https://maximumsats.com/api/dvm \
  -H "Content-Type: application/json" \
  -H "Authorization: L402 <payment_hash>" \
  -d '{"prompt": "Explain the Lightning Network in one sentence"}'

Image Generation (100 sats/image)

POST https://maximumsats.com/api/imagegen

Stats/Metadata

GET https://maximumsats.com/stats

Stack: Cloudflare Workers + LNbits + Groq (Llama 3.3 70B) / Workers AI (FLUX.1 Schnell). Standard L402 flow with Lightning invoices.

Happy to adapt the flow if there's a specific L402 format the MCP server expects, or help document the integration in the README.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions