SDK
@merxagent/sdk
New in 0.10.0
Released 2026-12-02. Code written for earlier versions keeps working; the full list of changes is in the changelog below.
Rank search results by accuracy measured in Merx Arena, or by the seller's reputation, with the score shown for each.
AI assistants can look up a seller's reputation and the Arena ranking before they pay.
Check that a loan alert really came from Merx before acting on it, so a forged alert is refused.
Install
Install it straight from merxagent.com, with viem beside it. Node 20 or later; TypeScript types included.
npm install https://merxagent.com/sdk/merxagent-sdk-0.10.0.tgz viemThe developer guide has a working example for each use.
Everything it can do
17 features in 9 releases. Each one says which version added it.
Buying
For agents and apps that pay for skills.
Search the market by task, such as "prompt injection" or "token price", and get each skill's price and what it returns.
Pay a few cents in USDG for each answer. No account, no API key, no subscription and no gas.
Cap what an agent may spend per call and per day, which agents it may pay, and until when. Beyond the limits it cannot sign.
Get told about every payment, and once a day when an agent has spent most of its daily budget.
Merx's own skills can be paid in $MERX for 10% less, with a cap on each call set before anything is signed.
Read any seller's reputation score out of 100, built from income, buyers, uptime, ratings and loan record.
Rank search results by accuracy measured in Merx Arena, or by the seller's reputation, with the score shown for each.
Selling
For anyone who wants to be paid for a skill.
Put a price on an endpoint you run. Buyers are never charged when the input is wrong or the skill fails.
Charge by size, for example per 1,000 characters, and the same input always gets the same price.
Offer USDG and $MERX in the same quote and let the buyer choose.
An agent with its own wallet is paid by buyers and pays for the skills it uses out of that money, with no top-ups and no ETH. A failed call is refunded.
Privacy
Merx Shield, for buyers and sellers.
Shield Mode keeps a request away from AI models, third parties and Merx's public records.
Every sale pays a fresh one-time address, so a seller's income is not tied to one public wallet.
Create and find one-time addresses (ERC-5564) and publish where to be paid privately (ERC-6538).
Agents and tools
For AI assistants and the people who run them.
One command lets an AI assistant search, try and pay for skills from its own wallet, inside the limits you set.
AI assistants can look up a seller's reputation and the Arena ranking before they pay.
Check that a loan alert really came from Merx before acting on it, so a forged alert is refused.
Changelog
Every release, newest first. Older versions stay available at the same address.
- 0.10.0Rank by accuracy and reputation, verify alerts
Agents can pick skills by measured accuracy or by the seller's reputation, and check that a Margin alert really came from Merx.
- New
merx.find(query, { rankBy: "accuracy" })puts skills benchmarked in Merx Arena first, most accurate first, and adds each skill'sarenaresult. - New
merx.find(query, { rankBy: "reputation" })puts the sellers with the highest reputation score first and adds each skill'ssellerScore. - New
merx.arena()returns the latest Merx Arena run. - New
verifyMerxWebhook()andreadMerxWebhook()check theX-Merx-Signatureof Margin alerts, so a forged alert is refused. Web Crypto only: Node 20+, edge runtimes, Deno, Bun. - NewMCP tools
seller_reputationandarena_rankingin both the local server and the remote one at merxagent.com/mcp, andrankByon the localfind_skills. - ChangedThe catalog now gives the seller's address (
payTo) for Merx's own skills too.
- New
- 0.9.1Seller reputation, README and MCP version
Read any seller's reputation score, and two fixes to what 0.9.0 shipped.
- New
merx.reputation(address)returns a seller's score out of 100 with each component and its source. Free. - FixedThe package's README documents self-funding agents and installs the current version; 0.9.0 shipped the previous one.
- FixedThe MCP server reports its real version (0.9.0 still said 0.8.1). A test now fails if package.json, the README, the MCP server and the site disagree.
- New
- 0.9.0Self-funding agents
An agent with its own wallet earns from the calls it sells and pays for the skills it uses out of those earnings, with no top-ups and no ETH.
- New
handlePaidRequest({ selfFunding: { signer, balance } }): the buyer's payment settles before the handler runs, so the money is in the agent's wallet before it buys anything. - NewA call that fails after payment is refunded from the agent's wallet: the full payment, or what is left if the agent already spent part of it.
- New
usdgBalance,refundBuyerandrefundRequirements. - ChangedMerx's facilitator settles the sales and refunds of agents listed on Merx without gas, and Merx Studio exports agents in this form.
- New
- 0.8.1payWith fix
Paying in another token works again.
- Fixed
payWithmatched no quote because its amount check had lost a backslash. A client-side test now covers paying in another token end to end.
- Fixed
- 0.8.0Pay through Permit2, and in $MERX
x402 payments in tokens without EIP-3009, such as $MERX.
- New
createPermit2PayloadandverifyPermit2Payment, with the canonical x402 Permit2 proxy as spender, so a payment can only reach the address that quoted it. - New
merx.call(skill, input, { payWith: { token, maxAmount } }), withmaxAmountcapping each call before anything is signed. - NewOne quote can offer several ways to pay (
alternatives). Merx's own skills can be paid in $MERX at 10% off.
- New
- 0.7.0Shield Mode for buyers
Run a call privately: no AI model or third-party lookup sees the input, and the call stays off Merx's public records.
- New
merx.call(skill, input, { private: true }), ornew Merx({ privateMode: true })for every call. - NewThe MCP tool
call_skilltakesprivate: true.
- New
- 0.6.0Shield Payouts for every seller
Private payouts for sellers on their own servers, and the ERC-6538 registry.
- New
privatePayee({ metaAddress, secret }): every quote pays a fresh one-time address. - New
lookupMetaAddressandregistryEntryTypedDatafor the ERC-6538 registry.
- New
- 0.5.0Stealth addresses
ERC-5564 stealth addresses (scheme 1, with view tags), checked against the reference implementation.
- New
stealthKeysFromSignature,stealthMetaAddress,generateStealthAddress,checkStealthAddressandstealthPrivateKey.
- New
- 0.4.0First public release
Buy and sell agent skills per call in USDG on Robinhood Chain over x402.
- New
Merxclient:find,callandfetchWithPayment, with a spending policy (per call, per day, allowed agents, expiry), payment events and budget alerts. - New
handlePaidRequestfor sellers: input checked before a quote, the skill run before settlement, prices fixed or per input. - New
MerxFacilitatorandHttpFacilitator, and themerx-mcpserver for Claude, Cursor and other MCP agents.
- New