HTTP 402 is the web-native standard for payments. A frictionless machine-to-machine protocol that allows agents to pay for APIs, compute resources, and data.
h402 is a growing TypeScript project in the AI payments / x402 ecosystem, focused on 402, crypto, payments. It currently has 31 GitHub stars and 9 forks, and sits alongside related tools like agenti, x402-facilitator, exact.

HTTP 402 is the web-native standard for payments. Our mission is to design a frictionless machine-to-machine protocol that allows agents to pay for APIs, compute resources, and data using simple HTTP requests and native blockchain transactions scaling to billions of sub-cent microtransactions.
This unlocks a previously unattainable economic layer for AI-native commerce, while simultaneously delivering a best-in-class user experience for humans.
// This is an example of how our package can be integrated with NextJS middleware
// You can check out the sections below to find more implementation options
// Or reach out to us at [email protected]
export const middleware = h402NextMiddleware({
routes: {
"/api/paywalled_route": {
paymentRequirements: [
{
namespace: "evm",
tokenAddress: "0x55d398326f99059ff775485246999027b3197955", // USDT on BSC
tokenDecimals: 18,
tokenSymbol: "USDT",
amountRequired: 0.01, // 0.01 USDT
amountRequiredFormat: "humanReadable",
payToAddress: "0xd78d20FB910794df939eB2A758B367d7224733bc",
networkId: "56", // BSC Chain ID
},
],
},
}
});
export const config = {
matcher: ["/api/paywalled_route"],
};
This protocol builds on top of the scheme from x402, to ensure the continuation and adoption of a true open standard. You can check our FAQs to learn more.

Currently, h402 supports:
Networks:
Payment Types:
Payment schemes:
exact: Fixed amount payments with predefined valuesWe're actively expanding support for additional networks, tokens, and payment schemes. See our roadmap for upcoming implementations including Bitcoin, and new payment models like upto, streamed, and subscription.
HTTP 402 is the web-native standard for payments. Our mission is to design a frictionless machine-to-machine protocol that allows agents to pay for APIs, compute resources, and data using simple HTTP requests and native blockchain transactions, scaling to billions of sub-cent microtransactions.
This unlocks a previously unattainable economic layer for AI-native commerce, while simultaneously delivering a best-in-class user experience for humans.
We decided to create h402, which simply stands for HTTP 402, based on the open schemes provided by x402.
The reason for spinning off into a separate project comes down to a few key points, you can read them in our FAQs.md or at our website h402.xyz.
We're a fairly small team, so this repo is evolving rapidly we'll be updating it weekly (or even daily) with new details, schemes, and examples. In the meantime, if anything's missing or underspecified, you can check out the original x402 repository for reference. Eventually, this message will disappear because we genuinely believe this will become the leading implementation of the 402 protocol, or we will find a way to merge with x402.
In the example/ folder we've provided a simple demo of a Next webapp integrating both the facilitator (server) and the client to restrict access to a specific page under a 402 payment required response.
It works utilizing this package and its functionalities and provides a quick example of how such an integration can be made, including the UI for the wallet connection & send.
This project is set up as a pnpm monorepo workspace, allowing for seamless development across multiple packages.
The monorepo contains the following workspaces:
typescript/package: The main @bit-gpt/h402 packagetypescript/example: Example Next.js application using the packagetypescript/facilitator: Facilitator implementationInstall dependencies:
pnpm install
Run the example application:
pnpm dev:example
The monorepo is configured with the following workflow:
Dependency Management:
node_modules directoryworkspace:* syntaxBuild Process:
pnpm build: Builds all packages in the monorepo (use when you need to build everything)pnpm build:package: Builds only the main @bit-gpt/h402 package (sufficient for most development)pnpm clean: Cleans build artifacts from all packagesDevelopment Commands:
pnpm dev:example: Builds the main package and starts the example Next.js applicationConfiguration:
.npmrc file contains important configuration for the monorepopnpm-workspace.yaml defines the workspace package locationsTo add a new package to the monorepo:
package.json with the package detailspnpm-workspace.yamlpnpm install to update the workspaceIf you encounter "Module not found" errors when running the example:
pnpm buildThe only available scheme for now is exact, the types are the following.
All the types can be found here
See FAQs.md or our website h402.xyz
See ROADMAP.md.
Join our Discord community to stay up to date, contribute to feature development, and connect directly with our team.
See PLAYGROUND.md.
The h402 protocol is licensed under the Apache-2.0 license.
Give any AI agent a crypto wallet. Agents deserve access to money. Pay x402 APIs, receive USDC, check balances — autonomously. Works with Claude, LangChain, AutoGen, CrewAI, and any MCP client. EVM + Solana.
x402 payment facilitator — verifies and settles EIP-3009 micropayments multichain. v2 facilitator.
Implementation of exact scheme for fixed-amount Nano (XNO) payments over x402 protocol