The missing HTTP 402 client.
Wrap curl or wget — when an API returns 402, pay detects the payment protocol, signs a Solana transaction, and retries. The response lands on stdout as if nothing happened.
Install · Quick Start · Docs
# Just like curl, but it handles 402s
pay --dev curl https://api.example.com/data
# Works with wget too
pay --dev wget https://api.example.com/report.csvWrap 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:
SOL and SPL tokens (USDC, USDT, etc.) 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 claude
pay codexSpin up a local environment with an ephemeral keypair auto-funded via Surfpool. No mainnet tokens needed.
pay --dev curl http://localhost:8080/datagit 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://api.example.com/data
# 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.