# WritersLogic Carton Fit — 3D Bin Packing API

> WritersLogic Carton Fit — 3D Bin Packing API is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Checks whether up to 50 box-shaped items fit into any of up to 20 candidate cartons and recommends the smallest-volume carton with per-item placement coordinates

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/carton-fit?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-carton-fit-3d-bin-packing-api-ecf244ed
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2c8hCelGyENVGHAi3AFJ8

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability writerslogic-carton-fit-3d-bin-packing-api-ecf244ed -d '<json body>'
```

Example prompt: I need to ship 3 items — a 12×8×4 inch book (2 lb, must stay upright), a 6×6×6 inch cube (1 lb), and a 10×4×3 inch tube (0.5 lb) — check whether they fit into any of these cartons: a 14×10×8 inch box (max 10 lb) or an 18×12×10 inch box (max 20 lb), and tell me the smallest one that works with where each item goes.

## When to prefer this

Use this endpoint when an AI agent or fulfillment system needs to automatically select a shipping carton from a list of candidates and needs placement coordinates for packing verification. It handles axis-aligned rotations, this-side-up constraints, and weight limits in one call. Prefer it over manual sizing tables when dealing with mixed SKU orders or when you need machine-readable placement data. Note that it uses a greedy heuristic — an 'unknown' result does not mean packing is impossible, so consider retrying with relaxed constraints or a larger carton.

## Known failure modes

- Item exceeds all carton orientations in at least one dimension — returns fail status
- Total item volume exceeds carton volume — returns fail status
- Total item weight exceeds carton maxWeight — returns fail status
- Heuristic finds no packing but cannot prove impossibility — returns unknown status (may still be packable)
- More than 50 total item units (sum of qty) — validation error
- More than 20 cartons submitted — validation error
- Dimension values out of allowed range (< 0.001 or > 100000) — validation error
- Weight fields missing on some items when carton maxWeight is set — schema error

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

Returns the smallest-volume carton for which a valid packing was found (status: pass), along with 3D placement coordinates (x, y, z position and chosen orientation) for every item. For cartons that failed, returns status fail (provably impossible due to dimension or weight excess) or unknown (heuristic found no solution but cannot prove impossibility). Includes the winning carton's id and volume.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "boxes": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "l",
     "w",
     "h"
    ],
    "properties": {
     "h": {
      "type": "number",
      "maximum": 100000,
      "minimum": 0.001,
      "description": "Inner height."
     },
     "l": {
      "type": "number",
      "maximum": 100000,
      "minimum": 0.001,
      "description": "Inner length."
     },
     "w": {
      "type": "number",
      "maximum": 100000,
      "minimum": 0.001,
      "description": "Inner width."
     },
     "id": {
      "type": "string",
      "maxLength": 64,
      "description": "Carton id (unique)."
     },
     "maxWeight": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0,
      "description": "Maximum content weight; requires every item to carry a weight."
     }
    }
   },
   "maxItems": 20,
   "minItems": 1,
   "description": "At most 20. Use inner dimensions."
  },
  "items": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "id",
     "l",
     "w",
     "h"
    ],
    "properties": {
     "h": {
      "type": "number",
      "maximum": 100000,
      "minimum": 0.001,
      "description": "Height (the vertical axis when thisSideUp)."
     },
     "l": {
      "type": "number",
      "maximum": 100000,
      "minimum": 0.001,
      "description": "Length, at most 3 decimals."
     },
     "w": {
      "type": "number",
      "maximum": 100000,
      "minimum": 0.001,
      "description": "Width."
     },
     "id": {
      "type": "string",
      "maxLength": 64,
      "description": "Item id (unique)."
     },
     "qty": {
      "type": "integer",
      "maximum": 50,
      "minimum": 1,
      "description": "Copies of this item (default 1)."
     },
     "weight": {
      "type": "number",
      "maximum": 1000000000,
      "minimum": 0,
      "description": "Weight in one unit shared with maxWeight."
     },
     "thisSideUp": {
      "type": "boolean",
      "description": "Keep h vertical (only rotation about the vertical axis allowed)."
     }
    }
   },
   "maxItems": 50,
   "minItems": 1,
   "description": "At most 50 item lines and 50 units in total (sum of qty)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-carton-fit-3d-bin-packing-api-ecf244ed/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
