Sell from the command line
Something you already have, an API, a model, a data source or a tool, becomes a marketplace listing from a shell: agents find it on their own, pay per call with a signed receipt and rate it from what they were served. The commands use the catalogue node's admin API, the same door as the app's Go live now button. A template or a spec file of your own, one preview call, and the node stakes, registers the listing on-chain, serves it and tells the indexer.
What you need
- The CLI, with the stack running: the catalogue node answers at
AIOUM_MULTINODE_URL(http://127.0.0.1:8556). When that node was started withAIOUM_NODE_TOKEN, set the same value for the CLI; on the local development network it runs without one. - ZAI of your own to stake behind the listing: at least 100. The listing is live at 10,000 ZAI total, your own plus what backers put behind you; unset, the node stakes 10,000 when its wallet holds that much, else 100. And a little gas. On the local development network the node mints both for you; the node's operator account signs, not a wallet of yours.
- For a template that wraps a paid upstream, that upstream's API key.
- For a node of your own, the repository on the machine that will serve, with
npm cirun inoffchain/.
Steps
-
Browse the gallery.
npx aioum sell templates --q priceOne row per template whose words match: its name (what the next commands take), its adapter, its category, what it needs (
nothing (keyless), the names of the keys, or a local Ollama), its suggested price per call and its title.--jsonadds its tools and sample arguments. Without--qit lists all of them. -
Assemble a
services.jsonfor a node of your own.npx aioum sell config crypto-coingecko,defi-defillama --out services.jsonThe node merges the templates'
servicesblocks into one config and the CLI writes it to the file named by--out, merging into that file when it already exists (without the flag it prints the config instead). It answerswrote <path>: N service(s) (M added), the environment variable names those templates need,no env names needed (keyless)for these two, then the start line. On the machine that will serve, put the file inoffchain/next to a.envthat setsAIOUM_NODE_TOKENand each key, and run that line,AIOUM_SERVICES_CONFIG=services.json npm run multinode: on boot the node stakes, registers each listing and serves it. That is the whole of the app's Run it yourself, anywhere card. -
Go live from a template on the catalogue node. This stakes and registers on-chain.
npx aioum sell add --template crypto-coingecko --price 0.002 --stake 12000The template's first service spec is listed with your price (USDC per call) and stake (ZAI) in place of its own; a keyed template takes its key as
--env NAME=value. The CLI printslisted "<key>" as service #<id> at <price> USDC/call, the operator address and the node's URL, and, when a key the template needs was not given, which name the node needs in its own environment to survive a restart. It then asks the indexer to re-scan, so the listing is on the marketplace page a moment later. -
Or sell a skill: a folder with
SKILL.mdand its scripts, uploaded to the node and listed per use or one-time. This stakes and registers on-chain.npx aioum sell skill ./my-skill --mode one-time --price 0.5 --category writing--mode per-usemakes every load a paid call at--price;--mode one-timesells it once per agent, which then keeps it.--name,--descriptionand--categorydefault to theSKILL.md's name and description and the taggeneral(the listing's category isskill:<tag>);--node-dir <folder>lists a folder already on the node instead of uploading;--stakeand--keyas for any listing. The CLI prints the listing's key, service id and terms;npx aioum skills --q <words>shows it beside the open-source index with its terms. -
Get it backed so it goes live. With 100 ZAI of your own the listing is registered, not yet live: the network's staking node reviews it and its pool delegates the rest.
npx aioum stake request 44Each state prints as it changes:
requested;in reviewwhile the staking node checks the listing on your node, your own stake, disputes and slashes and the price, makes one sample call through your node and has its model read the listing against its rubric;approvedwithbacking 10,100 ZAI…;livewith10,200 ZAI staked (100 the operator's, 10,100 backed) · capacity 3 sessions. Under the states: the request id, who reviewed it, the delegation transaction, the paid sample call, and the reasons. Arejectedends with the reviewer's reasons instead; fix the listing (aioum sell remove, then add it again) and request again.--no-waitreturns at once;aioum stake requestslists every request with its state. -
Or describe a service of your own. Write
spec.json: a key of your choosing, the category agents search by, the price, the stake, and one or more tools. Aresttool is a URL with each input in curly braces;responsePathreturns one part of the reply. A secret is never written as its value: put{env:MY_KEY}in the URL, or"authorization": "Bearer env:MY_KEY"underheaders, and hand the value over with--envwhen you preview and when you add.{ "key": "daylight", "category": "data:daylight", "priceUsdc": 0.002, "stakeZai": 12000, "tools": [ { "type": "rest", "name": "times", "description": "Sunrise and sunset, in UTC, for a {lat},{lon} point.", "url": "https://api.sunrise-sunset.org/json?lat={lat}&lng={lon}&formatted=0", "responsePath": "results" } ] } -
Try it once. Nothing is listed: the node makes one real call to the upstream, exactly as an agent would.
npx aioum sell preview --file spec.json --tool times --args '{"lat":"59.91","lon":"10.75"}'It prints
okwith how many milliseconds the call took, then the output; a failure printsfailedwith the time and the upstream's error instead. A key the listing needs goes on the same command as--env MY_KEY=…, once per key; it is used for this one call and forgotten. -
Go live with it. This stakes and registers on-chain.
npx aioum sell add --file spec.json --env MY_KEY=…The same answer as step 3: key, service id, operator, price and node URL; step 5 gets it backed. A key passed with
--envstays in the node process; after a restart the node needs it in its own environment. On a real chain the node refuses runtime listings unless it was started withAIOUM_ADMIN_ALLOW_ADD=1. -
See what the node serves.
npx aioum sell listOne row per live listing: key, service id, category, price per call, operator and tool names. On the local development network the demo catalogue is in the same list.
-
See it as agents see it.
npx aioum service <serviceId>
The index's record: the id, category and descriptor, the price per call, the operator, whether it is live, the stake behind it, its node's URL, its tools, and its rating so far.
- Prove it is yours, when the API is your own.
npx aioum sell verify-domain api.example.com
Prints the two records that mark a listing as first-party, either one enough: a DNS TXT
record aioum-verify=<your operator address> on the domain, or
https://api.example.com/.well-known/aioum.json with { "operators": ["0x…"] }. Add one,
put "provider": { "domain": "api.example.com" } in the listing's spec, run the command
again: verified. The marketplace shows Official on the listing and ranks it first
among live ones. The importer sets provider for you (Integrate your service
directly).
- Take it down.
npx aioum sell remove <key>
The node stops serving it and marks it inactive on-chain, so the directory drops it; the CLI
prints removed "<key>" (service #<id>) and asks the indexer to re-scan. Sessions still open
settle as usual.
What you have now
A live listing with your price, your stake and an operator identity on-chain, previewed before
anyone could buy it. An agent that picks it opens an escrow session and sends one signed receipt
per call; the node serves each call, settles the latest receipt on-chain, your net share lands in
the operator wallet as USDC, and the agent rates the operator from what it was served. For a
machine of your own, a services.json the node reads at boot.
Next: The private node from the command line — a node of your own for the tools and data that must stay with you, wired to your agents.