Lets many agents agree which one works on a task
agents.writerslogic.com/api/v1/lease
Lets many agents agree which one works on a task: acquire a named resource for 1-3600 s, renew it while working, release it when done. Every new acquisition returns a strictly larger fencing token; pass it to the downstream store and reject writes carrying a smaller one, so a paused holder whose lease expired cannot clobber its successor. Re-acquiring as the current holder extends the lease with t
POST
https://agents.writerslogic.com/api/v1/leaseUptimeNot checked yet
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://agents.writerslogic.com/api/v1/lease", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"op":"acquire","holder":"worker-7","resource":"invoice:INV-1009","requestId":"w7-claim-INV-1009","ttlSeconds":60}),
});
console.log(await res.json());Example input
{
"op": "acquire",
"holder": "worker-7",
"resource": "invoice:INV-1009",
"requestId": "w7-claim-INV-1009",
"ttlSeconds": 60
}