Pack items into the smallest fitting carton (bounded heuristic)
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 an optimal solver: pass means a verified packing exists; fail only when a carton is provably impossible (an item exceeds every orientation, total volume or total weight exceeds the limit); unknown means no packing was found but none is proven impossible. Dunnage, void fill, item support and crush strength are not modelled.
What you get
A verified packing with coordinates, or a proof of impossibility, in one $0.005 call.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/carton-fit. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/carton-fit \
-H 'content-type: application/json' \
-d '{"items":[{"id":"book","l":24,"w":17,"h":3,"qty":3},{"id":"mug","l":10,"w":10,"h":5,"thisSideUp":true}],"boxes":[{"id":"small","l":20,"w":15,"h":10},{"id":"medium","l":30,"w":20,"h":15}]}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
items | array<object>; max 50 items | yes | At most 50 item lines and 50 units in total (sum of qty). |
boxes | array<object>; max 20 items | yes | At most 20. Use inner dimensions. |
Example request body
{
"items": [
{
"id": "book",
"l": 24,
"w": 17,
"h": 3,
"qty": 3
},
{
"id": "mug",
"l": 10,
"w": 10,
"h": 5,
"thisSideUp": true
}
],
"boxes": [
{
"id": "small",
"l": 20,
"w": 15,
"h": 10
},
{
"id": "medium",
"l": 30,
"w": 20,
"h": 15
}
]
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
heuristic | boolean | no | Always true: the packer is a heuristic, not an optimal solver. |
recommendedBox | one of | no | |
boxes | array<object> | no | |
placements | array<object> | no | For the recommended carton: lower corner (x,y,z) and placed size (l,w,h) of every unit, in the caller's unit. |
totalWeight | one of | no | |
steps | integer | no | Overlap tests used of the step cap. |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the physical-ops-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent