Search projects, hackathons, sponsors and tech

    ← All projects

    Alt Agent

    Pay-per-inference AI on Hedera. x402 micropayments auto-routed to the cheapest capable model.

    Demo

    About

    An agentic AI gateway on Hedera where every inference call is paid per request via the x402 protocol — no subscriptions, no prepaid balances. A prompt classifier automatically routes each request to the cheapest model capable of handling it, and every paid call is settled through Blocky402 and logged to Hedera Consensus Service for a verifiable on-chain audit trail. One endpoint replaces a stack of separate AI subscriptions, and the agent proves what it paid for.

    How it's made

    The project is built on top of Hedera's x402-inference-pay-per-request-poc starter, extended with a custom broker overlay that adds intelligent model routing and on-chain auditing. The core is split into two packages. packages/router holds a prompt classifier, an offering catalogue (each model tagged with capability and cost-per-call), and selection logic that picks the cheapest model capable of handling a given prompt — so a trivial query never gets billed at frontier-model prices. This is what turns a plain gateway into an actual router. It ships with unit tests, including a word-boundary regex fix that was killing us early on: the classifier was matching substrings inside unrelated words and misrouting requests, so we tightened the matching to whole-word boundaries. Payments run through the x402 protocol on Hedera testnet, with Blocky402 as the facilitator (X402_TESTNET_FACILITATOR_URL=https://api.testnet.blocky402.com). The flow is genuinely pay-per-request: a call only settles once the request completes, and the gateway won't forward the inference until payment confirms. The model itself is served locally through LM Studio sitting behind the x402 gate, which let us test the full paid loop against a real open model without external API keys. Every settled call is logged to Hedera Consensus Service via packages/audit — an HCS logger plus a topic-creation script — giving each transaction a tamper-evident, verifiable on-chain receipt rather than a claim in a database. On the hacky side: because the starter repo wasn't designed to be extended, we kept our overlay as isolated packages and wired them into the agent with three surgical edits documented in INTEGRATION.md, which kept the reused-vs-new boundary clean for attribution and let us iterate on the router without touching the upstream PoC.