API and MCP
Cubefit exposes the same packing engine the website uses. Call it from your warehouse software over HTTPS, or from Claude, Cursor and ChatGPT through the MCP server on mcp.cubefit.app.
HTTP API
Same packing engine as the website. Call it over HTTPS from your WMS, ERP or backend. Dimensions are millimetres unless you set unit; weight is kilograms.
- Base URL
- https://cubefit.app
- Authentication
- Send Authorization: Bearer pk_… or sk_…. Publishable keys (pk_) need an exact Origin allowlist match and are for browser or embed use. Secret keys (sk_) are for servers and MCP; do not send a browser Origin with an sk_ key.
- Error shape
- Errors return JSON with error.code, error.message and usually error.requestId. Validation failures may include error.param.
{
"error": {
"code": "invalid_request",
"message": "Validation failed (box.length)",
"requestId": "req_…",
"param": "box.length"
}
}POST /api/v1/pack
Pack one carton SKU onto a pallet. Default response omits placements and geometry; pass include: ["placements"] or ["geometry"] when you need them. The example below is a Euro pallet with a 400×300×200 mm carton (12 pcs/box) under 1800 mm: 8 per layer, 8 layers, 64 boxes.
Request example
{
"pallet": {
"length": 1200,
"width": 800,
"deckHeight": 144,
"preset": "euro"
},
"box": {
"length": 400,
"width": 300,
"height": 200,
"qtyPerBox": 12
},
"targetHeight": 1800,
"allowRotate": false,
"unit": "mm",
"mode": "pallet"
}Response example
{
"orientation": {
"id": "pack",
"length": 400,
"width": 300,
"height": 200,
"tipped": false
},
"layer": {
"boxesPerLayer": 8,
"placements": [],
"usedArea": 960000,
"wasteArea": 20100,
"fillPercent": 97.9
},
"layerCount": 8,
"totalBoxes": 64,
"productQty": 768,
"heightUsed": 1744,
"targetHeight": 1800,
"heightRemainingMm": 56,
"nextLayerOverrunMm": 144,
"unusedFootprintMm2": 20100,
"fillPercent": 97.9,
"weightTotalKg": null,
"warnings": [
{
"code": "HEIGHT_SPACE_LEFT",
"message": "HEIGHT_SPACE_LEFT"
}
],
"layerStrategy": "uniform",
"alternateLayers": false,
"fullLayerCount": 8,
"topLayerBoxCount": 8
}curl
curl -X POST https://cubefit.app/api/v1/pack \
-H "Authorization: Bearer sk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"pallet":{"length":1200,"width":800,"deckHeight":144,"preset":"euro"},"box":{"length":400,"width":300,"height":200,"qtyPerBox":12},"targetHeight":1800,"allowRotate":false,"unit":"mm","mode":"pallet"}'GET /api/v1/presets
Lists Cubefit pallet presets with length, width, deck height and empty weight.
Response example
{
"object": "list",
"data": [
{
"id": "euro",
"label": "Euro / EPAL 1200×800",
"length": 1200,
"width": 800,
"deckHeight": 144,
"emptyWeightKg": 25,
"group": "common"
}
]
}curl
curl https://cubefit.app/api/v1/presets \ -H "Authorization: Bearer sk_test_YOUR_KEY"
Connect with MCP
Point your MCP client at https://mcp.cubefit.app/mcp with a secret key (sk_). Streamable HTTP transport. Keys are issued by Clickaply; use Contact us to request access.
Claude Desktop
{
"mcpServers": {
"cubefit": {
"url": "https://mcp.cubefit.app/mcp",
"headers": {
"Authorization": "Bearer sk_test_YOUR_KEY"
}
}
}
}Cursor
{
"mcpServers": {
"cubefit": {
"url": "https://mcp.cubefit.app/mcp",
"headers": {
"Authorization": "Bearer sk_test_YOUR_KEY"
}
}
}
}ChatGPT
MCP URL: https://mcp.cubefit.app/mcp · Auth header Bearer sk_…
Tools
pack_pallet– pack one carton onto a palletlist_pallet_presets– Euro, UK, GMA, CHEP, ISO sizescompare_pallets– rank presets for one carton (MCP only; no HTTP compare route)
Example prompts
- Pack a 400×300×200 mm carton on a Euro pallet with max height 1800 mm and show boxes per layer.
- Compare that carton on Euro, UK and GMA pallets under 1800 mm and 1000 kg.
- List Cubefit pallet presets with deck height and tare weight.
Limits
Burst and monthly quotas apply per key. Publishable keys (pk_) are origin-locked and pack-only. Secret keys (sk_) are for servers and MCP. Dimensions are in millimetres unless noted; weight in kilograms.
Get a key
API and MCP access is invite-only while we finish billing. Request a test key (sk_test_…) with Contact us and tell us your use case.