-
Get a test key with limits
This creates an agent key on your machine, gives it $5,000 of test money, and writes
ACCORD_URL(the service,https://api.test.useaccord.ai),ACCORD_NETWORK=testnetandACCORD_AGENT_KEYto.env. The key never leaves your machine; Accord only gets its public ID.terminal npx @getaccord/cli init Agent key my-agent saved to .env 0xf5513d4b1acc3e3ebc0bfbaf9cd3c4505c67cd5d5486a644c47d7fb53b2a33cb Account acct_Swe7wDodJA91ZGjw Owner token saved to ~/.accord/owner-0xf5513d4b1acc3e3ebc0bfbaf9cd3c4505c67cd5d5486a644c47d7fb53b2a33cb (only you can read it; keep it away from agents) Balance $5,000.00 in test money Limits $2,000.00 a week · sellers: skyfare, stayco, ridenow, … sign-off above $1,500.00 in 24 hours · expires 2026-12-22The long
0x…value is your key's public ID: it's how Accord, sellers and the public record identify the key, andnpx @getaccord/cli balanceshows it again.initalso saves an owner token to~/.accord/owner-<public ID>, readable only by you and never in.env. It proves you own the key:npx @getaccord/cli allow <seller>uses it to let the key pay a new seller, andnpx @getaccord/cli revoke <public ID>uses it to stop a key. Keep it away from your agents.Using the dashboard? Sign in at app.test.useaccord.ai, then run
npx @getaccord/cli init --owner yourname@accwith your account name or full account ID. That key can't pay until you add it on the dashboard, where you also set its limits. On the dashboard you also choose which sellers each key may pay: the demo sellers, any seller by its Accord name, or an x402 seller by its payout account. Then check it withnpx @getaccord/cli try, a $1 test purchase.In the private beta with real money? Sign in at app.useaccord.ai, then connect the key with version 0.9.6:
npx @getaccord/cli@0.9.6 init --owner <your Live name or account ID> --url https://api.useaccord.ai. The dashboard's Connect an agent button shows the exact command. The CLI writes the beta setting into the folder's.env, so the SDK and MCP server there use it too. Without--url, a key stays in test mode, so a test key can't spend real money. On the dashboard, the Test mode | Live switch moves between the two, and keys made in one mode only work in that mode.Who can this key pay?
npx @getaccord/cli sellerslists every seller taking payments (add--allto see paused ones too) with what it sells, its prices, and whether it's paid when it confirms or on delivery, marked✓ this key may payor✗ not allowed for this key(with how its owner allows it). Add a word to search, likesellers "price data".npx @getaccord/cli balanceends with aMay pay:line.Add
--name my-agentto name the key.initalso keeps.envout of git: it creates or extends your.gitignore, and warns you if git already tracks.env. -
Run the demo: three sellers, one step
The trip booker holds a flight, a hotel and a car, then commits. All three are paid, or nobody is. First, one seller declines. Watch every hold release:
terminal npx @getaccord/cli demo --fail ridenow Intent opened budget $1,200.00 3 holds placed $1,145.00 locked skyfare released stayco released ridenow declined Aborted: ridenow declined. Every hold released; nobody paid.Now run it with every seller confirming. All three are paid in one step:
terminal npx @getaccord/cli demo … Committed: 3 sellers paid $1,145.00 in one stepEach demo runs on its own fresh test key, so you can run them in any order, and your own key's $2,000 week stays free for your code.
Each run prints a timeline link: a public proof of what was authorized, held and paid that anyone can check without trusting Accord or the sellers. Each step that moved money also links to independent public explorers, so you can see it outside Accord too. The work and each hold's
refaren't on it: the work goes only to the purchase's own key and its owner (in the purchase's details on the dashboard), and arefgoes to its seller, and to the owner for purchases that needed their approval. -
Install the SDK
terminal npm install @getaccord/sdk
The SDK reads your key from
ACCORD_AGENT_KEY, or from./.envas written byinit. The samples useimport, so yourpackage.jsonneeds"type": "module": runnpm pkg set type=module.terminal pip install getaccord
getaccord on PyPI is the Python SDK, for Python 3.9 or newer, with the same API as the TypeScript one. It reads
ACCORD_AGENT_KEYfrom the.envthatinitwrote, as is.Use 0.9.6 or later. Older versions are refused (
sdk_too_old) and name the update command:npm i @getaccord/sdk@latestorpip install -U getaccord; for the CLI and MCP server,npx @getaccord/cli@latestandnpx -y @getaccord/mcp@latest. Keys you already have keep working.Upgrading from 0.6.4 or older? Update the SDK:
npm install @getaccord/sdk@latest, orpip install -U getaccord. From 0.6.5 every request made in an agent key's name carries proof from that key, so knowing a key's public ID isn't enough to act for it. Older SDKs, and MCP or CLI installs built on them, getsdk_too_old; run those asnpx @getaccord/cli@latestandnpx -y @getaccord/mcp@latest.Set up before 0.7? Your folder keeps working. To point it at the test service directly, add
ACCORD_NETWORK=testnetto its.env, or changeACCORD_URLtohttps://api.test.useaccord.ai.Using Deliver holds on 0.6.5 to 0.6.7? Update the same way. From 0.6.8 the delivered work goes only to the purchase's own key. An older SDK, or an MCP or CLI install built on it, sees that the work was delivered but not the work itself (an older MCP server shows it as empty, though the seller did deliver), and can't accept it or complete the purchase (accepting gets
sdk_too_old). It can still cancel the purchase. If an older agent does neither, nothing is lost: the money held for it comes back on its own at the purchase's deadline (24 hours at most). Purchases with only Reserve holds are unaffected. -
Write your own intent
Four calls:
intentopens a deal within the key's limits,holdlocks money with a seller,commitpays everyone at once,abortreleases everything. Amounts are in cents.buy.ts import { accord } from '@getaccord/sdk'; const intent = await accord.intent({ budget: 700_00 }); // Holds placed in the same tick are sent together. await Promise.all([ intent.hold('skyfare', { amount: 480_00, ref: 'OAK to SEA, Jan 9' }), intent.hold('stayco', { amount: 190_00, ref: '1 night' }), ]); const result = await intent.commit(); // 'committed': both paid. 'aborted': nobody paid, every hold released. console.log(result.status, result.intent.proofUrl);
terminal node buy.ts
Node 22.18 or newer runs
.tsfiles directly. On an earlier Node 22, name the filebuy.mjsand use the same code.buy.py from getaccord import Accord accord = Accord() # reads ACCORD_AGENT_KEY and ACCORD_URL from the env or ./.env intent = accord.intent(budget=4500) # whole cents; budget_micros= for exact sub-cent amounts intent.hold("skyfare", 3000, ref="SFO to JFK") intent.hold("stayco", 1500, ref="2 nights") result = intent.commit() # everyone is paid, or no one is print(result.status, result.intent["proofUrl"])
terminal python buy.py
Amounts are whole cents (
int) or exact micros (amount_micros=, millionths of a dollar). Floats are refused, so no amount is ever rounded.AsyncAccordhas the same methods, awaitable.Exact amounts and USDC
Amounts are in cents. For less than a cent, use
budgetMicrosandamountMicros(millionths of a dollar, as a string or bigint):"100"is $0.0001, paid exactly. One purchase can include up to 100 payments, placed together or over several steps. For more, start another purchase. Test keys from plaininitpay in dollars. On a dashboard key whose owner allows USDC, addcoin: 'USDC'to pay in USDC; one weekly budget covers both. In Python:budget_micros=,amount_micros=andcoin="USDC".tiny.ts const intent = await accord.intent({ budgetMicros: 5_000n }); // $0.005 await Promise.all(apis.map((api) => intent.hold(api, { amountMicros: 100n }))); // 50 × $0.0001, one step
You're done when your script printscommittedwith two or more holds. That's an all-or-nothing payment across two sellers.Don't pay twice. Pass a
purchaseRefsuch as the order or task ID:accord.intent({ budget: 700_00, purchaseRef: 'order-1042' })(Python:purchase_ref=). Running the same code again with the samepurchaseRefgets the same purchase back, and nothing is paid twice. A hold'srefis different: it tells the seller what the item is. -
Handle refusals
Limits are enforced when money moves, so refusals come back as typed errors with a
code:Code What happened limit_exceededThe hold would go over this week's budget. seller_inactiveThe seller has stopped accepting payments. x402_no_accord_optionAn x402 seller's 402 doesn't offer accord. Nothing was paid.seller_not_allowedThe seller isn't on the key's allowed list. The key's owner can add it with npx @getaccord/cli allow <seller>.awaiting_approvalThe purchase would take the key's unapproved spending in the last 24 hours past its sign-off limit. Nothing is locked until a person approves it. Splitting it doesn't get around this. seller_cap_exceededThe hold would go over the owner's limit for that seller in any 24 hours, 7 days or 30 days. The message says what's used and what's left. Nothing was paid, and a sign-off doesn't lift it. seller_too_oftenThe key has already paid that seller as often as its owner allows in that window. The message says when it can pay again (in UTC). Nothing was paid. seller_uses_fullThe key has placed 200 holds with that seller in the last 30 days, the most Accord keeps under a seller limit (Accord's own bound, not the owner's). It can pay that seller again as the oldest turn 30 days old, or its owner can remove the limit. Nothing was paid. duplicate_purchase_refThis key already opened a purchase with that purchaseRef, and this hold doesn't match it. Nothing new was opened, held or paid; carry on with that purchase (the error names it).purchase_ref_in_progressA purchase with that purchaseRefis being opened right now, by another run of the same code. Nothing new was opened. The SDKs wait for it and reuse it; other callers look it up by itspurchaseRefin a moment.name_the_itemsA purchase over the key's sign-off line was opened with no holds. A person approves the items, not a blank amount: open it with its holds (seller, amount and ref for each). Nothing was opened or paid. The SDK always opens a purchase with its first holds. ref_renamedA request sent the old purchase-level ref. It's nowpurchaseRef: send the same value aspurchaseRef. (A hold's ownref, describing the item, staysref.) Nothing was opened.key_revokedThe key was replaced ( init --force) or revoked by its owner. It can no longer pay, and its open holds come back when they expire, or when you cancel them.key_expiredThe key is past its expiry. insufficient_balanceThe account doesn't have enough money available for the hold. too_many_holdsMore than 100 payments in one purchase. results_pendingDelivered work is still waiting for you to accept or reject it. tx_mismatchThe SDK checked what Accord's service prepared and it wasn't exactly the step you asked for, so nothing was agreed to. Money already held for the purchase stays held until you abort()it or its deadline passes.intent_mismatchA purchase opened, but the service named a different one from the one recorded. The step ran; use the ID in the message. bad_conditionA linked purchase's condition can't be read, doesn't name exactly its members, or a member is wrong (2 to 10 members, each with holds). condition_unmetsettle()came before the condition was decided. Nothing was paid; wait, orcancel().unknown_sellerThere is no seller by that name. awaiting_ownerThe key came from init --ownerand its owner hasn't added it on the dashboard yet.owner_token_requiredApproving a purchase takes the owner token, not the agent key. x402_unsupported_urlThe x402 URL has a login part ( user@host), backslashes, spaces or control characters, or./..segments. Refused before anything is sent.x402_redirectedAfter payment, the paid URL redirected. The proof wasn't sent on; the payment stands, so fetch the same URL again. x402_url_mismatchAn x402 seller's 402 names a different URL (host, path or query) than the one fetched, or names none. Nothing was paid. invalid_expiryA purchase can stay open for at most 24 hours. invalid_keyThat isn't an agent key. Run npx @getaccord/cli init.network_errorAccord couldn't be reached. Check the purchase before trying again. invalid_tokenA token with spaces or line breaks in it. Pass only the token itself, not the whole line or file. unknown_owner_tokenThat owner token isn't valid. Use the one initsaved for this key.not_awaiting_approvalThe purchase isn't waiting for approval. not_as_approvedThe owner approved this purchase for certain sellers, amounts and items, and this hold isn't one of them. Nothing was held or paid; start a new purchase for anything else. reason_requiredA fee is declared for this purchase, so the agent must say why it chose that seller ( reason). Nothing was opened or paid; send it again with a reason. With the SDK, it comes from the firsthold().fee_confirmation_requiredA fee is declared for this purchase, so the owner confirms it before it's paid, even under the approval line. It waits for them; nothing was paid yet. fee_declared_refusedThe key's owner chose never to buy where a fee is declared, and this purchase involves one. Nothing was paid; choose a seller that doesn't declare a fee. not_invitedLive is invite-only during the private beta, and this account isn't invited. Request Live access. Your test-mode account isn't affected. work_under_reviewDelivered work is still inside its review window. Reject it, or wait until the window ends and it's paid, then complete or call off the purchase (a linked purchase can pass rejectUndecided: true). Nothing was paid or released.rate_limitedToo many of something this hour, and the message says which and when to try again: test sign-ups from your network or overall; new keys for your account ( init --force, 3 an hour); test keys made by demos for your account (20 an hour); or join requests from your network (10 an hour, and at most 2 waiting for one account).sdk_too_oldThe SDK, or an MCP or CLI install built on it, is older than 0.9.6: test mode and the beta refuse earlier versions, and nothing is done. Keys you already have keep working. Update it: npm install @getaccord/sdk@latestorpip install -U getaccord; for the CLI or MCP server, runnpx @getaccord/cli@latestornpx -y @getaccord/mcp@latest.declined_by_ownerThe account owner declined this key (for 48 hours). It can ask again: npx @getaccord/cli init --owner <account> --force.link_expiredThe key's request to join expired before its owner added it (requests wait 48 hours). Ask again: npx @getaccord/cli init --owner <account> --force.requests_fullThe account already has 10 keys asking to join. No request was sent. Its owner can add or decline them on the dashboard; requests also expire after 48 hours. owner_is_agent_keyThe ID given to init --owneris an agent key's ID, not an account. Use the account ID from the dashboard, or a name like alice@acc. No request was sent.not_dashboard_accountThat account isn't a dashboard account, so no key can join it. For a test key, run initwithout--owner.demo_key_parentA test key made by a demo can't make more test keys. Use the key from init(ACCORD_AGENT_KEYin your.env).demo_accountThe account was made by a demo, so it can't get new keys. Run the demo again for a fresh test key. bad_signatureA step was confirmed by a different key than the one it was prepared for. Nothing was done. bad_request_signatureThe request didn't carry proof from the agent key it acts for. Nothing was done. stale_requestThe request is more than 5 minutes old, usually because the computer's clock is off. Nothing was done. wrong_networkThe request was made for the other service (test mode or Live). Check ACCORD_URLandACCORD_NETWORKin the folder's.env. Nothing was done.replayed_requestThis exact request was already sent. Nothing was done; send a new one. busyThe test service is at its limit for now, or was briefly busy. Nothing was changed or paid; the message says when to try again, and the SDKs retry a brief one once by themselves. Committing and aborting never count against the service's limits, so held money can always be released; they can still be briefly busy when the service is overloaded for a moment, with nothing changed or paid. busy_prepare_againThe test service was busy just after it prepared a step. Nothing was changed or paid; the SDKs check that and do the step again once by themselves. If you still see it, do the step again in a moment. balance.ts const b = await accord.balance(); // { available, weekly: { budget, spent, held } } in cents
Mistakes in a request come back as
invalid_agent,invalid_hold_typeormethod_not_allowed, and a transaction refused for any other reason astransaction_failed. An answer that isn't Accord's (a wrongACCORD_URL) isunexpected_answer, and in Python a malformed x402 requirement isinvalid_requirement. After anetwork_error, retry on the same intent: retrying the samehold()returns the hold if it went through after all, a different hold getsearlier_step_landed, and nothing is ever sent twice.In Python the same codes come as
AccordErrorwith a stable.code, andaccord.balance()works the same way.A purchase that needs sign-off throws
awaiting_approvalwith a message your agent can pass on:awaiting_approval This would take unapproved spending in the last 24 hours to $1,600.00, over the $1,500.00 sign-off limit. A person needs to approve it. No money is locked until then. Place holds again after it is approved (test keys: the owner approves with accord.test.approve(intent.id, { ownerToken })).ownerTokenis the owner tokeninitsaved to~/.accord/owner-<public ID>in your home folder, never in the project. Pass only theown_…value from itsACCORD_OWNER_TOKEN=line, not the whole file. The SDK never reads that file itself, so an agent holding only its key can't approve its own purchases. Dashboard keys are approved at app.test.useaccord.ai.From the terminal,
npx @getaccord/cli balancealso shows sign-off use, for example "Without sign-off: $900.00 of $1,500.00 used in the last 24 hours".
Use it from an MCP client
Accord's MCP server gives Claude Code, Claude Desktop or your own agent 14 tools for buying, checking its limits and finding sellers, with the same limits as the SDK and amounts in dollars. The model never sees the key: the server reads it from the .env that init wrote. Every refusal comes back in plain words, quoting the rule.
mkdir -p ~/accord-mcp && cd ~/accord-mcp && npx @getaccord/cli init
claude mcp add --transport stdio --env ACCORD_KEY_FILE="$HOME/accord-mcp/.env" --scope user accord -- npx -y @getaccord/mcp
{
"mcpServers": {
"accord": {
"command": "npx",
"args": ["-y", "@getaccord/mcp"],
"env": { "ACCORD_KEY_FILE": "/Users/you/accord-mcp/.env" }
}
}
}
Replace /Users/you with your home folder. The server is @getaccord/mcp on npm (also npx @getaccord/cli mcp). It's listed in the official MCP Registry as ai.useaccord/accord. Set up for Claude Code and Claude Desktop. With a dashboard account, run npx @getaccord/cli init --owner yourname@acc in that folder instead, then add the key on the dashboard. --scope user makes the server available in every project. For the private beta, add --url https://api.useaccord.ai to init --owner (version 0.9.6 or later).
Selling instead?
Any service can sell to agents through Accord from its own server, in test mode. Sign up with a public https webhook, serve the SDK's handler, and check it:
npx @getaccord/cli seller register --name my-shop --webhook https://your-host/accord npx @getaccord/cli seller ping
Buyers' key owners allow you once with npx @getaccord/cli allow my-shop. The full walkthrough covers tunnels, the handler, and which ID to grant access to.
Test mode limits
Every test key gets the same limits, so you can see each one refuse something.
| Test money | $5,000 for a CLI test account; $1,000 a day from the dashboard |
|---|---|
| Weekly budget | $2,000 of money actually paid. Released holds credit it back. |
| Currencies | Test keys pay in dollars. Dashboard keys can also pay in USDC if the owner allows it; one purchase pays in one currency, and one weekly budget covers both. |
| Changing limits | On test keys, changes apply at once. On dashboard keys, loosening (a bigger budget, a higher sign-off line, a new seller or coin) waits 24 hours by default; tightening and revoking are instant. |
| Allowed sellers | Travel: skyfare, stayco, ridenow. Agents for hire: scout (research), canvas (design). Data: quantfeed, marketpulse, dataloom. Office supplies: officemart. quickpay is on no test key's list, so you can see a refusal. Any other seller needs npx @getaccord/cli allow <name> first. |
| Sign-off | A person approves any purchase that would take unapproved spending in the last 24 hours past $1,500. Approved purchases and money that came back don't count. An approved purchase may hold only the sellers and amounts that were approved (opened without holds, only up to its approved budget). |
| Expiry | 30 days |
| Environment | The hosted test service at api.test.useaccord.ai, free to use. The SDK, CLI and MCP server connect to it by default (ACCORD_NETWORK=testnet). |
Used up the week? npx @getaccord/cli init --force replaces your agent key on the same account (up to 3 times an hour). In test mode the new key gets a fresh $2,000 week. It says the old key "can no longer spend" only once that's confirmed. If it can't confirm it, it tells you to run npx @getaccord/cli revoke <old public ID>. Need a second key with tighter limits? await accord.test.newAgentKey({ name, weeklyBudget }).
Make a demo seller decline on purpose with await accord.test.failSeller('ridenow'), and turn it back with accord.test.failSeller('ridenow', false).
Running the examples
The example samples are TypeScript. Node 22.18 or newer runs them as they are (node trip.ts); on an earlier Node 22, run them with npx tsx trip.ts.
- The
npxdemos each run on their own fresh test key, so run them in any order. - The code samples use your own key, so each paid run uses part of its $2,000 week. Your first key runs
trip.ts,hire.tsand the data buyer'sbuy.ts, failing and passing runs ($1,855 of its week). Thennpx @getaccord/cli init --forcegives you a fresh key forbrief.ts(one run) andeach.ts(up to $1,405 held, under both limits). A key can be replaced up to 3 times an hour. - The limits samples (
rent.ts,supplies.ts,paid-api.tsandapproval.ts) each make their own test key withaccord.test.newAgentKey(), andtwice.tsspends $120 of your key's week, once. - Several runs on one key can take its unapproved spending in the last 24 hours past $1,500: the next purchase is refused with
awaiting_approvaland nothing is locked. In test mode, the owner approves it withawait accord.test.approve(intent.id, { ownerToken }), passing the owner tokeninitsaved to~/.accord/owner-<public ID>(only theown_…value; the SDK never reads it, so your agent can't approve its own purchases), then places its holds again. The trip, subcontractor and data samples do this for you inwithSignOff.
Next
Example projects
The four launch samples (trip booker, agent subcontractor, data buyer, locked-down procurement) plus a research brief that pays one of two sellers, never both, seller webhooks, pay-what's-ready, sign-off and x402 sellers.
Browse examples → Read firstWhat Accord guarantees
Accord makes the money atomic, not the sellers' systems. Here's exactly where the line is.
See guarantees →