The missing HTTP 402 client.
Wrap curl or wget — when an API returns 402, pay detects the payment protocol, signs a transaction, and retries. The response lands on stdout as if nothing happened.
Install · Quick Start · Docs
# Without pay — you get a 402
curl https://402-demo-api.vercel.app/mpp/quote/AAPL
# With pay — it handles the 402 and you get the response
pay --dev curl https://402-demo-api.vercel.app/mpp/quote/AAPLWrap curl or wget — when an API returns 402, pay detects the payment protocol, signs the transaction, and retries. You get the response body. That's it.
Supports both live payment standards on Solana:
Stablecoins deployed to Solana are supported out of the box.
Your keys never touch disk in plaintext. pay stores keypairs in:
- macOS Keychain with Touch ID biometric protection
- 1Password vault integration (cross-platform)
- File-based fallback for CI and scripting
pay setup --backend keychain # Touch ID protected
pay setup --backend 1password # Cross-platform vaultSet a spending cap and expiration before making requests. The interactive TUI lets you control exactly how much you're willing to spend per session — no surprise charges.
pay ships with a built-in MCP server, giving AI assistants the ability to make paid API calls on your behalf.
# Run Claude Code or Codex with pay injected automatically
pay --dev claude
pay --dev codexGet started instantly with an ephemeral keypair auto-funded via Surfpool. No setup, no mainnet tokens needed.
# Uses public devnet (402.surfnet.dev) by default
pay --dev curl https://402-demo-api.vercel.app/mpp/quote/AAPL
# Or use a local Surfpool instance
pay --dev --local curl http://localhost:3402/mpp/quote/AAPLgit clone https://github.com/solana-foundation/pay.git
cd pay/rust
cargo install --path crates/clipay --version# 1. Generate a keypair (Touch ID protected on macOS)
pay setup
# 2. Make a paid API call (--dev uses an ephemeral funded keypair)
pay --dev curl https://402-demo-api.vercel.app/
# 3. Or let your AI agent handle it
pay --dev claudecd rust
just build # release binary
just test # all tests
just lint # clippy (warnings = errors)We welcome contributions — check open issues to get started.
Apache-2.0 — see LICENSE.