Skip to content
Fourohtwo

agents.writerslogic.com/api/v1/carton-fit

Checks whether up to 50 box-shaped items (axis-aligned, 90-degree rotations, optional this-side-up lock, optional weights) fit into any of up to 20 candidate cartons, and recommends the smallest-volume carton for which a packing was found, with coordinates for every item. For shipping and fulfilment agents sizing a parcel. The packing is a greedy extreme-point HEURISTIC with a fixed step cap, not

BaseUnchecked
POSThttps://agents.writerslogic.com/api/v1/carton-fit

UptimeNot 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/carton-fit", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"boxes":[{"h":10,"l":20,"w":15,"id":"small"},{"h":15,"l":30,"w":20,"id":"medium"}],"items":[{"h":3,"l":24,"w":17,"id":"book","qty":3},{"h":5,"l":10,"w":10,"id":"mug","thisSideUp":true}]}),
});
console.log(await res.json());

Example input

{
  "boxes": [
    {
      "h": 10,
      "l": 20,
      "w": 15,
      "id": "small"
    },
    {
      "h": 15,
      "l": 30,
      "w": 20,
      "id": "medium"
    }
  ],
  "items": [
    {
      "h": 3,
      "l": 24,
      "w": 17,
      "id": "book",
      "qty": 3
    },
    {
      "h": 5,
      "l": 10,
      "w": 10,
      "id": "mug",
      "thisSideUp": true
    }
  ]
}