<?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: FiatDock</title>
    <description>The latest articles on DEV Community by FiatDock (@fiatdock).</description>
    <link>https://dev.to/fiatdock</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3980352%2F37c07b3a-96f0-491a-8362-1e5db07e80e4.png</url>
      <title>DEV Community: FiatDock</title>
      <link>https://dev.to/fiatdock</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fiatdock"/>
    <language>en</language>
    <item>
      <title>How my AI agent cashes out its USDC earnings to a bank account</title>
      <dc:creator>FiatDock</dc:creator>
      <pubDate>Fri, 12 Jun 2026 02:03:42 +0000</pubDate>
      <link>https://dev.to/fiatdock/how-my-ai-agent-cashes-out-its-usdc-earnings-to-a-bank-account-3a8b</link>
      <guid>https://dev.to/fiatdock/how-my-ai-agent-cashes-out-its-usdc-earnings-to-a-bank-account-3a8b</guid>
      <description>&lt;p&gt;My agent earns USDC. It sells API calls priced with &lt;a href="https://www.x402.org" rel="noopener noreferrer"&gt;x402&lt;/a&gt;, so tiny payments accumulate in its wallet. Which eventually raises the unglamorous question every "agents earning money" demo skips: &lt;strong&gt;how does that USDC become money a human can spend at a supermarket?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here is the pattern I landed on. It needs no exchange account for the agent, no API keys, and — importantly — nobody in the middle ever holds the funds.&lt;/p&gt;

&lt;h2&gt;
  
  
  The constraint that shapes everything
&lt;/h2&gt;

&lt;p&gt;Whatever converts crypto to fiat is regulated activity (KYC/AML, custody, payments). An autonomous agent can't and shouldn't do that part. So the design splits cleanly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The agent&lt;/strong&gt; handles quotes, session creation, payment of fees, and status tracking — all machine-to-machine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A licensed provider&lt;/strong&gt; (Transak, in this case) does the conversion, the KYC, and the custody.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The human owner&lt;/strong&gt; confirms the final transfer once per session, and completes KYC exactly once, ever.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The service tying these together is &lt;a href="https://fiatdock.com" rel="noopener noreferrer"&gt;FiatDock&lt;/a&gt; — a thin technology layer that never touches funds. One rule is binding and worth stating up front: &lt;strong&gt;the wallet sending USDC and the bank account receiving fiat must belong to the same person — the agent's owner.&lt;/strong&gt; No third-party funds, no aggregation, no P2P.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1 — the agent checks the rate (free)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"https://fiatdock.com/v1/quote?side=SELL&amp;amp;cryptoAmount=50"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No auth, no signup. The response itemises every fee (including the service's 1% commission) and the exact amount that lands in the bank account. My agent calls this before deciding whether cashing out now is worth it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 — the agent pays for a session with x402
&lt;/h2&gt;

&lt;p&gt;Paid endpoints don't use API keys. An unpaid request returns HTTP &lt;strong&gt;402&lt;/strong&gt; with exact payment requirements — asset, network, amount ($0.05 USDC), and the address. The agent signs the payment from its own wallet and retries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;wrapFetchWithPayment&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;x402-fetch&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;privateKeyToAccount&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;viem/accounts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;payFetch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;wrapFetchWithPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;privateKeyToAccount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;AGENT_PRIVATE_KEY&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;payFetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://fiatdock.com/v1/offramp/session&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;content-type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;cryptoAmount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;owner@example.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;customerId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;agent-1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;checkoutUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;partnerOrderId&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Payment, authentication, and rate-limiting collapse into one signed transfer. That's the whole x402 trick, and it's why this works for agents that can't fill out a signup form.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3 — hand the human the link
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;checkoutUrl&lt;/code&gt; is single-use and valid about five minutes. My agent just messages it to me. I open it, the licensed provider runs KYC (first time only — afterwards it remembers), and I confirm. USDC goes from the wallet straight to the provider; EUR lands in my bank account. The agent never saw a bank credential, and FiatDock never held a cent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4 — the agent confirms completion
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl https://fiatdock.com/v1/orders/&lt;span class="nv"&gt;$ORDER_ID&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or pass a &lt;code&gt;callbackUrl&lt;/code&gt; in step 2 and verify the &lt;code&gt;X-FiatDock-Signature&lt;/code&gt; HMAC header on each push. Either way the agent knows when the money arrived and goes back to work.&lt;/p&gt;

