Install
- npm
- pnpm
Global Flags
Every command accepts these flags:Commands
fetch
Detect the payment protocol, pay, and return the response body.
Human output:
quote
Check the cost of a paid endpoint without paying. No credentials needed.
This endpoint is free (no payment required) for free endpoints.
JSON output (data field):
discover
Browse paid API endpoints from the BoltzPay registry. Supports filtering by protocol, score, category, and free-text search.
Human output:
data is an array of entries):
budget
Show remaining spending budget. No credentials needed.
No budget limits configured if no limits are set.
JSON output (data field):
history
Show payment history. History is persistent when the SDK persistence option is enabled. No credentials needed.
data is an array):
demo
Interactive walkthrough: checks your wallet, selects an appropriate endpoint (testnet or mainnet, x402 or L402), gets a quote, and optionally fetches with payment.
Endpoints are selected based on wallet capabilities: L402 if NWC is configured, x402 if Coinbase keys are set, read-only otherwise.
diagnose
Full diagnostic of a paid API endpoint: DNS resolution, protocol detection, format version, pricing, health, and latency. No credentials needed.
data field):
wallet
Show wallet addresses, balances, network, active protocols, and budget status.
data field):
JSON Output
The--json flag wraps every command’s output in a standard envelope:
Exit Codes
Python Bridge
The CLI’s--json mode makes it trivial to call from Python (or any language). This is the recommended pattern for using BoltzPay with LangChain, CrewAI, or any Python framework.
Error Handling in Python
Environment Variables
The CLI reads configuration from environment variables. A.env file in your working directory is loaded automatically.
Read-only commands (
quote, discover, diagnose, budget, history, wallet) work without Coinbase credentials. Only fetch requires them. See Configuration for constructor options, .env examples, and budget details.