1Pay.ing — Your single wallet for the entire x402 economy
1paying-kit is an early-stage TypeScript project in the AI payments / x402 ecosystem, focused on payment, wallet, web3, x402. It currently has 5 GitHub stars and 5 forks, and sits alongside related tools like internet-court-skill, Inktoll, tdm-integration-kit.

1Pay.ing Kit is a client-side SDK that implements the x402 payment specification proposed by Coinbase—a concrete implementation of HTTP 402—designed to radically simplify the integration and use of Web3 payments.
The x402 specification decouples backend applications from payment services by introducing the "Facilitator" role. 1Pay.ing builds on this by solving the client-side problem, acting as a "client-side facilitator" that provides a unified payment wallet and SDK. This decouples the client application from the user's specific wallet.
1paying-kit greatly simplifies the client-side logic for handling HTTP 402 responses.
HTTP 402 Payment Required response.1paying-kit intercepts the 402 response, generates a 1Pay.ing payment link, and the client guides the user to the 1Pay.ing wallet to complete the payment signature.1paying-kit, it uses the payload to request the backend again.This is a monorepo containing the following main parts:
ts/1paying-kit: The core TypeScript SDK (@ldclabs/1paying-kit). It provides all the tools needed to handle the HTTP 402 payment flow on the client side.examples/1paying-coffee-app: A frontend demo application built with SvelteKit. It fully demonstrates how to use 1paying-kit to interact with a payment-protected backend.examples/1paying-coffee-cli: A command-line interface (CLI) demo application. It demonstrates how to use 1paying-kit in a Node.js environment to handle the entire HTTP 402 payment flow from the terminal.examples/1paying-coffee-worker: A backend demo application built with Cloudflare Workers. It shows how to protect an API endpoint and verify payments by integrating with an x402 facilitator.The fastest way to understand 1paying-kit is to run the "Buy Me a Coffee" demo project.
https://1paying-coffee.zensh.workers.dev/
Install Dependencies: In the repository root, run:
pnpm install
Start the Backend Worker: Open a new terminal and start the local development server for the Cloudflare Worker.
pnpm --filter 1paying-coffee-worker dev
The backend service will be running at http://localhost:8787.
Start the Frontend App: In another terminal, start the development server for the SvelteKit frontend app.
pnpm --filter 1paying-coffee-app dev
You can now open http://localhost:5173 in your browser to experience the full payment flow.
Using 1paying-kit in your own project is straightforward.
npm install @ldclabs/1paying-kit
1paying-kit can automatically handle the 402 flow by intercepting fetch, or you can handle it manually.
This example is designed to be the simplest possible demonstration of a complete 1paying-kit integration.
import { payingKit } from '@ldclabs/1paying-kit'
import { stdin as input, stdout as output } from 'node:process'
import * as readline from 'node:readline/promises'
import { exec } from 'node:child_process'
import { ProxyAgent, setGlobalDispatcher } from 'undici'
const proxy = process.env.http_proxy || process.env.https_proxy
if (proxy) {
console.log(`Using proxy: ${proxy}`)
setGlobalDispatcher(new ProxyAgent(proxy))
}
// Run with: npx tsx cli.ts
async function main() {
const rl = readline.createInterface({ input, output })
const coffeeStore = 'https://1paying-coffee.zensh.workers.dev'
console.log('Welcome to the 1Paying Coffee CLI!')
let response = await fetch(`${coffeeStore}/api/make-coffee`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' }
})
console.log(`Initial response status: ${response.status}`)
const { payUrl, txid } = await payingKit.tryGetPayUrl(response)
if (payUrl && txid) {
// Payment is required, handle it with the kit
const _answer = await rl.question(
`Press ENTER to open in the browser...\n${payUrl} (Enter)`
)
// Redirect user to sign the payment
exec(`open "${payUrl}"`)
try {
const payloadHeader = await payingKit.waitForPaymentPayload(txid, {
onprogress: (state) => {
process.stdout.write(`\rPayment status: ${state.status}`)
}
})
// Now you can retry the original request with the payment payload
// typically in an 'Authorization' or 'X-Payment' header.
response = await fetch(`${coffeeStore}/api/make-coffee`, {
method: 'POST',
headers: {
'X-PAYMENT': payloadHeader
}
})
} catch (error) {
console.error('Payment failed or timed out:', error)
throw error
}
}
rl.close()
// Process the successful response
const data = await response.json()
console.log('Your coffee:', data)
}
main().catch((error) => {
console.error('Error in main:', error)
})
Copyright © 2025 LDC Labs.
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.
The trust layer for agent-to-agent commerce — natural-language mandates, ERC-7710 delegated permissions, x402 payments, escrow, and dispute resolution as one open, catch-all Agent Skill / Claude Code plugin.
A decentralized micro-settlement protocol enabling autonomous AI agents to pay publishers for premium content via Circle Programmable Wallets and x402 nanopayments.
Developer integration tools for adding TDM payments to AI agents, apps, and workflows. CLI, MCP server, and copy-paste examples