&lt;h2&gt;
  
  
  The reverse direction — topping up the agent (on-ramp)
&lt;/h2&gt;

&lt;p&gt;The same pattern works the other way when the agent needs working capital. &lt;code&gt;POST /v1/onramp/session&lt;/code&gt; (also $0.05 via x402) creates a top-up session with the &lt;strong&gt;destination locked to the agent's own wallet address&lt;/strong&gt;; the owner opens the checkout link, pays EUR from their own bank or card, and USDC lands in the agent's wallet. Quotes for this direction are the same free call with &lt;code&gt;side=BUY&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s2"&gt;"https://fiatdock.com/v1/quote?side=BUY&amp;amp;fiatAmount=100"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One flow out, one flow in — and the same binding rule in both directions: the fiat side is always the owner's own account, the crypto side is the owner's agent wallet. Nothing crosses between strangers.&lt;/p&gt;

&lt;h2&gt;
  
  
  If your agent speaks MCP, it's even shorter
&lt;/h2&gt;

&lt;p&gt;The whole flow above is wrapped in four MCP tools (&lt;code&gt;get_quote&lt;/code&gt;, &lt;code&gt;create_offramp_session&lt;/code&gt;, &lt;code&gt;create_onramp_session&lt;/code&gt;, &lt;code&gt;get_order_status&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"fiatdock"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"fiatdock-mcp"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"AGENT_PRIVATE_KEY"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0x..."&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That config works as-is in Claude Desktop, Cursor, Windsurf, and Gemini CLI; there's a remote endpoint (&lt;code&gt;https://fiatdock.com/mcp&lt;/code&gt;) for zero-install hosts, and a &lt;a href="https://fiatdock.com/tools.json" rel="noopener noreferrer"&gt;tools.json&lt;/a&gt; with OpenAI/Gemini function-calling schemas if you're not using MCP at all. It's in the official MCP Registry as &lt;code&gt;com.fiatdock/fiatdock-mcp&lt;/code&gt;. Per-client configs live in &lt;a href="https://github.com/fiatdock/fiatdock/blob/main/docs/INTEGRATIONS.md" rel="noopener noreferrer"&gt;INTEGRATIONS.md&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Honest limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Eligibility: 18+, Portugal + Transak-supported EU/EEA countries — &lt;strong&gt;not&lt;/strong&gt; the UK or restricted jurisdictions (&lt;a href="https://fiatdock.com/terms" rel="noopener noreferrer"&gt;full list&lt;/a&gt;). The restrictions come from the licensed provider's coverage.&lt;/li&gt;
&lt;li&gt;Quotes are indicative; crypto is volatile; none of this is investment advice.&lt;/li&gt;
&lt;li&gt;The human stays in the loop by design. That's a feature, not a missing automation — it's what keeps the whole thing compliant.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything is documented machine-first if you want to point your own agent at it and let it figure things out: &lt;a href="https://fiatdock.com/llms.txt" rel="noopener noreferrer"&gt;llms.txt&lt;/a&gt; · &lt;a href="https://fiatdock.com/openapi.json" rel="noopener noreferrer"&gt;OpenAPI&lt;/a&gt; · &lt;a href="https://github.com/fiatdock/fiatdock" rel="noopener noreferrer"&gt;repo&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>web3</category>
      <category>payments</category>
    </item>
  </channel>
</rss>
