惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
量子位
月光博客
月光博客
罗磊的独立博客
宝玉的分享
宝玉的分享
博客园_首页
酷 壳 – CoolShell
酷 壳 – CoolShell
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
博客园 - 叶小钗
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
雷峰网
雷峰网
博客园 - 三生石上(FineUI控件)
Jina AI
Jina AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
美团技术团队
爱范儿
爱范儿
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Y
Y Combinator Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How I Built a 120-Endpoint x402 API Marketplace in a Week...
吴增海 · 2026-05-24 · via DEV Community

吴增海

How I Built a 120-Endpoint x402 API Marketplace in a Weekend (And Why It Matters)

Building the "Swiss Army Knife" for AI Agents on the x402 protocol


The Problem

I've been building on the x402 protocol — Coinbase's micropayment standard for AI agents. The idea is beautiful: agents call APIs, pay per request with USDC, no API keys, no subscriptions. It's the HTTP of agent commerce.

But there was a gap. When I looked at the existing services, they were all single-purpose:

  • BlockRun: AI chat completions
  • OttoAI: AI chat completions
  • Aubr: AI search

One API = one task. An agent that needs a price chart, a weather report, a blockchain lookup, and an AI chat — that's four different x402 integrations.

That's when I realized: nobody had built the "everything API" for agents.


The Idea

What if one API could do everything an agent needs?

  • Blockchain: 🪙 BTC price, gas fees, wallet balances, ENS lookup, DeFi insights
  • AI: 🤖 Chat, code, translation, image generation, video generation
  • Weather: 🌤️ Current, forecast, historical
  • Social: 🐦 Twitter, Discord, Telegram, Instagram, TikTok
  • Search: 🔍 Web search, arXiv, GitHub
  • E-commerce: 🛒 Product search, reviews
  • Finance: 💱 Forex, stocks, commodities
  • Utilities: ✉️ Email verification, IP lookup, domain WHOIS, URL shorten
  • Security: 🔐 AML screening, KYC verification, phishing detection
  • PI: 🏢 RWA, real estate, credit scoring, bond data

120 endpoints. 20+ categories. One API.

That's GoldBean.


The Tech Stack

The stack is refreshingly simple:

GoldBean = Express.js + x402 micropayments + ChatGPT

Architecture

┌─────────────┐     ┌─────────┐     ┌──────────────┐
│   AI Agent  │────▶│ nginx   │────▶│  GoldBean    │
│ (x402 SDK)  │     │ (SSL)   │     │ (Express.js) │
└─────────────┘     └─────────┘     └──────────────┘
                                            │
                                     ┌──────┴──────┐
                                     │  Base Chain  │
                                     │  (USDC on   │
                                     │  eip155:8453)│
                                     └─────────────┘

The flow is elegant:

  1. Agent discovers GoldBean via /.well-known/x402 or /openapi.json
  2. Agent calls /paid/llm-chat → gets back HTTP 402 Payment Required
  3. 402 response includes Payment-Required header (base64-encoded JSON: amount, network, payTo)
  4. Agent pays via x402 → gets back a payment receipt → retries with it
  5. GoldBean validates → serves the response

No API keys. No auth. No subscriptions. Just pay and use.


The Hardest Part: Getting Registered on x402scan

This deserves its own section because it took longer than building the API.

What x402scan expects

The x402scan scanner validates four things:

  1. /.well-known/x402 — discovery endpoint
  2. /openapi.json — the canonical API contract
  3. /openapi.json has x-payment-info on paid endpoints
  4. Endpoint returns proper HTTP 402 with Payment-Required header

The 402 Header Format (V2)

Here's the format that works (took 6+ iterations to nail):

{
  "x402Version": 2,
  "accepts": [{
    "scheme": "exact",
    "network": "eip155:8453",
    "amount": "40000",
    "asset": "0x833589f...",
    "payTo": "0x7484b0...",
    "maxTimeoutSeconds": 300
  }],
  "resource": {
    "url": "https://goldbean-api.xyz/paid/llm-chat",
    "description": "llm-chat",
    "mimeType": "application/json"
  }
}

Lessons learned:

  • x402Version must be a number (not string)
  • amount is in atomic units (USDC = 6 decimals, so $0.04 = "40000")
  • amount must be a string (not number)
  • Body must be empty {} (V2 moves all payment info to headers)
  • The response must have Cache-Control: no-store
  • Add BOTH Payment-Required AND x-payment-required headers for compatibility

I built an x402-check tool to verify format — it saved me hours of debugging.

The Schema Trap

Getting 31/120 endpoints registered was easy. The remaining 89 all failed with:

Missing input schema

The fix: every endpoint needs a proper input schema in OpenAPI so the scanner can construct a valid test request. A parameter like address for address lookups, prompt for chat endpoints, lat/lon for weather. The scanner reads the OpenAPI, builds a probe request, and expects 402. Without input schemas, it can't even probe.


What Running 120 Endpoints Actually Looks Like

The Good

One server process. One domain. One integration. 120 capabilities.

npx agentcash try https://goldbean-api.xyz

Boom. Your agent can now check BTC price, get a weather forecast, generate an image, analyze sentiment, and chat with an LLM — all through a single API with a single $USDC wallet.

The Reality Check

$0 revenue. 0 buyers. 0 transactions.

Registration doesn't equal usage. The next phase is getting actual agents to call the endpoints. That means:

  1. Dev.to / Medium — telling the story
  2. Community — showing up on x402 Discord/Twitter
  3. Free trials — first 10 calls free to lower the barrier
  4. Self-hosting — running automated calls to generate initial tx records (who wants to be the first buyer of a zero-tx service?)

What's Next

Phase What When
🚀 All 120 endpoints on x402scan This week
📝 dev.to/Medium article series This week
🐦 Twitter/X presence (@x402 ecosystem) This week
🆓 Free trial mechanism Next week
📊 Operations dashboard Next week
🔌 Marketplace platform (3rd-party endpoints) June

Why I'm Building This

The x402 protocol is going to be huge. 480,000+ agents already transacting, $165M+ in agent-to-agent commerce on Base chain.

But the infrastructure is still early. Most x402 services are single-purpose. GoldBean is my bet that agents need a general-purpose API — one they can call for anything, without worrying about "does this endpoint support x402?"

120 endpoints down. 200+ on the roadmap.

Let's see where this goes.


Built with ☕ and x402. Check us out: https://goldbean-api.xyz