Independent by design · no pay-to-rank placements  · How we evaluate tools →
Anclum Submit
C

cnghockey/sats4ai-l402-examples

L402 client examples for Sats4AI — pay-per-use AI phone calls, voice in 602 languages, translation, fax, and…

Before you install: no copy-paste command · license MIT · link reachable

First step: pip install requests

View on GitHub ↗Link checked 2026-11-14 · HTTP 200 · opens the vendor's own site
Install & config
Client config (built from the install command this repo gives)
{
  "mcpServers": {
    "cnghockey-sats4ai-l402-examples": {
      "command": "npx",
      "args": ["@hey-api/openapi-ts"]
    }
  }
}

Parsed from the README we fetched on 2026-11-13; we have not executed it.

command/args come from the install command the repository states. When it is ambiguous, the project README wins.
VS Code (.vscode/mcp.json - the key is servers)
{
  "servers": {
    "cnghockey-sats4ai-l402-examples": {
      "command": "npx",
      "args": ["@hey-api/openapi-ts"]
    }
  }
}
Same server, but VS Code keeps it under <code>servers</code>.
Claude Code (command line)
claude mcp add --transport stdio cnghockey-sats4ai-l402-examples -- npx @hey-api/openapi-ts
Claude Code does not read a config file; add the server with this command.
Key names differ by client: Clients & CLI
Star count
0 ★ · cnghockey/sats4ai-l402-examples · read from the GitHub search API · (checked 2026-11-13 20:00:50)
Source
read directly from its GitHub page · type: open-source project
Harvest history
first seen 2026-11-14 · last seen 2026-11-14 · seen 1× · listed by 1 sources
Score
score 103 · 1 sources · repo
Install
npx @hey-api/openapi-ts
FAQ (answers come from our records)
How do I install it?
The repository provides this install command: npx @hey-api/openapi-ts. It comes from the repository itself; we cannot guarantee it runs as-is in your client.
Who is it for?
We filed it under these tags: 开源项目. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
repository cnghockey/sats4ai-l402-examples;first catalogued 2026-11-14;last seen 2026-11-14。There is no official certification or quality rating here — we record sources and dates only.

# sats4ai-l402-examples

以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →

Code examples for integrating with Sats4AI's L402 API — 33+ pay-per-use AI tools with Bitcoin Lightning.
No signup. No API keys. No KYC. Just HTTP requests + Lightning payments.
## What is L402?
L402 lets you pay for API access with Bitcoin instead of signing up for accounts. The flow:
1. Send a request → server returns 402 Payment Required with a Lightning invoice
2. Pay the invoice → your wallet gives you a preimage (proof of payment)
3. Resend with proof → Authorization: L402 :
That's it. Works with any HTTP client and any Lightning wallet.
## Quick Start
### curl (simplest)
bash
# Step 1: Request → get 402 + invoice
curl -s -D - -o /dev/null -X POST https://sats4ai.com/api/l402/generate-image \
-H "Content-Type: application/json" \
-d '{"input": {"prompt": "a cat in space"}}' 2>&1 | grep -i www-authenticate
# Step 2: Pay the invoice with any Lightning wallet
# Step 3: Resend with proof
curl -X POST https://sats4ai.com/api/l402/generate-image \
-H "Content-Type: application/json" \
-H "Authorization: L402 : " \
-d '{"input": {"prompt": "a cat in space"}}'
See examples/curl/ for complete scripts.
### Python
bash
pip install requests
python
from lib.l402_client import L402Client
client = L402Client()
# Get invoice
invoice_data = client.request("generate-image", {"input": {"prompt": "a cat in space"}})
print(f"Pay this invoice: {invoice_data['invoice']}")
# After paying, submit proof
preimage = input("Enter preimage from wallet: ")
result = client.complete(invoice_data, preimage)
See examples/python/ for all services.
### Node.js
javascript
// Node.js 18+ (built-in fetch, no dependencies needed)
import { requestL402, completeL402 } from "./lib/l402-client.mjs";
// Get invoice
const challenge = await requestL402("generate-image", {
input: { prompt: "a cat in space" },
});
console.log(Pay this invoice: ${challenge.invoice});
// After paying, submit proof
const preimage = "your_preimage_here";
const result = await completeL402(challenge, { input: { prompt: "a cat in space" } }, preimage);
See examples/node/ for all services.
## Available Services
### AI Generation
| Endpoint | Description | Price |
| generate-image | Image from text prompt | 100-200 sats |
| generate-text | AI chat / text completion | ~1 sat/100 chars |
| generate-video | Video from text (async) | 300-550 sats/sec |
| animate-image | Video from image (async) | 100 sats/sec |
| generate-music | Music with AI vocals | 100 sats |
| generate-3d-model | Photo to 3D GLB (async) | 350 sats |
| translate-text | Translate (119 languages) | ~1 sat/1000 chars |
### Audio & Speech
| Endpoint | Description | Price |
| text-to-speech | Text to audio (467 voices, 29 languages) | 300 sats |
| transcribe-audio | Audio to text (async) | 10 sats/min |
| clone-voice | Clone voice from audio | 7,500 sats |
| epub-audiobook | Book to audiobook (async) | 500+ sats |
### Image Processing
| Endpoint | Description | Price |
| remove-background | Remove background, transparent PNG (BiRefNet) | 5 sats |
| upscale-image | Upscale 2x/4x with Real-ESRGAN | 5 sats |
| restore-face | Restore blurry/damaged faces (CodeFormer) | 5 sats |
| colorize-image | Colorize B&W photos (DDColor) | 5 sats |
| deblur-image | Remove camera-shake blur (NAFNet) | 20 sats |
Listed badge (optional)
Copy this line into the README if you want the listing mark. Optional, and it does not affect being listed.
[![Listed on Anclum](https://anclum.com/badge/listed.svg)](https://anclum.com/en/s/cnghockey-sats4ai-l402-examples/)
Source
github · https://github.com/cnghockey/sats4ai-l402-examples
Browse by field
Open source
added
today

More like this

All 1,671 →

Filed under

Every tag opens the full list for that filter. Counts are the live catalogue figures.

Browse all fields →

← Back to index