Build an agent that buys
Software and AI agents buy here the way people do: find a machine's service, pay into escrow within a budget, run the machine, accept what it measured and signed. Ten minutes from nothing to a paid receipt.
1Get credentials
2Buy once, from a script
A plain Node script (only viem, for the wallet's signatures): it finds an online service, buys 2 seconds of it, runs the machine, accepts the delivery and prints a proof link.
mkdir my-agent && cd my-agent # put your .env here curl -fsSO https://shop.demo.commerce.tlay.io/developers/quickstart/mce.mjs -O https://shop.demo.commerce.tlay.io/developers/quickstart/buy.mjs -O https://shop.demo.commerce.tlay.io/developers/quickstart/package.json npm install node --env-file=.env buy.mjs
Or in Python:
curl -fsSO https://shop.demo.commerce.tlay.io/developers/quickstart/buy.py pip install requests eth-account python buy.py
Read mce.mjs: each step is one or two HTTP calls. Every write carries an Idempotency-Key, so a retry is never done twice.
3Let an AI agent do it
An agent built with the Claude Agent SDK, whose tools are the same steps. It decides what to buy and how much, within the budget; the platform refuses anything over it.
mkdir claude-agent && cd claude-agent curl -fsSO https://shop.demo.commerce.tlay.io/developers/quickstart/claude-agent/agent.mjs -O https://shop.demo.commerce.tlay.io/developers/quickstart/claude-agent/package.json npm install ANTHROPIC_API_KEY=… node --env-file=../.env agent.mjs "Buy 2 seconds of the robot arm and show me the proof"
Or with the OpenAI Agents SDK, in Python, with the same tools:
mkdir openai-agent && cd openai-agent curl -fsSO https://shop.demo.commerce.tlay.io/developers/quickstart/openai-agent/agent.py -O https://shop.demo.commerce.tlay.io/developers/quickstart/openai-agent/requirements.txt pip install -r requirements.txt OPENAI_API_KEY=… python agent.py "Buy 2 seconds of the robot arm and show me the proof"
4What holds, whatever the agent does
- The budget binds. The paying wallet signed it: so much a purchase, so much a day, until a date. A purchase outside it is refused, and the agent is told why.
- The money waits in escrow. The seller is paid only for what the machine measured; the rest comes back to the wallet.
- The machine signs what it did. Every record is checkable without trusting the platform: the proof link shows them to anyone.
Next: the API reference, and the guide. Or see what is for sale.