BoltzPay — Paid API Access for AI Agents
BoltzPay lets AI agents pay for API data automatically. It supports three payment protocols (x402, L402, and MPP) across multiple chains (Base, Solana, Tempo), paying with USDC, Bitcoin Lightning, or Stripe. Agents can discover 5,700+ scored endpoints from the live registry, evaluate pricing, open streaming sessions, and purchase API data in a single workflow.
Quick Start
Fetch data from a paid API endpoint:
CODEBLOCK0
Commands
| Command | Description | Credentials Needed |
|---|
| INLINECODE0 | Fetch and pay for API data | Yes |
| INLINECODE1 |
Get a price quote | No |
|
npx @boltzpay/cli discover | Browse the BoltzPay registry (5,700+ endpoints) | No |
|
npx @boltzpay/cli discover --protocol mpp --min-score 70 | Filter by protocol and trust score | No |
|
npx @boltzpay/cli discover --query weather | Search endpoints by name or URL | No |
|
npx @boltzpay/cli diagnose <url> | Full diagnostic — DNS, protocol detection (x402/L402/MPP), pricing, health, latency | No |
|
npx @boltzpay/cli budget | Check spending budget | No |
|
npx @boltzpay/cli history | View payment history | No |
|
npx @boltzpay/cli wallet | Check wallet address and balance | No |
Setup
Set the following environment variables for paid API access:
x402 (USDC on Base)
- -
COINBASE_API_KEY_ID — Your Coinbase CDP API key ID - INLINECODE10 — Your Coinbase CDP API key secret
- INLINECODE11 — Your Coinbase CDP wallet secret
Get your Coinbase CDP keys at portal.cdp.coinbase.com.
MPP (Tempo payment channels)
- -
TEMPO_PRIVATE_KEY — Tempo wallet private key (hex). Enables MPP one-shot payments and streaming sessions.
Optional
- -
NWC_CONNECTION_STRING — NWC connection string for L402 (Lightning) payments - INLINECODE14 — Stripe secret key for Stripe MPP payments
- INLINECODE15 — Daily spending limit in USD (default: unlimited)
Examples
1. Discover APIs from the registry
CODEBLOCK1
Browse 5,700+ scored and verified paid APIs from the BoltzPay registry. Filter by protocol, category, score, or free-text search. No credentials needed.
CODEBLOCK2
2. Get a price quote
CODEBLOCK3
See the payment protocol, amount, and chain options without spending anything.
3. Fetch paid data
CODEBLOCK4
Automatically detects the payment protocol (x402, L402, or MPP), pays, and returns the API response.
4. Diagnose an endpoint
CODEBLOCK5
Full diagnostic: DNS resolution, protocol detection, format version, pricing, health classification, and latency.
No Credentials?
Six of the seven commands work without any credentials:
- -
quote — get detailed pricing - INLINECODE17 — browse the registry with filters (protocol, score, category, search)
- INLINECODE18 — full endpoint diagnostic (DNS, protocol, pricing, health, latency)
- INLINECODE19 — check spending limits
- INLINECODE20 — view past transactions
- INLINECODE21 — check wallet address and balance
Only fetch requires credentials (it makes actual payments).
Links
BoltzPay — AI代理的付费API访问
BoltzPay让AI代理能够自动为API数据付费。它支持跨多条链(Base、Solana、Tempo)的三种支付协议(x402、L402和MPP),可使用USDC、比特币闪电网络或Stripe进行支付。代理可以从实时注册表中发现5700多个已评分的端点,评估定价,开启流式会话,并在单个工作流中购买API数据。
快速开始
从付费API端点获取数据:
npx @boltzpay/cli fetch https://invy.bot/api
命令
| 命令 | 描述 | 需要凭证 |
|---|
| npx @boltzpay/cli fetch <url> | 获取并支付API数据 | 是 |
| npx @boltzpay/cli quote <url> |
获取价格报价 | 否 |
| npx @boltzpay/cli discover | 浏览BoltzPay注册表(5700+端点) | 否 |
| npx @boltzpay/cli discover --protocol mpp --min-score 70 | 按协议和信任评分筛选 | 否 |
| npx @boltzpay/cli discover --query weather | 按名称或URL搜索端点 | 否 |
| npx @boltzpay/cli diagnose
| 完整诊断 — DNS、协议检测(x402/L402/MPP)、定价、健康状态、延迟 | 否 |
| npx @boltzpay/cli budget | 检查支出预算 | 否 |
| npx @boltzpay/cli history | 查看支付历史 | 否 |
| npx @boltzpay/cli wallet | 检查钱包地址和余额 | 否 |
设置
设置以下环境变量以进行付费API访问:
x402(Base上的USDC)
- - COINBASEAPIKEYID — 您的Coinbase CDP API密钥ID
- COINBASEAPIKEYSECRET — 您的Coinbase CDP API密钥密钥
- COINBASEWALLETSECRET — 您的Coinbase CDP钱包密钥
在portal.cdp.coinbase.com获取您的Coinbase CDP密钥。
MPP(Tempo支付通道)
- - TEMPOPRIVATEKEY — Tempo钱包私钥(十六进制)。启用MPP一次性支付和流式会话。
可选
- - NWCCONNECTIONSTRING — 用于L402(闪电网络)支付的NWC连接字符串
- STRIPESECRETKEY — 用于Stripe MPP支付的Stripe密钥
- BOLTZPAYDAILYBUDGET — 每日支出限额(美元,默认:无限制)
示例
1. 从注册表发现API
npx @boltzpay/cli discover
从BoltzPay注册表浏览5700多个已评分和验证的付费API。按协议、类别、评分或自由文本搜索进行筛选。无需凭证。
npx @boltzpay/cli discover --protocol x402 --min-score 80 --category crypto-data
2. 获取价格报价
npx @boltzpay/cli quote https://invy.bot/api
查看支付协议、金额和链选项,无需任何花费。
3. 获取付费数据
npx @boltzpay/cli fetch https://invy.bot/api
自动检测支付协议(x402、L402或MPP),支付并返回API响应。
4. 诊断端点
npx @boltzpay/cli diagnose https://invy.bot/api
完整诊断:DNS解析、协议检测、格式版本、定价、健康状态分类和延迟。
没有凭证?
七个命令中有六个无需任何凭证即可使用:
- - quote — 获取详细定价
- discover — 使用筛选条件(协议、评分、类别、搜索)浏览注册表
- diagnose — 完整端点诊断(DNS、协议、定价、健康状态、延迟)
- budget — 检查支出限制
- history — 查看过往交易
- wallet — 检查钱包地址和余额
只有fetch需要凭证(它进行实际支付)。
链接