Skip to main content

Install

Or run directly without installing:

Global Flags

Every command accepts these flags:

Commands

fetch

Detect the payment protocol, pay, and return the response body.
Human output:
JSON output:

quote

Check the cost of a paid endpoint without paying. No credentials needed.
Human output:
Prints 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:
JSON output (data is an array of entries):

budget

Show remaining spending budget. No credentials needed.
Human output:
Prints 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.
Human output:
JSON output (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.
Human output:
JSON output (data field):

wallet

Show wallet addresses, balances, network, active protocols, and budget status.
Human output:
JSON output (data field):

JSON Output

The --json flag wraps every command’s output in a standard envelope:
On errors:
Error codes map directly to exit codes and error classes. See the Errors section for the full list.

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.
Set environment variables (COINBASE_API_KEY_ID, etc.) in your shell before running. The CLI reads them automatically via process.env.

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.