Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
pay-kit is a growing Rust project in the AI payments / x402 ecosystem, focused on base, golang, kotlin, lua. It currently has 69 GitHub stars and 22 forks, and sits alongside related tools like mpp-sdk, tdm-integration-kit, tdm-sdk, TDM-Agent-Integration-Kit, x402-proxy, afara.
Add a stablecoin paywall to any HTTP route.
In TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin, or Swift.
Stablecoins are digital dollars (USDC, USDT, PYUSD, EURC, …) that move on public payment rails. For a developer building an API, a SaaS, or an agent that needs to pay for things, they unlock a few properties that classical card networks can't match:
Solana is the most-used blockchain for payments today, and it's the one this kit is built on.
See payments.org for the long-form pitch.
Two open protocols, sharing one mental model: an HTTP server replies 402 Payment Required with a challenge, the client pays, and the same request is replayed with a proof of payment. The kit ships server and client SDKs for both.
sequenceDiagram
autonumber
participant C as Client / Agent
participant S as Your API
participant Sol as Solana
C->>S: GET /api/report
S-->>C: 402 Payment Required<br/>{ amount: 0.10 USDC, pay_to, nonce }
C->>Sol: sign & submit USDC transfer
Sol-->>C: tx signature
C->>S: GET /api/report<br/>X-PAYMENT: <signed proof>
S->>Sol: verify settlement
Sol-->>S: confirmed
S-->>C: 200 OK + X-PAYMENT-RESPONSE
Live playground: 402.surfnet.dev.
A paid endpoint in seven lines of Ruby. Save as config.ru, bundle exec rackup, and you have a stablecoin paywall.
# config.ru
require "sinatra/base"
require "solana_pay_kit"
class App < Sinatra::Base
get("/report") do
require_payment! usd("0.10")
"premium content"
end
end
run App
Call it from any HTTP client. Without payment you get a 402; with the pay CLI the wallet pops Touch ID, signs a USDC transfer, and replays the request:
brew install pay # or: npm install -g @solana/pay
curl -i http://127.0.0.1:4567/report # → 402 Payment Required
pay curl -i http://127.0.0.1:4567/report # → 200 OK + receipt
The same surface is available in nine languages — server-side, client-side, or both:
| Language | Server | Client |
|---|---|---|
| TypeScript | ✅ | ✅ |
| Rust | ✅ | ✅ |
| Go | ✅ | ✅ |
| Python | ✅ | ✅ |
| Ruby | ✅ | — |
| PHP | ✅ | — |
| Lua | ✅ | — |
| Kotlin | — | ✅ |
| Swift | — | ✅ |
Each language directory has its own README with framework-specific snippets (Sinatra/Rails, Express, FastAPI, Axum, Gin, …).
The playground/ directory is a local web app that exercises every primitive in the kit end to end against the Solana Payment Sandbox (a hosted test validator — no real funds): single charges with multi-recipient splits, metered sessions that stream content against off-chain vouchers and settle the channel on-chain, subscriptions, and x402 endpoints. Generate a throwaway wallet in the browser, fund it from the built-in faucet, and watch each step of the 402 handshake — challenge, signing, broadcast, settlement — in the request timeline and event log, with a receipt link for every settled transaction.
cd playground
pnpm install
pnpm dev # server on :3000, web app on :5173

MIT
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Developer integration tools for adding TDM payments to AI agents, apps, and workflows. CLI, MCP server, and copy-paste examples
Open contract-facing SDK for payable routes and gateway-backed integrations. Thin public surface for authorize, checkout, and session flows.
Developer integration tools for adding TDM payments to AI agents, apps, and workflows. CLI, MCP server, and copy-paste examples
curl for x402 and MPP paid APIs. CLI + MCP proxy that auto-pays any endpoint on Base, Solana, and Tempo. Zero crypto code on the buyer side.
the onramp for pay-as-you-go decentralized storage on IPFS — SOL, USDFC, USDC, and x402 agent payments
Lucid Agents Commerce SDK. Bootstrap AI agents in 60 seconds that can pay, sell, and participate in agentic commerce supply chains. Our protocol agnostic SDK provides CLI-generated templates and drop-in adapters for Hono, Express, Next.js, and TanStack, giving you instant access to crypto/fiat payment rails (AP2, A2A, x402, ERC8004).
Skills & plugins for agentic commerce : UCP, ACP, AP2, A2A, WebMCP, Magento 2, BigCommerce, WooCommerce
Trust infrastructure for million-agent economies on Solana - identity, reputation, and validation designed for continuous feedback at scale.
A chain-agnostic AI-native payment infrastructure, authz layer for x402
🚀 Curated resources for Google's Agent Payments Protocol (AP2), A2A & x402 — blogs, videos, repos & specs. Contributions welcome!
A neutral landscape analysis of AI agent payment protocols (x402, MPP, L402, Google AP2, Visa TAP + ICC, Mastercard Agent Pay, Amex ACE, Google/Shopify UCP, OpenAI ACP, and others). Maintained by Genesis Software Group, Copenhagen. Updated April 2026. CC BY 4.0.