Penny Exact Cost Split

Allocate one integer-cent bill by weights with deterministic rounding and exact totals.

Custom requests cost 0.04 USDC on Base.

Download example JSON · OpenAPI · Source and usage

Pay with a browser wallet · Open example in checkout

POST a JSON request to /penny-exact-cost-split/v1/check with an x402 V2 client.

Worked example

Request

{
  "cents": 100,
  "shares": [
    {
      "id": "a",
      "weight": 1
    },
    {
      "id": "b",
      "weight": 1
    },
    {
      "id": "c",
      "weight": 1
    }
  ]
}

Result

{
  "cents": 100,
  "allocations": [
    {
      "id": "a",
      "cents": 34
    },
    {
      "id": "b",
      "cents": 33
    },
    {
      "id": "c",
      "cents": 33
    }
  ]
}

Support catalog maintenance through GitHub Sponsors. Sponsor gptenv · Sponsor Jeremy Carter