
Spigot
Pay-per-call API marketplace over MCP, settled in USDC on Arc Testnet.
Demo
About
Spigot is a marketplace for paid APIs where every call is billed individually in USDC on Arc Testnet. The core idea is that if you've built an API and want to charge for it, you shouldn't need to set up Stripe, manage API keys, or lock people into monthly plans. You just list your endpoint, set a price per call, and that's it. On the consumer side, you top up your balance once and start calling APIs right away. There are no minimum commitments, no monthly fees, and no overage charges. You pay exactly what you use. Under the hood, Spigot acts as a reverse proxy. When someone makes a call, the platform verifies payment using an EIP-3009 nanopayment, which is a gasless signature-based USDC transfer on Arc Testnet. Once verified, it forwards the request to the publisher's upstream server and streams the response back. The caller never sees a wallet popup or has to manually sign a transaction for each request. Everything settles on-chain but the UX feels like calling any normal API. I'm also building MCP (Model Context Protocol) integration so that AI agents can discover APIs on the marketplace and pay for them on their own. The goal is that an agent should be able to find a tool it needs, check the price, and just use it without a human having to approve every single payment. This turns Spigot into infrastructure for agent-to-API commerce, where machines can autonomously buy and consume services. The backend is built with Express and SQLite, the frontend is Next.js, and all on-chain settlement uses EIP-3009 transferWithAuthorization on Arc Testnet so there's no gas cost for the end user.
How it's made
The backend is an Express server written in TypeScript that handles API registration, user accounts, credit management, and the payment proxy. All state lives in SQLite, which keeps things simple and means there's no database server to manage. When a publisher registers an API, they provide the upstream URL and set a per-call price in USDC. The backend stores this and exposes it through a REST API that the frontend consumes. The payment flow is where it gets interesting. I'm using EIP-3009 (transferWithAuthorization) on Arc Testnet for nanopayments. This is a standard that lets a user sign a USDC transfer off-chain, and then anyone can submit that signature on-chain to execute the transfer. The benefit is that the caller doesn't pay gas and doesn't see a wallet popup on every API call. They sign once when they top up, and from there the platform handles settlement per request. The backend acts as a facilitator that verifies the payment authorization, forwards the API call to the publisher's upstream server, and streams the response back to the consumer. It's essentially a paid reverse proxy. The frontend is a Next.js app with Tailwind CSS. It talks to the backend through Next.js rewrites so the browser only ever hits the Next origin, which keeps the httpOnly session cookie same-site and avoids CORS issues entirely. The marketplace page lets consumers browse and search APIs, and the sidebar shows their live USDC balance on Arc Testnet. Authentication is handled through Google Identity Services. For MCP integration, the plan is to expose the marketplace as a set of MCP tools so that AI agents can discover available APIs, check pricing, and make paid calls programmatically. This means an LLM agent could autonomously find and pay for a tool it needs without human intervention. One thing that's a bit hacky but works well is how the payment verification and API proxying happen in a single request cycle. The consumer makes a normal HTTP call to Spigot's gateway endpoint, the server checks their balance, deducts the cost, forwards to the upstream API, and pipes the response back. From the consumer's perspective it looks like a regular API call, but there's a full payment settlement happening in between.