<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eduardo Moncada</title>
    <description>The latest articles on DEV Community by Eduardo Moncada (@eduardo_moncada_dfec353a2).</description>
    <link>https://dev.to/eduardo_moncada_dfec353a2</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4111507%2F04f9c9b9-1f44-4985-a100-584d4cfe2bad.png</url>
      <title>DEV Community: Eduardo Moncada</title>
      <link>https://dev.to/eduardo_moncada_dfec353a2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eduardo_moncada_dfec353a2"/>
    <language>en</language>
    <item>
      <title>I Built an API That AI Agents Pay For in USDC — Real-Time P2P Crypto Rates for 15 Latin American Currencies</title>
      <dc:creator>Eduardo Moncada</dc:creator>
      <pubDate>Sat, 05 Sep 2026 18:46:24 +0000</pubDate>
      <link>https://dev.to/eduardo_moncada_dfec353a2/i-built-an-api-that-ai-agents-pay-for-in-usdc-real-time-p2p-crypto-rates-for-15-latin-american-1eii</link>
      <guid>https://dev.to/eduardo_moncada_dfec353a2/i-built-an-api-that-ai-agents-pay-for-in-usdc-real-time-p2p-crypto-rates-for-15-latin-american-1eii</guid>
      <description>&lt;p&gt;AI agents can't use API keys. They can't sign up for accounts, pass KYC, or enter credit card numbers. But they can hold a crypto wallet — and with the x402 protocol, that's all they need to pay for an API call.&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;LatAm P2P Data&lt;/strong&gt;: a paid API that sells real-time P2P order book data for USDT across 15 Latin American currencies. Agents pay $0.002 USDC per call on Base. No API keys, no accounts, no signup. The payment IS the auth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live:&lt;/strong&gt; &lt;a href="https://latamp2papi.dpdns.org" rel="noopener noreferrer"&gt;https://latamp2papi.dpdns.org&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this data?
&lt;/h2&gt;

&lt;p&gt;In Latin America, the P2P market IS the financial system. In Argentina, Venezuela, Nicaragua and most of the region, Binance P2P is how people actually move between local currency and dollars. The USDT/NIO or USDT/ARS rate is the &lt;em&gt;real&lt;/em&gt; exchange rate — not the official one.&lt;/p&gt;

&lt;p&gt;That data is valuable to trading agents, remittance tools, and market research bots. And nobody was selling it machine-to-machine. So I did.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;The x402 protocol revives HTTP status code &lt;strong&gt;402 Payment Required&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Agent calls &lt;code&gt;GET /p2p/nio&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Server responds &lt;code&gt;402&lt;/code&gt; with payment requirements (price, token, network, recipient)&lt;/li&gt;
&lt;li&gt;Agent signs a USDC payment authorization (EIP-3009, gasless)&lt;/li&gt;
&lt;li&gt;Agent retries with the &lt;code&gt;X-PAYMENT&lt;/code&gt; header&lt;/li&gt;
&lt;li&gt;The Coinbase CDP facilitator verifies and settles on-chain (~2 seconds)&lt;/li&gt;
&lt;li&gt;Agent gets the data&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Total human involvement: zero.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a call returns
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;GET /p2p/nio&lt;/code&gt; — $0.002 USDC:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
json
{
  "par": "USDT/NIO",
  "fuente": "Binance P2P",
  "mejor_venta_usdt": 36.42,
  "mejor_compra_usdt": 37.10,
  "spread": 0.68,
  "profundidad_anuncios": {"compra_usdt": 10, "venta_usdt": 10},
  "compra_usdt": [
    {
      "precio_nio": 36.42,
      "min_nio": 500,
      "max_nio": 50000,
      "disponible_usdt": 1372.5,
      "bancos": ["BAC", "Banpro", "Lafise"],
      "comerciante": "CryptoNica",
      "ordenes_mes": 421,
      "tasa_completado": 0.98
    }
  ]
}

Best buy/sell prices, spread, market depth, payment methods (local banks), and merchant reputation — for each of 15 currencies:

NIO · GTQ · HNL · CRC · PAB · DOP · MXN · COP · PEN · ARS · BOB · PYG · UYU · CLP · VES

There's also GET /p2p/latam ($0.01) that returns a regional summary of all 15 in one call.

The stack

- FastAPI + the official Python x402 SDK (PaymentMiddlewareASGI)
- Coinbase CDP facilitator for verification/settlement (accepts Base mainnet AND Base Sepolia for testing)
- Cloudflare Tunnel for a permanent public URL
- Binance P2P public API upstream, cached 60s per currency

The paid-route config is basically:

routes["GET /p2p/nio"] = RouteConfig(
    accepts=[
        PaymentOption(scheme="exact", pay_to=WALLET, price="$0.002", network="eip155:8453"),
        PaymentOption(scheme="exact", pay_to=WALLET, price="$0.002", network="eip155:84532"),
    ],
    mime_type="application/json",
    description="USDT/NIO P2P order book: best prices, spread, banks, depth",
)

One lesson: agent discovery directories don't understand path parameters. My first version used /p2p/{fiat} and x402scan rejected it with a 405. Explicit routes (/p2p/nio, /p2p/mxn, ...) with declared query-param input schemas fixed everything.

Try it

- Base URL: https://latamp2papi.dpdns.org
- OpenAPI: https://latamp2papi.dpdns.org/openapi.json
- Listing: find "LatAm P2P Data" on x402scan
- Testnet works: point your buyer at Base Sepolia (eip155:84532) with faucet USDC and you can test the full paid flow for free

If you're building a trading/remittance/research agent that touches Latin America, this is the missing data feed. And if you're building your own x402 API — do it. The whole thing took an afternoon, and the agent economy needs more than weather APIs.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>x402</category>
      <category>ai</category>
      <category>api</category>
      <category>web3</category>
    </item>
  </channel>
</rss>
