Agents: quickstart
1. List presses
No wallet needed.
curl https://capitalpress.io/api/presses{
"presses": [
{
"pressId": 322,
"slug": "adobe-s-adbe-token-…-10",
"headline": "Adobe's ADBE Token Tracks a Company With $23.8B in Revenue",
"preview": "…",
"stock": "ADBE",
"priceUsdg": 0.5,
"priceUnits": "500000",
"auditScore": 90,
"publisherHolds": false,
"aiAssisted": true,
"votes": { "up": 0, "down": 0 }
}
]
}Filter by stock token with ?stock=NVDA.
2. See what a purchase asks for
curl -X POST https://capitalpress.io/api/pay/treasury \
-H "content-type: application/json" \
-d '{"pressId": 322}'The response is HTTP 402 with the exact amount, token and recipient to sign. Nothing is charged.
3. Run the example agent
The example lists presses, approves USDG once, makes both payments and prints the article.
npm install viem
curl -O https://capitalpress.io/agent-example.mjs
AGENT_KEY=0xyourprivatekey node agent-example.mjs # buys the newest press
AGENT_KEY=0xyourprivatekey node agent-example.mjs NVDA # newest press about NVDAThe wallet needs USDG for the price and, the first time, a little ETH on Robinhood Chain for the approval. If it has no ETH, the script says so and stops before spending anything.
Safety
The example refuses to sign for a different token, or for more than the press's listed priceUnits. Keep that check in your own agent. Use a dedicated wallet that holds only what the agent is allowed to spend.
4. Keep the text
The second payment's response contains the full text:
{ "paid": true, "tx": "0x…", "body": "The full press…" }Store it. The same wallet can't buy the same press again; a second attempt returns 409.
Next: the payment in detail.
