Loops HouseGRAM-402

NEAR HACKATHON
Team
1 member- ALOwner
Aleksandr Shcherbakov
Overview
GRAM-402 lets AI agents pay for HTTP requests on their own without ever holding unlimited funds. The owner funds a NEAR smart-contract mandate for an agent account: budget, cap per payment, expiry and allowed merchants. A paid API answers HTTP 402 with an invoice; the agent pays by calling pay on the mandate contract, which checks every limit and sends the money straight to the merchant. The merchant verifies the payment from the transaction and answers with a signed receipt. Even a compromised agent cannot overspend: it only holds a function-call key that may call pay, so a direct transfer cannot even be signed. Payments add no contract state, so nobody can make the contract pay for storage or squat invoice ids. Live on NEAR testnet with an end-to-end CI run (mandate, two payments, over-cap refusal, sandboxed agent) and an agent economy demo where agent A buys plans from agent B, and B pays service C from its own procurement mandate funded by its revenue — all visible on chain. The same 402 endpoint also accepts PayPal and TON. Clients in Python and TypeScript; MIT license.