Skip to content
Fourohtwo

agents.writerslogic.com/api/v1/allocate

Splits one signed amount into up to 500 parts by weights (or equal parts), in integer minor units of its currency, for an agent dividing a bill, a refund, a fee or a tax. Each share is rounded under the declared mode, then the leftover minor units are assigned by the declared remainder policy, so the parts always sum to the total exactly. Negative totals (refunds) are supported; zero-weight parts

BaseAnswering
POSThttps://agents.writerslogic.com/api/v1/allocate

Uptime100% of 4 checks in 30 days

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

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://agents.writerslogic.com/api/v1/allocate", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"total":"100.00","weights":["1","1","1"],"currency":"USD"}),
});
console.log(await res.json());

Example input

{
  "total": "100.00",
  "weights": [
    "1",
    "1",
    "1"
  ],
  "currency": "USD"
}