Skip to content
Back to search

pay

CLI for Agentic payments (x402, MPP, AP2).

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/solana-foundation--pay/badge.svg)](/listings/solana-foundation--pay)

HTML

<a href="/listings/solana-foundation--pay"><img src="/api/listings/solana-foundation--pay/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Prebuilt Binaries

# macOS
brew install pay

# via NPM
npm install -g @solana/pay

From Source

git clone https://github.com/solana-foundation/pay.git
cd pay
just install pay

Verify

pay --version

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 209 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. <picture>
  3. <source media="(prefers-color-scheme: dark)" srcset="https://github.com/solana-foundation/pay/raw/main/docs/assets/banner-main-dark.png">
  4. <source media="(prefers-color-scheme: light)" srcset="https://github.com/solana-foundation/pay/raw/main/docs/assets/banner-main-light.png">
  5. <img alt="pay.sh" width="100%" src="https://github.com/solana-foundation/pay/raw/main/docs/assets/banner-main-light.png">
  6. </picture>
  7. </div>
  8. <p align="center">
  9. <a href="https://skills.sh/solana-foundation/pay"><img alt="skills.sh" src="https://skills.sh/b/solana-foundation/pay"></a>
  10. <a href="https://x402.org"><img alt="x402" src="https://img.shields.io/badge/protocol-x402-black"></a>
  11. <a href="https://paymentauth.org"><img alt="MPP" src="https://img.shields.io/badge/protocol-MPP-black"></a>
  12. <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-green"></a>
  13. </p>
  14. <p align="center">
  15. <b>The missing payment layer for HTTP — x402 &amp; MPP payment challenges with user-authorized stablecoin signing.</b>
  16. </p>
  17. <p align="center">
  18. <a href="#installation">Install</a> ·
  19. <a href="#quick-start">Quick Start</a> ·
  20. <a href="https://docs.solanapay.com">Docs</a>
  21. </p>
  22. ---
  23. ```sh
  24. # Without pay — you get a 402
  25. curl https://debugger.pay.sh/mpp/quote/AAPL
  26. # With pay -- it handles the 402 challenge and returns the response
  27. pay curl https://debugger.pay.sh/mpp/quote/AAPL
  28. ```
  29. ## Key Features
  30. ### 💵 Transparent 402 Handling
  31. Wrap your CLI (`curl`, `claude`, `codex`, etc.) -- when an API returns 402, `pay` detects the payment protocol, prepares the stablecoin transaction, asks the local wallet to authorize and sign it, then retries with the payment proof.
  32. Supports both live payment standards on Solana:
  33. - **[MPP](https://paymentauth.org/draft-solana-charge-00.html/)** — Machine Payments Protocol
  34. - **[x402](https://x402.org/)** — x402 Payment Protocol
  35. Stablecoins deployed to Solana are supported out of the box.
  36. ### 🤖 AI-Native with MCP
  37. `pay` ships with a built-in [MCP](https://modelcontextprotocol.io/) server, letting AI assistants request paid API calls through the same local wallet-approval flow.
  38. ```sh
  39. # Run Claude Code or Codex with pay injected into the agent session
  40. pay claude
  41. pay codex
  42. ```
  43. For unattended agents, `pay mcp` can enforce pay-kit's payment permissions
  44. before any transaction is built or signed. Configure them inline or with a
  45. strict YAML file:
  46. ```sh
  47. pay mcp --allow-origin https://api.example.com --allow-network mainnet --max-payment '$1.00'
  48. pay mcp --permissions ./pay-permissions.yml
  49. ```
  50. ```yaml
  51. origins: [https://api.example.com]
  52. networks: [mainnet]
  53. max_payment: "$1.00"
  54. allow_any_asset: false
  55. ```
  56. Configured permissions apply to MPP charge and x402 exact, upto, and
  57. batch-settlement payments. Stateful MPP sessions and subscriptions fail closed
  58. while a permission policy is active.
  59. ACP clients such as Buzz can launch the same paid inference route without
  60. sharing their protocol stream with Pay:
  61. ```sh
  62. # Interactive provider/model selection when run from a terminal
  63. pay acp goose
  64. # Deterministic configuration for a headless ACP client
  65. pay acp goose --provider alibaba --model qwen3.7-plus
  66. ```
  67. `pay acp` supports `goose`, `claude`, and `codex`. It starts the payer proxy,
  68. configures the selected ACP adapter to use it, and passes ACP JSON-RPC through
  69. stdin/stdout unchanged. Headless clients may set `PAY_ACP_PROVIDER` and
  70. `PAY_ACP_MODEL` instead of passing flags.
  71. ### 🛠️ Payment debugging and simulations
  72. `pay` ships with an embedded Payment Debugger — a local web UI that visualizes every 402 challenge-response cycle as a sequence diagram. See exactly which headers were sent, which protocol was used (MPP or x402), and where things went wrong.
  73. Everything runs locally — no data leaves your machine.
  74. ```sh
  75. # Start a gateway with the debugger on any paywall
  76. pay gate api paywall.yml --debugger
  77. # Discover and gate local inference with optional per-model rates
  78. pay --sandbox gate inference rates.yml
  79. # Or run the bundled demo (sandbox + debugger + sample endpoints)
  80. pay gate demo
  81. ```
  82. A [public debugger](https://debugger.pay.sh) is also available.
  83. ### 🔐 Gated Payments via Biometrics
  84. `pay` lets AI agents use paid APIs without giving them your private key or an API-wide spending credential.
  85. When a command, Claude Code, Codex, or another MCP client hits a paid endpoint, `pay` prepares the payment locally and asks your wallet backend to authorize the signature. On macOS, that means Touch ID via Keychain. On Windows, Windows Hello. On Linux, GNOME Keyring / polkit. If you reject the prompt, the payment is not signed and the request does not go through.
  86. ```sh
  87. pay setup # Touch ID on macOS, Windows Hello on Windows, GNOME Keyring on Linux, or choose 1Password
  88. ```
  89. Prefer to keep no key on the machine at all? `pay` can also sign through an [Openfort backend wallet](https://www.openfort.io/docs/products/server/accounts): the private key stays in Openfort's TEE, each payment is a policy-checked API call, and the local credentials are revocable.
  90. ```sh
  91. pay account new agent --backend openfort # connect an existing Openfort backend wallet (acc_…)
  92. ```
  93. ### 📚 Open Source Catalog
  94. The paid API catalog is open source in the [`pay-skills`](https://github.com/solana-foundation/pay-skills) repo.
  95. Anyone can contribute a provider listing, improve endpoint metadata, or add usage guidance for agents. Catalog entries follow the [`pay-skills` contributing guide](https://github.com/solana-foundation/pay-skills/blob/main/CONTRIBUTING.md), which defines the metadata, pricing, endpoint, and usage-note standards that keep **Agent experience** consistent.
  96. ```sh
  97. pay skills search "maps"
  98. ```
  99. Good catalog entries make paid APIs easier for both humans and agents to discover, compare, and use safely.
  100. ## Installation
  101. ### Prebuilt Binaries
  102. ```sh
  103. # macOS
  104. brew install pay
  105. # via NPM
  106. npm install -g @solana/pay
  107. ```
  108. ### From Source
  109. ```sh
  110. git clone https://github.com/solana-foundation/pay.git
  111. cd pay
  112. just install pay
  113. ```
  114. ### Verify
  115. ```sh
  116. pay --version
  117. ```
  118. ## Quick Start
  119. ```sh
  120. # 1. Setup your account
  121. pay setup
  122. pay whoami
  123. # 2. Make a paid gated API call to https://debugger.pay.sh sandbox endpoints
  124. pay --sandbox curl https://debugger.pay.sh/mpp/quote/AAPL
  125. # 3. Or let your AI agent handle it
  126. pay claude
  127. ```
  128. ## Contributing
  129. ```sh
  130. cd rust
  131. just build # release binary
  132. just test # all tests
  133. just lint # clippy (warnings = errors)
  134. ```
  135. We welcome contributions — check [open issues](https://github.com/solana-foundation/pay/issues) to get started.
  136. ## Troubleshooting
  137. ### Linux: `pay topup` or `pay curl` errors with "auth failed"
  138. GNOME Keyring auth uses polkit, which requires a one-time setup step:
  139. ```sh
  140. sudo cp rust/config/polkit/sh.pay.unlock-keypair.policy /usr/share/polkit-1/actions/
  141. ```
  142. This grants `pay` the right to prompt for your password or fingerprint before accessing the keypair.
  143. ## License
  144. MIT — see [LICENSE](./LICENSE).
  145. Subject to the foregoing, the Terms of Service available at [solana.com/tos](https://solana.com/tos)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.