Building VeraData: An x402 API That Lets AI Agents Pay for Real-Time LATAM Data
I spent the last few days building VeraData — an API where autonomous AI
agents pay per-call for verified Latin American data using x402
micropayments, instead of API keys or subscriptions.
No accounts. No contracts. An agent discovers the endpoint, pays $0.02–$0.10
in USDC, gets structured JSON back.
The problem
If you're building an AI agent that needs to verify a Colombian company,
check sanctions lists, or get Argentina's parallel exchange rate, there's
no clean API for that. You end up scraping government portals or stitching
together five different sources.
LATAM data infrastructure for autonomous agents basically doesn't exist yet.
What I built
Five endpoints, six countries (Colombia, Mexico, Brazil, Chile, Peru, Argentina):
/rates ($0.02) — Central bank rates. Colombia's TRM/DTF, Mexico's TIIE,
Brazil's Selic/CDI, and Argentina's dólar blue (the parallel exchange rate
everyone uses but no official source publishes).
/sanctions ($0.05) — Screens against OFAC + regional AML lists
(SARLAFT Colombia, CNBV Mexico, COAF Brazil, UAF Chile). Returns a risk
score plus a SHA-256 hash chain per agent — built for EU AI Act Art.12
audit trail requirements (enforcement starts August 2, 2026).
/sanctions/zkp ($0.05) — Same screening, but the name never reaches
my server. The client computes SHA256(normalized_name + salt) and sends
only the commitment hash. I verify against precomputed commitments from
the sanctions database. GDPR Art.25 compliant by construction.
/entity ($0.03) — Company lookup from official registries (Colombia's
RUES, Brazil's Receita Federal, Mexico's SAT).
/context ($0.10) — Market intelligence powered by Claude Sonnet 4.6.
Try it (no signup needed)
curl -X POST https://api.veradata.dev/rates \
-H "Content-Type: application/json" \
-H "X-TRIAL: true" \
-d '{"country": "AR"}'
{
"usd_ars": 1496.0,
"usd_ars_blue": 1515.0,
"blue_spread_pct": 1.27,
"data_freshness": "live"
}
5 free trial calls per endpoint per day. After that, pay with X-PAYMENT
header signed via EIP-3009.
Why x402 instead of a normal REST API + API key
The interesting part wasn't the data — it's all public (central banks,
government registries). The interesting part was building something an
autonomous agent can use without a human in the loop.
A traditional API requires: sign up, get a key, store it securely, manage
billing. None of that works for an agent spinning up on its own to verify
a transaction.
x402 flips it: agent sends a request, gets a 402 with payment instructions,
signs a payment with its own wallet, retries. No account ever created.
# the whole auth flow for an agent, conceptually
response = requests.post(url, json=payload)
if response.status_code == 402:
payment = sign_payment(response.headers['PAYMENT-REQUIRED'])
response = requests.post(url, json=payload, headers={'X-PAYMENT': payment})
The compliance angle
This is the part I didn't expect to matter as much as it does. EU AI Act
Article 12 requires tamper-evident audit trails for AI systems making
decisions about people. Most teams don't have this built yet — fragmented
logs across systems isn't the same as a verifiable chain.
Every /sanctions call I serve generates:
query_hash → event_hash → chain_hash (linked to the previous chain_hash)
Each call references the hash of the previous one for that agent_id.
Tamper-evident by construction — change any past record and the chain breaks.
What's running in production
- FastAPI + Supabase + Render
- x402 v2 over Base and Solana (USDC)
- Circuit breaker between CDP and PayAI facilitators (3 failures → 60s cooldown)
- MCP server, so it works directly in Claude Desktop / Claude Code
- A2A discovery manifest for agent-to-agent protocols
curl https://api.veradata.dev/.well-known/a2a-agent.json
What I'm still working on
- Cross-verification across multiple registries for higher confidence scores
- Expanding sanctions lists with daily auto-updates
- Uruguay and Paraguay coverage
If you're building AI agents that touch LATAM markets — compliance, fintech,
DeFi, market research — I'd love feedback on what's missing.
Repo: https://github.com/teodorofodocrispin-cmyk/veradata-public
Top comments (0)