explaingit

verge402/verge

Analysis updated 2026-05-18

22TypeScriptAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

A TypeScript middleware that lets an API charge AI agents a small USDC payment on the Base blockchain before responding, settling in about 400 milliseconds.

Mindmap

mindmap
  root((repo))
    What it does
      HTTP 402 paywall
      USDC payments
      Base settlement
    Tech stack
      TypeScript
      Next.js
      Express
    Use cases
      Charge agents per request
      Self host facilitator
      Publish npm middleware
    Audience
      Developers
      AI agent builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add a paywall to an API route so AI agents must pay a small USDC amount on Base before getting a response

USE CASE 2

Publish the Express middleware package to charge per-request fees on your own API endpoints

USE CASE 3

Self-host the facilitator to avoid the 0.5% fee and run payment verification against your own Base RPC

What is it built with?

TypeScriptNext.jsReactExpressTailwind CSSBase blockchainUSDC

How does it compare?

verge402/vergeaerdelan/housand-domaintoolmatrixalibaba/webmcp-nexus
Stars222222
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderateeasymoderate
Complexity3/52/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a Base wallet address and USDC set up to receive payments, self-hosting needs your own Base RPC connection.

MIT license: free to use, modify, and distribute, including commercially, as long as the copyright notice is kept.

In plain English

verge is a TypeScript project that adds HTTP 402 "Payment Required" support to any web API, so an endpoint can require a small payment before it responds. It targets AI agents and other automated clients that want to pay for API access per request instead of through a subscription or an API key. The core idea is a piece of middleware you add to an existing server. Once installed, a protected route checks for a payment before letting the request through. The payment is made in USDC, a US dollar backed stablecoin, on Base, an Ethereum compatible blockchain network known for low transaction fees and fast block times of around 400 milliseconds. The README argues that Base is one of the few networks where this makes sense: on Ethereum's main chain, network fees would exceed a payment of a fraction of a cent, and card processors like Stripe have a minimum transaction size well above that too. The repository contains a Next.js website with documentation and a demo, and a separate SDK folder that builds the Express middleware package meant to be published to npm. Setting it up as a developer means installing dependencies and running the Next.js app locally, or building the SDK package on its own. Using the middleware in an existing project takes a few lines of code: you import a paywall function and call it with the payment amount, your wallet address, and the network. The project is offered as a hosted facilitator that takes a 0.5 percent fee per payment while verifying transactions on-chain, or the code can be self-hosted for free if you run your own Base RPC connection. Planned future work listed in the README includes support for other web frameworks, a self-hosted facilitator binary, a marketplace listing paid endpoints, and batch settlement using zero-knowledge proofs. The project is released under the MIT license. This is aimed at developers building AI agents or automated services who want a lightweight way to charge for API access without setting up a full billing system.

Copy-paste prompts

Prompt 1
Add the verge express paywall middleware to my Express API so an endpoint charges 0.001 USDC on Base before responding.
Prompt 2
Explain how HTTP 402 micropayments work in this repo and why Base is used instead of Ethereum mainnet or Stripe.
Prompt 3
Show me how to build and publish the sdk/express package from this repo to npm.
Prompt 4
Walk me through self-hosting the Verge facilitator on my own Base RPC instead of using the hosted 0.5% fee service.

Frequently asked questions

What is verge?

A TypeScript middleware that lets an API charge AI agents a small USDC payment on the Base blockchain before responding, settling in about 400 milliseconds.

What language is verge written in?

Mainly TypeScript. The stack also includes TypeScript, Next.js, React.

What license does verge use?

MIT license: free to use, modify, and distribute, including commercially, as long as the copyright notice is kept.

How hard is verge to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is verge for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.