Everyone's writing about "the agent economy." Agents that hire agents, pay for tools, settle automatically. Lovely slides.
What I actually wanted was smaller: could I take a tiny HTTP endpoint I already had, list it so an autonomous agent can find it, and have it get paid per call — without a SaaS billing system?
Yes. The loop took about 15 minutes. Here's the path, including the dumb thing that cost me ten of those minutes.
Crypto stays off this title on purpose. Settlement exists; the hook is ship a tool, it gets paid.
The mental model (30 seconds)
There's an open catalog — the AIMarket Hub — between people who publish HTTP capabilities and agents that consume them.
You give the hub a manifest: name, price, input/output schemas, and a public invoke_url. When an agent searches, finds your capability, and invokes it, the hub routes the call and meters the payment. The demand-side reference client is ARGUS. Any MCP or HTTP client works.
You do not need the factory monorepo. You need a POST endpoint and the hub CLI.
If you don't even have an endpoint yet, create-aimarket-agent scaffolds a signed provider. This article is the listing step that article leaves manual.
0 · Prereqs (2 min)
- Python 3.11+
- Hub CLI from PyPI:
aimarket-hub3.2.1
pip install aimarket-hub
git clone https://github.com/alexar76/aimarket-hub.git
cd aimarket-hub
A hub to publish to:
-
Local (this walkthrough):
aimarket serve→http://127.0.0.1:9083 -
Public:
https://modelmarket.dev(production listing has extra gates — stake, signed responses. Don't start there.)
1 · Run the example capability (3 min)
The repo ships a working greeter at examples/hello-capability:
cd examples/hello-capability
python3 server.py
# → hello-capability listening on http://127.0.0.1:3456/invoke
# → provider_pubkey (put in capability.json): …
The contract is boring on purpose. POST JSON, get JSON:
curl -s -X POST http://127.0.0.1:3456/invoke \
-H 'Content-Type: application/json' \
-d '{"input":{"name":"dev"}}'
# → {"success":true,"result":{"greeting":"Hello, dev!","from":"hello-capability"}}
Your server receives { "input": {...}, "product_id": "...", "capability_id": "..." } and returns HTTP 200 with {"result": {...}}. Any framework that can serve a POST qualifies. This example also sets X-Provider-Signature (Ed25519) so a production hub can verify the payload.
2 · Write the manifest (2 min)
examples/hello-capability/capability.json is already filled for local dev:
{
"product_id": "demo-hello",
"capability_id": "greet@v1",
"name": "greet",
"description": "Says hello — 15-minute developer demo capability",
"invoke_url": "http://127.0.0.1:3456/invoke",
"price_per_call_usd": 0.01,
"publisher": "community",
"input_schema": {
"type": "object",
"properties": { "name": { "type": "string", "description": "Who to greet" } }
},
"output_schema": {
"type": "object",
"properties": { "greeting": { "type": "string" } }
}
}
price_per_call_usd is what a caller pays per successful invoke. capability_id is name@v1. For a public listing, swap invoke_url for HTTPS (or a tunnel) and put the printed provider_pubkey into the manifest.
3 · Publish (2 min)
Local hub, second terminal:
aimarket serve # if it isn't already running
export AIMARKET_ALLOW_LOCAL_PUBLISH=1 # dev only — see the next section
aimarket publish capability.json --hub http://127.0.0.1:9083
aimarket invoke demo-hello/greet@v1 --input '{"name":"dev"}'
Now it's in the catalog. An agent can search, invoke, and you earn on settlement.
Public hub (after the URL is reachable):
aimarket publish capability.json --hub https://modelmarket.dev
That path wants a publish token (AIMARKET_PUBLISH_TOKEN) and, on a hardened hub, the supply-security steps in docs/supply-security.md. Do the local loop first.
Where it bit me
My first aimarket publish against a local hub kept failing. I spent ten minutes assuming the JSON was malformed. It wasn't.
The hub rejects an invoke_url that isn't publicly reachable. http://127.0.0.1:3456 is not a thing an agent on another machine can call, so it refuses to list it. That's correct — a catalog full of localhost rows is useless — but the error did not scream "your URL is local."
The escape hatch is one env var on the hub process, not the greeter:
export AIMARKET_ALLOW_LOCAL_PUBLISH=1 # dev only
If the hub is in Docker, 127.0.0.1 is the container. Use CAPABILITY_PUBLIC_HOST on the example server and AIMARKET_INVOKE_HOST_GATEWAY=host.docker.internal on the hub (publish.sh in the example folder).
In real life you point invoke_url at public HTTPS or a tunnel. When publish refuses, check reachability before you re-read the schema for the fifth time.
The part I didn't have to build
I wrote a 30-line greeter. Production hubs don't run on vibes:
- a stake before you list (skin in the game),
- LUMEN trust scoring — low-trust and duplicate listings drop out of discovery,
- Ed25519-signed provider responses, request-bound so nobody swaps the payload a caller paid for,
- slashing on bad invokes.
That's the hub's job. It's also why I would let a stranger's agent call my endpoint.
Settlement on the public rails is USDC on Base. You don't need a wallet to walk the local 15-minute loop.
Try it
MIT. Example, CLI, and a developer quickstart in 20 languages:
- Example: github.com/alexar76/aimarket-hub/tree/main/examples/hello-capability
- Package:
pip install aimarket-hub - ARGUS (the agent that discovers + invokes): github.com/alexar76/argus
- 20-language guide: argus/docs/developer-guide
- 40-second explainer (optional): YouTube E05
If "my API, but agents can find it and pay for it" is a thing you've wanted, clone it and publish your own capability. A ⭐ on aimarket-hub helps other people find the example.





Top comments (0)