solana-foundation/pay
CLI for Agentic payments (x402, MPP, AP2).
What it solves
It addresses the lack of a standardized payment layer for HTTP, specifically enabling users and AI agents to handle "402 Payment Required" responses from APIs. It allows for secure, user-authorized payments using stablecoins on the Solana blockchain without requiring the user to share private keys or API-wide spending credentials with the agents.
How it works
pay acts as a wrapper for CLI tools (like curl) or AI agents (like Claude Code or Codex). When an API returns a 402 challenge, pay detects the payment protocol (MPP or x402), prepares a stablecoin transaction, and prompts the user for local biometric authorization (Touch ID, Windows Hello, or GNOME Keyring) to sign the transaction. Once authorized, it retries the request with the payment proof.
Who it’s for
- Developers who want to integrate paid API endpoints into their workflows.
- AI Agent users who want to let their agents access paid APIs securely via the Model Context Protocol (MCP).
- API Providers who want to implement gated payments using the Machine Payments Protocol (MPP) or x402.
Highlights
- AI-Native Integration: Includes a built-in MCP server to allow AI assistants to request paid API calls.
- Biometric Security: Uses local OS-level authentication (Touch ID, Windows Hello) for transaction signing.
- Protocol Support: Supports both the Machine Payments Protocol (MPP) and the x402 Payment Protocol on Solana.
- Payment Debugger: Features an embedded local web UI to visualize 402 challenge-response cycles as sequence diagrams.
- Open Catalog: Integrates with an open-source catalog of paid APIs for easier discovery.
Related
- Dispatch
- Dispatch
- Dispatch
- Dispatch
- Dispatch