You have an API. AI agents want to use it. But API keys don't work for autonomous agents that need to pay per request. Here's how to monetize your API with stablecoin payments in under 5 minutes — no code changes to your existing backend required.
The Problem: AI Agents Can't Use API Keys at Scale
Traditional API monetization relies on API keys, monthly subscriptions, and credit card billing. This works for human developers, but it breaks down for AI agents:
- Agents don't have credit cards.An autonomous agent running on a server can't fill out a Stripe checkout form.
- API keys are static.If you give 1,000 agents the same key, you can't track usage or enforce per-agent limits.
- Subscriptions don't fit. Agents might call your API once or a million times. Monthly plans are a bad fit for unpredictable, bursty usage.
- Cross-border payments are slow. Your agent users could be anywhere. Wire transfers and currency conversion add days of latency.
Stablecoins solve all of these problems. An agent can hold USDC in a wallet and pay per request — instantly, globally, with no intermediaries.
The Solution: Obolo's Payment Proxy
Obolo sits between agents and your API. It handles payment verification so you don't have to. Here's the setup:
Step 1: Create an Endpoint in the Dashboard
Sign up at dashboard.gateflow.io, connect your wallet, and create a new endpoint. You'll provide:
- Name — e.g., “Weather API”
- Upstream URL — your actual API endpoint (e.g.,
https://api.yourservice.com/v1/weather) - Allowed methods — GET, POST, etc.
Obolo generates a proxy slug for you, like weather-api-a1b2.
Step 2: Set Your Price
Set a price per API call in USD. Obolo accepts payment in USDC, USDT, USD1, and PYUSD across 8 blockchains (Base, Solana, TRON, Ethereum, Arbitrum, Optimism, Polygon, BSC).
You can also configure dynamic pricing rules — volume discounts, surge pricing, or time-of-day pricing — but a flat rate works fine to start.
Step 3: Share Your Proxy URL
Your API is now available at:
https://proxy.gateflow.io/v1/weather-api-a1b2That's it. Share this URL with agent developers. They pay, you earn. No changes to your backend code.
What Happens When an Agent Calls Your API
Here's the x402 payment flow, step by step:
- Agent sends a request to your proxy URL without payment headers.
- Obolo returns HTTP 402 Payment Required with a JSON body containing payment options — which chains, tokens, and amounts are accepted, plus the treasury wallet address to send payment to.
- Agent sends payment on-chain — a USDC transfer on Base, for example.
- Agent retries the request with the transaction hash in the
X-Payment-Hashheader and the chain inX-Payment-Chain. - Obolo verifies the payment on-chain — correct amount, correct recipient, not previously used.
- Obolo forwards the request to your upstream API and returns the response to the agent.
The entire flow takes 2-3 seconds on Base L2, including on-chain confirmation.
Getting Paid
Revenue accumulates in your Obolo dashboard. You have two off-ramp options:
- Crypto withdrawal — withdraw USDC directly to your wallet on any supported chain.
- Fiat off-ramp — convert to USD and withdraw to your bank account via Stripe, available in 100+ countries.
Obolo takes a 10% commission — automatically drops to 7% at $10K/month and 5% at $50K/month based on your prior month's volume. The rest is yours.
Next Steps
- Add dynamic pricing — reward high-volume agents with volume discounts.
- Configure failover — add backup upstream URLs so your API stays online even if your primary server goes down.
- List on the marketplace — make your API discoverable to thousands of agents browsing the Obolo marketplace.
- Install the SDK — use
@gateflow/sdkto add payment middleware directly to your Express, Next.js, or Fastify app for more control.
Have questions? Join our Discord or check out the documentation.