<?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: livepairai</title>
    <description>The latest articles on DEV Community by livepairai (@livepairai23).</description>
    <link>https://dev.to/livepairai23</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%2F4172494%2Fd40551c3-784e-4e77-8aad-41c840814366.png</url>
      <title>DEV Community: livepairai</title>
      <link>https://dev.to/livepairai23</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/livepairai23"/>
    <language>en</language>
    <item>
      <title>I built an MCP server where AI agents pay for their own compute in USDC</title>
      <dc:creator>livepairai</dc:creator>
      <pubDate>Fri, 09 Oct 2026 04:51:34 +0000</pubDate>
      <link>https://dev.to/livepairai23/i-built-an-mcp-server-where-ai-agents-pay-for-their-own-compute-in-usdc-57g3</link>
      <guid>https://dev.to/livepairai23/i-built-an-mcp-server-where-ai-agents-pay-for-their-own-compute-in-usdc-57g3</guid>
      <description>&lt;p&gt;Agents can browse docs and call APIs, but they can't do checkout. No credit card form, no OAuth dance, no "verify your email". So when I shipped an AI generation API, the interesting question was: how does an agent &lt;em&gt;pay&lt;/em&gt;?&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;An MCP server (&lt;code&gt;https://livepairai.com/mcp&lt;/code&gt;, streamable HTTP) exposing ~70 image/video models behind one interface. An agent connects, lists models with prices, calls &lt;code&gt;generate&lt;/code&gt;, and gets back either a result or an &lt;code&gt;HTTP 402&lt;/code&gt; with payment requirements.&lt;/p&gt;

&lt;p&gt;The payment rail is &lt;strong&gt;x402&lt;/strong&gt; — USDC on Base. The flow:&lt;/p&gt;

&lt;p&gt;POST /v1/agent/generate {model, prompt}&lt;br&gt;
← 402 Payment Required&lt;/p&gt;

&lt;p&gt;x-payment-requirements: {amount: "400000", currency: USDC, chain: base, payTo} → agent signs USDC transfer, retries with X-PAYMENT header ← 200 + result URL (hosted 48h, auto-deleted)&lt;/p&gt;

&lt;p&gt;One HTTP round-trip pattern. No API key, no account, no session — the payment signature &lt;em&gt;is&lt;/em&gt; the credential.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually happens inside
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Model catalog with live per-call pricing: &lt;code&gt;GET /v1/agent/models&lt;/code&gt; (5s 720p video ≈ $0.40, images ≈ $0.02–0.05)&lt;/li&gt;
&lt;li&gt;Quote freshness was the annoying part — prices are per-result, so the 402 response carries a short-lived quote the agent must settle before expiry&lt;/li&gt;
&lt;li&gt;For humans/API keys there's a chat-completions-compatible surface instead, so integrators who want accounting get &lt;code&gt;Authorization: Bearer lp_…&lt;/code&gt; and skip the wallet dance entirely&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Failure modes I hit
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Agents that retry the original request &lt;em&gt;without&lt;/em&gt; attaching payment — had to make the 402 body self-describing (amount, recipient, expiry, example header) so a generic agent could act on it without me hardcoding the client&lt;/li&gt;
&lt;li&gt;Wallet-funded agents settling twice on timeout — made fulfillment idempotent on the payment reference&lt;/li&gt;
&lt;li&gt;The privacy constraint shaped the storage layer: renders live 48h max, never indexed, share links are a separate opt-in path gated by model&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;MCP endpoint: &lt;code&gt;https://livepairai.com/mcp&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Agent docs: &lt;code&gt;https://livepairai.com/SKILL.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Manifest: &lt;code&gt;https://livepairai.com/v1/agent/manifest.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your agent has a USDC wallet, it can already use this. Curious how others are handling &lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>api</category>
      <category>nanobanana</category>
    </item>
  </channel>
</rss>
