Any token on Robinhood Chain
Price in native ETH, WETH, USDC, Robinhood Stock Tokens or any ERC-20 you register by address. The agent pays in the first token its budget allows.
- ETH
- WETH
- USDC
- Stock Tokens
- any ERC-20
Vault402 adds HTTP 402 payments to any API. Agents pay in ETH, USDC or Stock Tokens on Robinhood Chain, retry, and get the response, within a budget you set.
MIT licensed · TypeScript · Express middleware
For sellers
One middleware turns an Express endpoint into a paid one. Your handler only runs after the payment is confirmed on-chain.
import { requirePayment, ETH } from 'vault402';
app.get('/v1/report',
requirePayment({
network: 'robinhood',
payTo: '0xYourWallet',
price: [
{ token: USDC, amount: '0.25' },
{ token: ETH, amount: '0.0001' },
],
access: { type: 'pass', durationSeconds: 3600 },
}),
(req, res) => res.json(report)
);import { createAgentClient } from 'vault402';
const agent = createAgentClient({
account: process.env.AGENT_PRIVATE_KEY,
network: 'robinhood',
budget: [
{ token: USDC, maxPerPayment: '1', maxTotal: '20' },
],
});
// Pays the 402 if it fits the budget, then retries.
const res = await agent.fetch('https://api.example.com/v1/report');For buyers
agent.fetch() works like fetch, except that it can pay. It refuses any offer outside the budget and never pays twice for one request.
Built in
Price in native ETH, WETH, USDC, Robinhood Stock Tokens or any ERC-20 you register by address. The agent pays in the first token its budget allows.
Agents sign an EIP-3009 authorization and your server submits it. The agent's wallet needs no ETH.
One payment can cover an hour of calls, or a hundred. Agents reuse the access token automatically.
Each 402 response includes a single-use paymentId. It has to appear in the transfer calldata or as the EIP-3009 nonce, and the server redeems it once, so the same transfer can never unlock two responses.
transfer(0xSeller…, 250000) ‖ 0x6f1c…a9
How it works
A thin layer over plain HTTP. The full wire format is in the protocol reference.
01
The agent calls your API. With no payment attached, the server replies 402 with a single-use paymentId and the tokens it accepts.
02
The agent picks an offer within its budget. It either sends a transfer carrying the paymentId or signs an EIP-3009 authorization.
03
The same request goes out again with an X-PAYMENT header containing the transaction hash or the signed authorization.
04
The server confirms the payment on Robinhood Chain, marks the paymentId as used, and runs your handler.
The token
The token of the Vault402 network, on Robinhood Chain. This is the only official contract; check the address before you trade.
0x1f5C3FED482AeFf409b955B3ad371678c08e91E2Vault402 is an open-source TypeScript SDK for HTTP 402 Payment Required. An API answers unpaid requests with a 402 and a price list. An AI agent pays on Robinhood Chain and retries the request, and the server checks the payment on-chain before serving the response.
Robinhood Chain, an Ethereum Layer 2 built on Arbitrum. It supports mainnet (chain ID 4663) and testnet (chain ID 46630). Gas is paid in ETH.
Native ETH, WETH, USDC, Robinhood Stock Tokens, or any other ERC-20 the seller registers. A seller can list several prices, and the agent pays with the first token in its budget.
Not when paying in USDC or another EIP-3009 token. The agent signs a transferWithAuthorization message and the seller's server submits it and pays the gas. For other tokens, the agent sends the transfer itself and pays gas in ETH.
Yes. A payment can buy one request (one-time), unlimited requests for a set time (pass), or a fixed number of requests (credits). For passes and credits the agent gets an access token and reuses it on later calls.
Agent Vault ($AGENT) is the token of the Vault402 network. It is an ERC-20 on Robinhood Chain (chain ID 4663) with a total supply of 1,000,000,000. The official contract address is 0x1f5C3FED482AeFf409b955B3ad371678c08e91E2. Check the address before you trade.
Every 402 response includes a single-use paymentId. The payment must carry it, either in the transfer calldata or as the EIP-3009 nonce, and the server accepts each paymentId only once. On the agent side, a required budget caps which tokens it can spend and how much per payment and in total.
Install the SDK, or give your agent one command and let it set itself up.
$ npm install vault402