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 with AIOUM_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 ci run in offchain/.

Steps

  1. Browse the gallery.

    npx aioum sell templates --q price
    

    One 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. --json adds its tools and sample arguments. Without --q it lists all of them.

  2. Assemble a services.json for a node of your own.

    npx aioum sell config crypto-coingecko,defi-defillama --out services.json
    

    The node merges the templates' services blocks 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 answers wrote <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 in offchain/ next to a .env that sets AIOUM_NODE_TOKEN and 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.

  3. 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 12000
    

    The 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 prints listed "<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.

  4. Or sell a skill: a folder with SKILL.md and 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-use makes every load a paid call at --price; --mode one-time sells it once per agent, which then keeps it. --name, --description and --category default to the SKILL.md's name and description and the tag general (the listing's category is skill:<tag>); --node-dir <folder> lists a folder already on the node instead of uploading; --stake and --key as 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.

  5. 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 44
    

    Each state prints as it changes: requested; in review while 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; approved with backing 10,100 ZAI…; live with 10,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. A rejected ends with the reviewer's reasons instead; fix the listing (aioum sell remove, then add it again) and request again. --no-wait returns at once; aioum stake requests lists every request with its state.

  6. 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. A rest tool is a URL with each input in curly braces; responsePath returns 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" under headers, and hand the value over with --env when 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"
        }
      ]
    }
    
  7. 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 ok with how many milliseconds the call took, then the output; a failure prints failed with 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.

  8. 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 --env stays 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 with AIOUM_ADMIN_ALLOW_ADD=1.

  9. See what the node serves.

    npx aioum sell list
    

    One 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.

  10. 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.

  1. 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).

  1. 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.