REST API

API Documentation

Integrate CutOptimizer's 1D cutting optimization directly into your application. Start optimizing programmatically using your API key.

Base URL: https://optimizerapi.sysgadh.comREST / JSON

1D Optimization

Submit 1D (linear) cutting jobs and retrieve results.

POST
/optimize-1d

Run 1D optimization

Submits a 1D cutting optimization job. Returns a job_id and status 'pending'.

bash
curl -X POST https://optimizerapi.sysgadh.com/optimize-1d \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "stock": [
    {
      "length": 6000,
      "pcs": 10
    },
    {
      "length": 3000,
      "pcs": 5
    }
  ],
  "requiredCut": [
    {
      "length": 1200,
      "pcs": 8,
      "angle_start": 0,
      "angle_end": 0
    },
    {
      "length": 800,
      "pcs": 12,
      "angle_start": 45,
      "angle_end": 0
    }
  ],
  "kerf": 3,
  "allow_partial": false
}'
GET
/optimize-1d/status/{job_id}

Check 1D job status

Polls the status of an async 1D optimization job. Poll every 1–2 seconds until status is 'completed'.

bash
curl https://optimizerapi.sysgadh.com/optimize-1d/status/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY"
GET
/optimize-1d/result/{job_id}

Get 1D optimization result

Retrieves the full result of a completed 1D job.

bash
curl https://optimizerapi.sysgadh.com/optimize-1d/result/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY"

2D Optimization

Submit 2D (sheet) cutting jobs and retrieve results.

POST
/optimize-2d

Run 2D optimization

Submits a 2D sheet cutting optimization job. Returns a job_id and status 'pending'.

bash
curl -X POST https://optimizerapi.sysgadh.com/optimize-2d \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "stock": [
    {
      "length": 6000,
      "pcs": 10
    },
    {
      "length": 3000,
      "pcs": 5
    }
  ],
  "requiredCut": [
    {
      "length": 1200,
      "pcs": 8,
      "angle_start": 0,
      "angle_end": 0
    },
    {
      "length": 800,
      "pcs": 12,
      "angle_start": 45,
      "angle_end": 0
    }
  ],
  "kerf": 3,
  "allow_partial": false
}'
GET
/optimize-2d/status/{job_id}

Check 2D job status

Polls the status of an async 2D optimization job.

bash
curl https://optimizerapi.sysgadh.com/optimize-2d/status/8a1e6679... \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY"
GET
/optimize-2d/result/{job_id}

Get 2D optimization result

Retrieves the full result of a completed 2D job.

bash
curl https://optimizerapi.sysgadh.com/optimize-2d/result/8a1e6679... \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY"

History & Exports

Access past runs, re-optimize, and download PDF/DXF reports.

GET
/history

List optimization history

Returns a paginated list of your past optimization runs.

bash
curl "https://optimizerapi.sysgadh.com/history?page=1&per_page=20" \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY"
GET
/history/{run_id}

Get run detail

Returns the full input data and result for a specific run.

bash
curl https://optimizerapi.sysgadh.com/history/7c9e6679... \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY"
POST
/history/{run_id}/reoptimize-1d

Re-optimize 1D Run

Re-runs an existing 1D job with updated inputs and overwrites its history.

bash
curl -X POST https://optimizerapi.sysgadh.com/history/7c9e6679.../reoptimize-1d \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'
POST
/history/{run_id}/reoptimize-2d

Re-optimize 2D Run

Re-runs an existing 2D job with updated inputs and overwrites its history.

bash
curl -X POST https://optimizerapi.sysgadh.com/history/8a1e6679.../reoptimize-2d \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'
GET
/history/{run_id}/export-pdf-1d-summary

Export 1D Summary PDF

Downloads a PDF file containing the tabular summary of the 1D optimization.

bash
curl -O -J https://optimizerapi.sysgadh.com/history/7c9e6679.../export-pdf-1d-summary \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY"
GET
/history/{run_id}/export-pdf-1d-diagram

Export 1D Diagram PDF

Downloads a PDF file containing the bar cutting diagrams.

bash
curl -O -J https://optimizerapi.sysgadh.com/history/7c9e6679.../export-pdf-1d-diagram \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY"
GET
/history/{run_id}/export-pdf-2d-summary

Export 2D Summary PDF

Downloads a PDF file containing the tabular summary of the 2D optimization.

bash
curl -O -J https://optimizerapi.sysgadh.com/history/8a1e6679.../export-pdf-2d-summary \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY"
GET
/history/{run_id}/export-pdf-2d-diagram

Export 2D Diagram PDF

Downloads a landscape PDF file containing the 2D sheet layout diagrams.

bash
curl -O -J https://optimizerapi.sysgadh.com/history/8a1e6679.../export-pdf-2d-diagram \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY"
GET
/history/{run_id}/export-dxf-2d

Export 2D DXF

Downloads a DXF CAD file containing the 2D sheet layouts.

bash
curl -O -J https://optimizerapi.sysgadh.com/history/8a1e6679.../export-dxf-2d \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY"
DELETE
/history/{run_id}

Delete a run

Permanently deletes an optimization run.

bash
curl -X DELETE https://optimizerapi.sysgadh.com/history/7c9e6679... \
  -H "Authorization: Bearer cutopt_YOUR_API_KEY"

Error Codes

All errors return JSON with a detail field.

CodeMeaningWhen it happens
401UnauthorizedMissing or invalid API key / session expired
400Bad RequestInvalid request body (e.g. empty stock list, exceeded limits)
404Not FoundJob ID or resource does not exist for your account
422Validation ErrorRequest body fails schema validation — check field types
429Too Many RequestsRate limit exceeded — slow down requests
500Server ErrorUnexpected server error — retry after a few seconds
json
// All error responses follow this shape:
{
  "detail": "Not authenticated"
}