Project 05 AI Agents · Web3
AgentHub
A marketplace where AI agents publish services, discover each other’s APIs and pay per call. Every invocation is a real USDC micropayment on Algorand TestNet.
Overview
AgentHub is a marketplace for AI agents. Providers publish an HTTP endpoint with a price; agents discover it from a machine-readable manifest, pay for each call in USDC over the x402 protocol, and get the result, with no human in the loop.
It grew out of the x402 Build Sprint at the Algobharat Dev Retreat, a hackathon about agentic commerce on Algorand.
The problem
APIs are sold to people: sign up, add a card, get a key. An autonomous agent can’t do any of that. x402
brings back HTTP’s long-unused 402 Payment Required status, so a server can ask for payment
and a client can pay inline, but on its own it charges one fixed price to one fixed address.
A marketplace needs the opposite: many providers, each with their own price and payout address, behind one gateway.
How it works
- One route, many sellers.
POST /invoke/:slugis a single x402-protected route. Its price and payout address are functions that look the slug up in the registry on every request, so each call charges that service’s price to that provider’s address. Change a price and the very next call reflects it, with no restart. - Pay, then proxy. The gateway answers with a 402 challenge, the agent signs a USDC transfer, and the facilitator settles it on Algorand in about three seconds. Only then is the call forwarded to the provider and logged with its transaction ID.
- Non-custodial. The payout address is the provider’s own wallet, so money moves from agent to provider directly. AgentHub never holds funds.
- No result, no charge. If the provider fails, the gateway returns a 502 and the x402 middleware cancels settlement, so no USDC moves and the call is logged as uncharged.
- An agent with its own budget. A headless client discovers services it has never seen, applies its own budget policy, pays and uses the results with zero human involvement.
Key features
-
01
Live registry
Publish an endpoint and it’s payable seconds later.
-
02
Per-request pricing
Price and payee resolved from the registry on every call.
-
03
Wallet checkout
Pera or Defly on TestNet, with a live payment timeline.
-
04
Earnings & activity
Every settled call, linked to its transaction.
-
05
Autonomous agent
Discover, budget-check and pay with no human involved.
-
06
Guardrails
SSRF protection, spend caps and USDC opt-in checks.
Challenges & what I learned
The most common failure wasn’t in the code at all: every Algorand address that receives USDC has to opt in to the asset first, or settlement fails. Surfacing that clearly mattered as much as the payment flow.
Delivery guarantees matter as much as payment. Charging only once the provider has answered is what makes it fair to put an unknown agent and an unknown provider on either side of the same call.
What’s next
Agents hiring other agents, on-chain reputation and provider staking, demand-responsive pricing, semantic discovery (describe a goal, get a service), and a listing in the public x402 Bazaar catalogue.
07 — Gallery
In pictures.