Skip to content

Developers

Add cutting plans to your own software or AI agent with the uucut.cc API and MCP server: one HTTP request per job, JSON in and out.

The uucut.cc API runs the same optimizer as the web app. Send your sheets, parts and options as JSON; get back the layouts, offcuts, cut order and totals. Use it for quoting in an online shop, nesting inside an ERP, or a cut list feature in your own app. AI assistants such as Claude Code and Cursor can use it through the MCP server.

The complete reference, with every field and an interactive “Try it out” panel, is at /api/docs.

Get an API key

  1. Sign up for a free account and confirm your email. You get 30 optimizations to start.
  2. In the app, open Settings → API keys and create a key. Copy it right away: it is shown only once.

Send the key in every request:

Authorization: Bearer <your key>

Check that the service is up with GET /api/health (no key needed). A wrong key returns 401 and uses no credits.

Your first request

curl https://uucut.cc/api/v1/cut \
  -H "Authorization: Bearer $UUCUT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Cabinet",
    "sheets": [{"id": "s1", "label": "Plywood 18", "width": 2440, "height": 1220, "quantity": 10}],
    "items": [
      {"id": "side",  "label": "Side",  "width": 720, "height": 560, "quantity": 4},
      {"id": "shelf", "label": "Shelf", "width": 764, "height": 540, "quantity": 6},
      {"id": "door",  "label": "Door",  "width": 716, "height": 396, "quantity": 4, "orientation": 1}
    ],
    "options": {"kerf": 4}
  }'
  • sheets: stock sizes and how many you have. Several sizes may be mixed; the optimizer chooses.
  • items: parts with their finished size. orientation 0 may rotate, 1 keeps the given direction (grain), 2 must rotate.
  • options: kerf, trim, edge banding, offcut thresholds, stack cutting. All default to 0 or off.

Parts can also carry edges for edge banding ("TB", "L1L2W1"), a material, and sheets a price or offcut flag. See the guide for what each one means.

The response

The main fields of the result:

Field Meaning
optimal true when the plan is proven optimal
utility Part area ÷ sheet area used, 0 to 1
sheets, items Number of sheets used and parts cut
distributions One entry per cutting pattern: the sheet, how many sheets (occurance), placed parts (layout), offcuts and ordered cuts
unsatisfied Parts that could not be cut, with unfit (larger than every sheet) and no_sheet (no sheet of that material)
cut_count, cut_length, fence_settings, band_length Totals for the shop floor
total_price Total sheet cost, when every full sheet has a price
summary A short plain-English summary of the plan, ready to show to a person
share_url With ?share=true on the request: a read-only page with the drawn layouts (the task is also saved in your task list)

Coordinates start at the lower-left corner of the sheet, x along width, y along height. Each placed part has its lower-left corner, its cut size and, with edge banding, its finished size.

Units

Lengths are plain numbers in one unit of your choice, and the result uses the same unit. Use mm, or inches as decimals (23.625). Lengths may also be strings with fractions and feet, read as inches when feet are given: "23 5/8", "7' 6\"". The optional "unit" (mm, cm, m, in, ft-in) does not change the result; it is returned, used in summary and on the share page.

Limits and credits

  • Each request computes one task and uses one optimization from your account balance, the same balance as the web app. Top up when you need more.
  • Up to 10 requests per minute per account, across all your keys. For several jobs, send one request per job.
  • One request is solved in about 30 seconds at most. Large jobs may return a very good plan that is not proven optimal (optimal: false). For faster answers, set options.time_limit in seconds (1 to 30), for example "time_limit": 5: the optimizer returns the best plan found by then, which may use slightly more material.
  • Credits are refunded when solving fails.

Errors

Errors return an HTTP status and a JSON body with detail and an error object: a stable code, a message, the field that is wrong and a hint. 402 errors include buy_url; 429 responses have a Retry-After header.

{"detail": [...], "error": {"code": "invalid_input", "message": "items[2].width: Input should be greater than 0", "field": "items[2].width", "hint": "..."}}

Check a task without solving and without using a credit with POST /api/v1/validate: it reports invalid fields, parts larger than every sheet, parts with no sheet of their material, not enough stock and likely unit mistakes.

To draw a result, send it back to POST /api/v1/render/svg ({"solution": <the /cut result>, "sheet": 0, "cuts": true}, returns one layout as SVG) or POST /api/v1/render/pdf (a printable A4 plan: a summary page and one page per layout). Both are free. With ?share=true the plan is also at /api/share/<token>/plan.pdf.

Status When
401 Missing or invalid API key
402 Not enough credits
422 Invalid input; error.field names the field
429 Rate limit, or the solver is busy: retry after a short wait

AI agents and MCP

AI assistants such as Claude, ChatGPT and Cursor can use uucut.cc through its MCP server (Streamable HTTP):

URL:    https://uucut.cc/api/mcp
Header: Authorization: Bearer <your key>

Tools: optimize_cutting (uses one credit, returns the summary, a share link with the drawn layouts and the totals), validate_cutting_task and account_credits (free). For clients that only start local servers, use mcp-remote:

{"mcpServers": {"uucut": {"command": "npx", "args": ["-y", "mcp-remote", "https://uucut.cc/api/mcp",
  "--header", "Authorization:Bearer ${UUCUT_KEY}"], "env": {"UUCUT_KEY": "<your key>"}}}}

A short description for language models is at /llms.txt. The server is listed in the MCP Registry as io.github.nlog2n/uucut.

The OpenAPI spec, runnable curl, Python and Node examples and the MCP configuration are on GitHub: nlog2n/uucut-api.

Contact

Building an integration, need higher limits or a different output format? Write to [email protected].