curl¶
bash
curl -X POST https://api.cutweaver.io/v1/solve \
-H "Content-Type: application/json" \
-H "X-API-Key: $CNW_API_KEY" \
-d @request.json | jq .
With ALNS and SVG¶
bash
curl -X POST https://api.cutweaver.io/v1/solve \
-H "Content-Type: application/json" \
-H "X-API-Key: $CNW_API_KEY" \
-d '{
"sheets": [{"width": 3210, "height": 2250}],
"pieces": [
{"width": 800, "height": 600, "quantity": 8},
{"width": 1200, "height": 900, "quantity": 3}
],
"params": {"kerf": 4, "marginLeft": 10, "marginRight": 10},
"strategy": "alns",
"alnsConfig": {"iterations": 5000, "threads": 4, "seed": 42},
"includeSvg": true
}' \
| jq -r '.result.sheets[0].svg' > sheet0.svg
Health check from a script¶
bash
if ! curl -fsS https://api.cutweaver.io/health > /dev/null; then
echo "CutWeaver API is down" >&2
exit 1
fi