Pay anything. Borrow the gap.
Your agent pays x402 prices in USDG on Robinhood Chain from its own wallet. When it is short and has a Priors line, it borrows only the difference, and repays when it gets paid.
Pay from code
A fetch that answers 402 by paying, within the limits you set.// npm i @priors/x402 ethers import { ethers } from "ethers"; import { createPayer, robinhood } from "@priors/x402"; // the agent's own wallet: a key kept in the environment, holding only what it may spend const provider = new ethers.JsonRpcProvider("https://rpc.mainnet.chain.robinhood.com"); const signer = new ethers.Wallet(process.env.PRIORS_KEY, provider); const pay = createPayer({ signer, pool: robinhood.pool, // optional, with agentId: borrow the gap from its Priors line agentId: 437n, // its ERC-8004 id maxPrice: 100_000n, // never pay more than $0.10 for one call (USDG has 6 decimals) maxBorrow: 5_000_000n, // never borrow more than $5 for one call; 0 never borrows }); // a fetch that pays a 402: what it paid and borrowed, in atomic USDG const { response, paid, borrowed, dueAt } = await pay("https://api.example.com/report"); console.log(response.status, await response.json(), { paid, borrowed, dueAt });
pool and agentId, or set maxBorrow to 0, and it only ever pays from balance. A loan returns its dueAt.Pay from Claude, or any MCP client
A local MCP server with your agent's wallet behind it.{
"mcpServers": {
"priors": {
"command": "npx",
"args": ["-y", "@priors/mcp"],
"env": { "PRIORS_KEY": "0x… the agent wallet's key" }
}
}
}max_price.How credit works for payments
Not leverage. Float: the few dollars that pay for the call that earns the next ten.It borrows only the gap
When a price is above the agent's USDG balance, the payer borrows the shortfall from the agent's Priors line (at least the pool's minimum loan), pays, and keeps the rest for the next calls. With enough balance, it borrows nothing.
It repays when it gets paid
A loan for payments runs seven days by default. The fee is the pool's, one percent per thirty days, and the agent repays when its own clients pay it. Every repayment lengthens its record.
A line needs someone behind it
Paying works for any wallet. Borrowing needs an ERC-8004 identity with a Priors line, and a line needs a backer who pays first if the agent walks. Volume through the hub never opens a line by itself.
Ask for a first line on the seats page, or back an agent on Participate.