Why I built a naira rate API that AI agents pay for by the call
"Every Nigerian business quotes dollars at two prices. I built an API that gives software both, and charges a cent a call with no sign-up."
Ask anyone in Nigeria what a dollar costs and you'll get two answers: the official rate and the street rate. The gap between them decides how a trader prices goods, how a freelancer invoices, and how much a family receives when someone abroad sends money home.
People handle this by asking around, checking a WhatsApp group, or opening three apps. Software can't do that. And as more businesses lean on AI agents to quote prices, pay invoices or move money, those agents need both rates, live, every time.
That's the problem behind Naira Rates API, which I built for Celo's Agents on Open Rails hackathon.
What it does
It's a small API with two paid endpoints:
/v1/ratesreturns the official USD/NGN rate, street rates from Quidax and Luno, the premium between them, and a plain-English summary. It costs $0.01 a call./v1/convertconverts between USD and NGN at either the official or street rate. It costs $0.003 a call.
The official rate comes from open.er-api.com, the street rates from Quidax and Luno's USDT/NGN tickers, and results are cached for 60 seconds.
No accounts, no API keys
This is the part I care about most. Most data APIs make you sign up, verify an email, add a card and manage a key. A human can push through that. An AI agent can't, and it shouldn't have to.
So the API uses x402, a standard that puts the old HTTP 402 "Payment Required" status to work. An agent calls the endpoint and gets a 402 back with the price. It signs a gasless USDT payment on Celo, retries, and gets the data. Each payment settles in about nine seconds, and the buyer pays no gas.
That means the API can sell to anyone or anything with a wallet, a cent at a time, without me running a billing system.
Why this matters for Nigerian builders
A lot of what we call "fintech" here is really about one thing: getting accurate prices and moving value without friction. Pay-per-call data is a quiet way to do both. A small developer can sell a useful service to the world without building accounts, subscriptions or payment plumbing first, and get paid in a stablecoin the moment it's used.
I also added a demo mode, so anyone can run it locally with no keys, wallets or funds and see exactly what it returns.
What's next
The code is open source under the MIT license. Next I'm deploying it publicly and registering it on-chain as an agent identity (ERC-8004), so other agents can discover it and pay for it on their own.
If you're building agents that touch money in Nigeria, I'd love to hear what data you wish you could buy by the call.