Alpha For teams whose agents buy services
Agents buy.
Rules first.
For companies that run buyer agents. Your agent pays for paid HTTP APIs (x402, USDC) within a job budget, through HTTP/OpenAPI or MCP. You set the per-payment and daily limits and the sellers it may pay, and you check every purchase in a ledger that keeps payment and delivery apart.
Developer alpha · demonstrated on a LOCAL FORK of Base Sepolia
Nothing on mainnet, no real money, no public-testnet proof yet; we do not offer a hosted service. What works today
One recorded run · 2026-11-18 · LOCAL FORK
The agent pays when the rules allow it. Otherwise nothing is signed.
What the operator reads in the ledger (x402:ops status) after an agent framework tried three purchases through AgentFi (two shown). Lines as printed in that run; the transaction hash and the job id are shortened.
- fw-allowed-112df35f56-0000001 settled 0.3 USDC money:proven delivery:delivered (HTTP 200)
reconciled: transfer proven on-chain in 0x4787c11c…e088b537f, block 60305585 (was settled)- fw-overpolicy-ec6d978dc8-00001 failed_before_signing 0.6 USDC money:not-moved delivery:unknown [not counted]
reason: Payment of 0.6 USDC exceeds the policy's per-transaction limit of 0.50 USD (maxValuePerTxUsd)How far this run goes
- Where
- A local Anvil fork of Base Sepolia with test USDC: not the public testnet, not mainnet, no real money.
- What is real
- The AgentFi API, its worker and the MCP server (stdio), built from the checkout; the real @x402/evm facilitator, on a seller we control.
- The agent
- OpenAI Agents SDK 0.24.0 driven by a scripted model: no LLM ran. Google ADK, the LangChain JS tools and the HTTP/MCP reference clients ran only against a stub API.
- Platforms
- This framework run: Windows 11 only. The base demo (npm run alpha:demo) also ran once on Linux (Debian 12 container, Node 22), in a rehearsal by an agent, not by an outside developer. macOS was not run.
How it works
An agent buys a paid API, inside your rules
Rules
The job’s reward (posted by the requester) is the budget; the operator sets the agent’s caps (a per-payment USD cap, a daily volume and the allowed recipients).
Buy
The agent asks a paid API for a resource. The API answers “payment required” (HTTP 402, x402) with a price.
Budget
Over budget or outside policy: the purchase is refused before any authorization is signed. Otherwise the amount is reserved and the payment is signed.
Track
Payment and delivery are recorded separately. Payment: proven, reported, possibly moved or held. Delivery: delivered, partial, not delivered or unknown.
Reconcile
Payment found: A lost or unreported response is checked against on-chain evidence. When the transfer is found, the payment is proven. No second authorization is signed and the resource is not refetched.
Never settled: If the authorization lapses unused and a second source of evidence agrees, the amount is released back to the budget. Reconciliation proves payment; it does not recover content.
Three ways a purchase ends
Paid, and proven
The purchase is within budget and policy, the payment settles, and the transfer is found on-chain. Delivery is recorded on its own line.
Refused before signing
The price is over the budget or outside the agent’s policy. Nothing is signed and nothing is charged; the refusal says which rule applied.
Uncertain, then reconciled
The response was lost or reported no settlement. The amount stays counted while AgentFi looks for on-chain evidence; no second authorization is signed for it.
Interfaces and payment protocol
Run the local demo
From the walkthrough to your terminal
The demo runs on your machine against a LOCAL FORK of Base Sepolia, with test wallets. It needs no credentials, no funds and no accounts. About 2.5 to 3.5 minutes after npm ci, which takes 4 to 6 more.
git clone https://github.com/felippeyann/agentfi.gitcd agentfigit checkout 383fb01 # main when this page was published; no release tag yetnpm cidocker compose -f docker-compose.dev.yml up -d postgres redisnpm run alpha:demonpm run alpha:demo first checks what is missing (Node, anvil, Postgres, Redis, ports, the RPC) and tells you how to fix it before it starts anything; npm run alpha:demo -- --check only checks. It exits 0 only if every invariant held, and prints the operator report that the example below comes from.
You need
- Node.js 22 or newer (run on Node 24 on Windows and Node 22 on Linux; npm comes with it) and Git.
- Postgres 16 and Redis 7: easiest with Docker, or any local ones you can reach.
- Foundry anvil 1.7.1. Only that version was verified; newer ones are untested.
- HTTPS access to a public read-only RPC of Base Sepolia, to read state for the fork. Nothing is written to it.
- Free ports 8547, 3157, 5432 and 6379.
How far this has been shown
- A fork, not a network. The fork is a local Anvil that reads Base Sepolia state without writing to it: the real USDC contract, a chain only you can write to, and a seller we control. It is not the public testnet and not an independent seller.
- Frameworks. The OpenAI Agents SDK (Python, openai-agents 0.24.0, mcp 2.3.0) made an allowed purchase and had two purchases blocked before signing, against the real local backend (API and worker on a local Anvil fork of Base Sepolia, a seller we control, the real @x402/evm facilitator), through the AgentFi MCP server over stdio, with a scripted model: no LLM ran. Windows 11 only, recorded 2026-11-18. Google ADK, the LangChain JS tools and the HTTP and MCP reference clients have run only against a stub API. Run it through an agent framework
- Public testnet. The public testnet proof has not been done: everything shown is from a local fork.
- Where it was run. The demo: Windows 11 (Git Bash) with Node 24 and anvil 1.7.1, and once on Linux (Debian 12 container, Node 22, anvil 1.7.1) in a rehearsal by an agent following the quickstart, not by an outside developer. The agent-framework run: Windows 11 only. macOS has not been run. Verified run · What the demo does not show
Operational result
Payment and delivery are separate facts
Paying for a resource and receiving it can end differently. AgentFi keeps a ledger row per purchase with the payment state and the delivery state apart, so a lost response is not confused with an unpaid one.
These rows are the operator report (x402:ops status) printed at the end of that run, in the order printed. Payment ids and amounts are as printed; transaction hashes are shortened. A run on your machine prints different ids and hashes, with the same states. The full transcript is not in the repository: the quickstart shows the same report and says how to produce it.
Job cmwjd837t0009aww7d3g8jc3h · ACCEPTED
budget 5 · committed 1.8 (proven 1.8, reported 0, open 0) · remaining 3.2
- demo-premium-0001-abcdefAmount: 0.6 USDCLedger: failed_before_signingNot movedUnknown
Not counted. Refused before signing: 0.6 USDC exceeds the policy’s per-transaction limit of 0.50 USD (maxValuePerTxUsd).
- demo-allowed-0002-abcdefAmount: 0.3 USDCLedger: settledProvenDelivered
Delivered (HTTP 200), 75 bytes received. Transfer proven on-chain in 0xa48d…5ec6, block 59589190.
- demo-partial-0003-abcdefAmount: 0.3 USDCLedger: settledProvenPartial
Delivery partial (HTTP 200): 65536 bytes received, truncated at the read limit. Proven in 0xf538…831a. Action: the content is not recoverable by reconciliation, and fetching it again would be a new purchase.
- demo-dropped-0004-abcdefAmount: 0.3 USDCLedger: settledProvenUnknown
Response lost: no paid response arrived. Reconciled: transfer proven on-chain in 0xecb8…7298, block 59589192 (was unknown). Action: take the content up with the seller.
- demo-two-0005 … 0007Amount: 0.3 USDCLedger: settledProvenUnknown
Three more lost-response purchases (demo-two-0005-abcdefgh, 0006, 0007), 0.3 USDC each, each reconciled from unknown to proven with its own transfer, as in 0004.
- demo-held-0008-abcdefghAmount: 0.3 USDCLedger: expiredNot movedUnknown
Not counted. Authorization unused at block 59589209: it can never move money (was unknown). The budget it held is released.
Job cmwjd83bq000eaww7jzwjagur · ACCEPTED
budget 0.2 · committed 0 (proven 0, reported 0, open 0) · remaining 0.2
- demo-overbudget-0000-abcdefAmount: 0.3 USDCLedger: failed_before_signingNot movedUnknown
Not counted. Refused before signing: the cheapest acceptable option costs 0.3 USDC, above the cap of $0.2.
Payment states
- Proven
- the chain shows the transfer
- Reported
- the server says it settled; the chain has not confirmed it yet
- Possibly moved
- a signed authorization is out and not yet resolved
- Held
- amount reserved; nothing signed or sent yet
- Not moved
- nothing was signed, or the authorization was proven unused
Delivery states
- Delivered
- a paid response was received
- Partial
- the body was cut at the read limit
- Not delivered
- the server answered with an error
- Unknown
- no paid response was received
Uncertain purchases are reconciled automatically from on-chain evidence. Reconciliation proves that a payment happened; it does not recover content, and a paid resource is never refetched: a new fetch is a new purchase.
For whom
For software and automation companies whose agents buy services
If your product has agents that call paid APIs on a customer’s or your own behalf, two people usually carry the risk: the one who wires the agent, and the one who owns the budget. The alpha is built for that pair.
The developer
Wires an agent to buy a paid API.
- Calls an HTTP endpoint, or an MCP tool, and gets a typed answer: paid, refused with the rule that applied, or uncertain.
- A retry with the same payment id does not sign a second authorization while the first is unresolved.
- Reads payment and delivery as separate states instead of guessing from a timeout.
The budget owner
Decides what an agent may spend, and checks what it did.
- Sets the agent’s caps (the job’s reward, posted by the requester, is the budget): a per-payment USD cap, a daily volume and the allowed recipients.
- Sees per job what is committed, proven, reported and still open.
- Gets an action when automatic reconciliation cannot conclude, or when a paid resource arrived partial or not at all.
Not a fit yet if you need a hosted service (we do not offer one), mainnet, real money, or budgets per client or per task: none of these exist in the alpha.
Status
What works today, what is experimental, what is not available
AgentFi is a developer alpha. The evidence below comes from tests and from runs on a local fork with test wallets: it shows the code behaves as specified there, not that it works on a public network.
- Local fork only15 Nov 2026
Buy a paid API over x402, inside a budget
Configure the rules, let an agent buy over x402 (exact, USDC), and see an over-budget or out-of-policy purchase refused before any authorization is signed. Demonstrated on a local fork of Base Sepolia with test wallets.
- Local fork only15 Nov 2026
Payment and delivery tracked separately
A ledger row per purchase, with payment states (proven, reported, possibly moved, held) apart from delivery states (delivered, partial, not delivered, unknown), and an operator report per agent and per job (command line).
- Local fork only15 Nov 2026
Automatic reconciliation from on-chain evidence
A lost or unreported response is checked against the chain and proven without a second charge or a refetch. An authorization that lapsed unused is released only with a second source of evidence; on a local fork that source is the same node, so it proves the wiring, not independence.
- Local fork only——
HTTP/OpenAPI and MCP in the source
The purchase endpoint is in the OpenAPI spec and the matching MCP tool is in the source on main. The npm package published today (0.5.0) predates x402: until the next release, install from a git checkout (no release tag yet).
- Works today——
Automated tests on every merge
Contract, backend, database, local-chain and MCP test suites run in CI on each change to main. The fork demo is not part of CI.
- In progress——
Framework examples
The OpenAI Agents SDK made an allowed purchase and had two blocked, against the real local backend on a fork, over MCP stdio, with a scripted model (no LLM; Windows 11 only; 2026-11-18). Google ADK, LangChain JS tools and the HTTP/MCP reference clients ran only against a stub API. None is claimed as supported yet.
- In progress—
Public testnet proof
The same flow on a public test network, as a separate milestone. The public testnet proof has not been done: everything shown is from a local fork.
—— - Experimental——
Also in the repository
ERC-8183 escrow jobs, ERC-8004 reputation and older DeFi adapters exist in the code. Experimental, and not part of this alpha’s first experience.
- Not available—
Hosted service, mainnet and real money
You run the backend yourself. Nothing here moves real funds, and this alpha uses no contract on any public network (legacy contracts from earlier versions exist on Base mainnet and are not used). We do not offer a hosted service.
——
Limits of this alpha
- Alpha: interfaces and behaviour may change.
- Local fork only: nothing has been shown on a public network yet.
- Budgets are per job, plus the agent’s policy caps. There are no per-client or per-task budgets.
- There is no standalone purchase: today the provider of an accepted job pays from its own wallet, capped by that job’s reward budget.
- Only x402 “exact” payments in USDC. Permit2 payments are not reconciled automatically; the operator resolves them by hand.
- Reconciliation proves payment. It does not recover content, and a paid resource is never refetched.
- No external security audit.
Integration
Headless: HTTP and MCP first
Headless means you call it over HTTP or MCP and keep your own agent framework. You run the backend yourself.
First path
HTTP / OpenAPI
Your backend or agent runtime calls the purchase endpoint and reads the typed answer (payment status, resource status). The operator ledger report is a CLI (x402:ops status); there is no HTTP endpoint for it yet. The contract is an OpenAPI 3 spec, so a client can be generated in any language.
In the source
MCP
An MCP server exposes the purchase as a tool (pay_for_resource) alongside the other AgentFi tools; ledger reports are not available over MCP. The tools are in the source on main; the npm package published today (0.5.0) predates x402, so install from a git checkout for now (no release tag yet).
One run, on a fork
Agent frameworks
The OpenAI Agents SDK made an allowed purchase and had two blocked, against the real local backend on a fork, over MCP stdio, with a scripted model (no LLM; Windows 11 only; 2026-11-18). Google ADK, LangChain JS tools and the HTTP/MCP reference clients ran only against a stub API. Which framework and version was run, and against what, is tracked in a compatibility matrix. None is claimed as supported on this page.
Ready to run it? The local quickstart runs the demo on your machine with a fork and test wallets: no accounts and no real funds. The purchase step itself only runs against the demo’s local fork today (the demo, or the local backend your own agent can call, quickstart section 10); the quickstart says how far the HTTP calls can be followed by hand.
Feedback
Tell us where it breaks
This is an alpha, and the point of releasing it is to hear from people who try it. Feedback goes through public GitHub issues: this site has no sign-up and no form of its own.
The form chooser offers four forms: alpha feedback (you tried it, including when it did not work), integration request, bug report and feature request. A GitHub account is needed to open an issue. The feedback guide says what we ask for and what we never collect: no telemetry, no prompts, no secrets, no customer data. Report vulnerabilities privately, not as an issue.
Useful to hear
- Where does your agent’s purchase flow not fit these rules?
- Which framework or client do you need first?
- Which payment or delivery state is unclear, or missing?
- What stopped you from running the local quickstart?