Marketplace of Indic-language AI APIs paid per call by a budgeted agent using x402 stablecoins
BhashaPay is a pay-per-call marketplace for Indic-language AI services such as Marathi and Hindi translation, speech-to-text and document OCR. Each service is an API that answers with an HTTP 402 payment request and only runs after payment settles, so small merchants can charge a few cents per request without card rails or subscriptions. An autonomous agent takes a task and a budget, discovers registered services, compares price and quality, pays on its own and reports what it spent. Spend controls (total budget, per-merchant limit, merchant allowlist, and a human-approval threshold) stop the agent from overspending, and a denied or over-budget payment never triggers the paid action. Payments can settle on Hedera using x402, or gaslessly in USDT on Whitechain through a relayer and settlement contracts, with an audit log on Hedera Consensus Service. A dashboard shows services, agent runs, payments and the audit trail.
BhashaPay is a TypeScript monorepo. The frontend is Next.js with Tailwind (marketplace, agent run form with a live SSE timeline, payments, audit log and an approval modal). The backend is Express with SQLite, storing services, runs, payments, receipts and audit references. Protected endpoints use the x402 "exact" scheme on Hedera testnet (0.01 test USDC) before calling an OpenAI-compatible model for translation, transcription and OCR. The Whitechain rail uses Solidity contracts built with Foundry and OpenZeppelin: a service registry, a settlement contract with stored receipts, one-use request hashes, relayer limits, pausing and refunds, and an onchain spend-policy contract. The payer signs an EIP-3009 transferWithAuthorization for the Whitechain USDT contract and a private facilitator relays it, so the payer needs no gas token. The facilitator rate-limits by IP, service and payer, and idempotency keys bind each paid request to its receipt so a retry is never charged twice. Hedera Consensus Service provides a tamper-evident payment audit log, read back through the mirror node. Hedera's x402 support made per-request micropayments simple to add to a normal HTTP API, and Whitechain's USDT with EIP-3009 support is what allowed gasless payments.

