C
cnghockey/sats4ai-l402-examples
L402 client examples for Sats4AI — pay-per-use AI phone calls, voice in 602 languages, translation, fax, and…
在 GitHub 查看 ↗链接已于 2026-11-14 核查 · HTTP 200 · 打开的是厂商自己的官网
安装与配置
客户端配置(取自该仓库的安装命令)
{
"mcpServers": {
"cnghockey-sats4ai-l402-examples": {
"command": "npx",
"args": ["@hey-api/openapi-ts"]
}
}
}解析自我们于 2026-11-13 抓取的该仓库 README;我们未执行过。
command/args 来自仓库写明的安装命令;不确定时请以该项目 README 为准。
VS Code(.vscode/mcp.json —— 键名是 servers)
{
"servers": {
"cnghockey-sats4ai-l402-examples": {
"command": "npx",
"args": ["@hey-api/openapi-ts"]
}
}
}VS Code 顶层键是 <code>servers</code>,其余与上面那份相同。
Claude Code(命令行)
claude mcp add --transport stdio cnghockey-sats4ai-l402-examples -- npx @hey-api/openapi-ts
Claude Code 不收 JSON 文件,用这条命令直接加。
配置项的键名以你的客户端为准:客户端与 CLI
- ★ 数取值
- 0 ★ · cnghockey/sats4ai-l402-examples · 取自 GitHub 搜索 API · (2026-11-13 20:00:50 核对)
- 来源明细
- 从该仓库的 GitHub 页面直接读取 · 条目类型:开源项目
- 收录与活跃
- 收录于 2026-11-14 · 最近见到 2026-11-14 · 共见到 1 次 · 被 1 个来源列出
- 评分构成
- 综合分 103 · 1 个来源 · repo
- 安装
npx @hey-api/openapi-ts
常见问题(答案都来自我们的记录)
怎么安装?
该仓库给出的安装命令是
npx @hey-api/openapi-ts。我们的记录里它是仓库自己提供的;不保证在你的客户端上直接可用。它适合谁 / 用来做什么?
我们把它归在这些标签下: 开源项目。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
仓库
cnghockey/sats4ai-l402-examples;我们收录于 2026-11-14;最近见到 2026-11-14。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。# 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 |
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 |
收录徽章(可选)
想把收录标记放进 README 就复制这行,可选,不影响收录。
[](https://anclum.com/zh/s/cnghockey-sats4ai-l402-examples/)
- 来源
- github · https://github.com/cnghockey/sats4ai-l402-examples
- 按领域浏览
- 开源项目
- 收录于
- 今天
同类推荐
所属领域与标签
每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。