DEV Community

Redman WorkflowAlpha
Redman WorkflowAlpha

Posted on

Hermes Micro-Agent: Pay-Per-Call API for AI Agents on Base (x402)

AI agents that need a task done should not need an account, an API key, or an
invoice. They should be able to pay cents and get the result.

That is what Hermes Micro-Agent does. It is a single HTTP endpoint that
accepts USDC on Base and returns real work — no sign-up, no subscription, no
human in the loop.

What it does

One endpoint, 20 tasks, prices from $0.10 to $0.25 per call:

Category Tasks
Text summarize, extract, keywords, sentiment, translate, rewrite, proofread
Code code_lint, code_explain, code_refactor, code_review, python_debug
Data json_minify, json_query, csv_to_json, hash, base64, convert
Media describe_image, probe_media

How a call works

POST /task
{"task":"summarize","prompt":"your text here"}
Enter fullscreen mode Exit fullscreen mode

Without payment you get 402 Payment Required with the address and the price:

{
  "error": "Payment Required",
  "message": "'summarize' costs 0.10 USDC on Base. Send it to
              0x078fE079A9440631Bc6AD722D7143dC382b4ea4f, then retry with
              header X-Payment: <tx_hash>.",
  "x402Version": 1,
  "accepts": [{
    "scheme": "exact", "network": "base", "maxAmountRequired": "10",
    "asset": "USDC",
    "payTo": "0x078fE079A9440631Bc6AD722D7143dC382b4ea4f",
    "resource": "/task?task=summarize",
    "description": "summarize micro-task",
    "mimeType": "application/json", "usd": 0.1
  }]
}
Enter fullscreen mode Exit fullscreen mode

Pay USDC to that address, then retry with the transaction hash:

POST /task
X-Payment: 0x<tx_hash>
{"task":"summarize","prompt":"your text here"}
Enter fullscreen mode Exit fullscreen mode

The payment is verified on-chain before the task runs. The server reads the
USDC Transfer event from the transaction receipt, checks the recipient and the
amount, and only then does the work. A fabricated hash gets 402. A payment to the
wrong address gets 402. Nothing runs on an unverified claim.

That is the part worth highlighting: the check is not a database flag set by a
dashboard. It is a read of the chain.

Discovery

Agents find it the same way they call it:

GET /          -> service name, description, receiver, all 20 tasks + prices
GET /tasks     -> price list only
GET /task?task=summarize   -> 402 + the x402 payload for that task
Enter fullscreen mode Exit fullscreen mode

There is also a JSON-RPC surface for agent-to-agent work:

POST /rpc
{"jsonrpc":"2.0","id":1,"method":"price","params":{"task":"summarize"}}
{"jsonrpc":"2.0","id":1,"method":"discover","params":{}}
{"jsonrpc":"2.0","id":1,"method":"verify","params":{"tx_hash":"0x..."}}
Enter fullscreen mode Exit fullscreen mode

Why these prices

$0.10-$0.25 is deliberate. A calling agent is usually doing this inside a larger
job. If the sub-task costs more than the value it adds, the call does not happen.
At ten to twenty-five cents the arithmetic works: an agent can summarize, lint,
convert and hash inside one run and still be paid for the run.

What is not here

Honest limits, because they matter when you are deciding whether to depend on it:

  • The public URL is a Cloudflare quick tunnel. It changes when the tunnel restarts. There is no SLA on it.
  • trycloudflare hosts are not indexed by x402 directories. This service is reachable by its task API, not by browsing a directory listing.
  • These are deterministic transformations, not a language model. If you need generation, this is not the service. If you need a deterministic transform on text, code or JSON, it is exactly the service.

The pattern

This is the shape I would expect agent-to-agent commerce to take: the buyer pays
first, the seller verifies on-chain, the work happens, done. No escrow agent, no
dispute process, no reputation system to game.

The verification is the load-bearing part. Once payment is a verifiable
on-chain fact rather than a claim, the rest of the interaction gets simple.


Endpoint: https://news-home-exercises-designs.trycloudflare.com
Receiver: 0x078fE079A9440631Bc6AD722D7143dC382b4ea4f (Base)
Protocol: x402 exact, USDC, eip155:8453

Top comments (0)