# Cut List & Kerf API
> Cut-list maths for woodworking and material cutting as an API, computed locally and deterministically. The cuts endpoint computes how many pieces of a target length come from one stock length once the saw kerf — the width of material each cut removes — is accounted for, using pieces = floor((stock + kerf)/(piece + kerf)) since the final cut leaves no kerf, and returns the used length, the leftover offcut, the waste percentage and the total kerf loss; a 2400 mm board cut into 300 mm pieces with a 3 mm kerf yields 7 pieces with a 282 mm offcut, not the 8 you would expect ignoring the blade. The boards endpoint works out how many stock lengths a job of a given quantity needs and how many spare pieces are left over. The yield endpoint reports the overall material efficiency — total piece length divided by total stock length — for a whole cutting job. All lengths share one consistent unit (mm, cm or inches). Everything is computed locally and deterministically, so it is instant and private. Ideal for woodworking, carpentry, metal-fabrication, contractor, maker and shop-software developers, cut-list and offcut calculators, and material-ordering tools. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is single-length (1D) cut optimisation; for loose-material volume use a mulch/volume API.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/kerf-api/..."
```

## Pricing
- **Free** (Free) — 7,600 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 76,000 calls/Mo, 6 req/s
- **Pro** ($11/Mo) — 335,000 calls/Mo, 15 req/s
- **Mega** ($33/Mo) — 1,780,000 calls/Mo, 40 req/s

## Endpoints

### CutList

#### `GET /v1/boards` — Stock needed for a quantity

**Parameters:**
- `stock_length` (query, required, string) — Stock length Example: `2400`
- `piece_length` (query, required, string) — Cut piece length Example: `300`
- `quantity` (query, required, string) — Pieces needed Example: `20`
- `kerf` (query, optional, string) — Saw kerf per cut Example: `3`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/kerf-api/v1/boards?stock_length=2400&piece_length=300&quantity=20&kerf=3"
```

**Response:**
```json
{
    "data": {
        "note": "Stock needed = ⌈quantity / pieces-per-stock⌉. Leftover pieces are spare cuts on the last stock length.",
        "inputs": {
            "kerf": 3,
            "quantity": 20,
            "piece_length": 300,
            "stock_length": 2400
        },
        "stock_needed": 3,
        "leftover_pieces": 1,
        "total_kerf_loss": 54,
        "pieces_per_stock": 7
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:19.200Z",
        "request_id": "16c36576-4ef7-4b06-8ea6-bcb12d79b530"
    },
    "status": "ok",
    "message": "Stock needed",
    "success": true
}
```

#### `GET /v1/cuts` — Pieces per stock length

**Parameters:**
- `stock_length` (query, required, string) — Stock length Example: `2400`
- `piece_length` (query, required, string) — Cut piece length Example: `300`
- `kerf` (query, optional, string) — Saw kerf per cut (default 0) Example: `3`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/kerf-api/v1/cuts?stock_length=2400&piece_length=300&kerf=3"
```

**Response:**
```json
{
    "data": {
        "note": "Pieces per stock = floor((stock + kerf)/(piece + kerf)); the final cut needs no kerf. The offcut is what's left over on one stock length.",
        "inputs": {
            "kerf": 3,
            "piece_length": 300,
            "stock_length": 2400
        },
        "kerf_loss": 18,
        "used_length": 2118,
        "offcut_length": 282,
        "waste_percent": 11.75,
        "pieces_per_stock": 7
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:19.313Z",
        "request_id": "77c5b2bb-1d16-4b01-a436-fb8c9f64ac03"
    },
    "status": "ok",
    "message": "Pieces per stock",
    "success": true
}
```

#### `GET /v1/yield` — Material efficiency

**Parameters:**
- `stock_length` (query, required, string) — Stock length Example: `2400`
- `piece_length` (query, required, string) — Cut piece length Example: `300`
- `quantity` (query, required, string) — Pieces needed Example: `20`
- `kerf` (query, optional, string) — Saw kerf per cut Example: `3`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/kerf-api/v1/yield?stock_length=2400&piece_length=300&quantity=20&kerf=3"
```

**Response:**
```json
{
    "data": {
        "note": "Efficiency = total piece length / total stock length. Waste includes both kerf loss and end offcuts.",
        "inputs": {
            "kerf": 3,
            "quantity": 20,
            "piece_length": 300,
            "stock_length": 2400
        },
        "stock_needed": 3,
        "efficiency_percent": 83.3333,
        "total_piece_length": 6000,
        "total_stock_length": 7200,
        "total_waste_length": 1200
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:19.425Z",
        "request_id": "fe2d9ba4-387a-4f6c-8116-9a94a6db526e"
    },
    "status": "ok",
    "message": "Material efficiency",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Spec

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/kerf-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "notes": "All lengths share one unit (mm, cm, in…). Kerf is the width of material the blade removes per cut (default 0); a thin-kerf blade is ≈2–3 mm. This is single-length (1D) cutting, not 2D sheet nesting.",
        "service": "kerf-api",
        "endpoints": {
            "GET /v1/cuts": "Pieces and offcut from one stock length.",
            "GET /v1/meta": "This document.",
            "GET /v1/yield": "Total material efficiency of a cutting job.",
            "GET /v1/boards": "Stock pieces needed for a quantity of cuts."
        },
        "description": "Cut-list maths for woodworking and material cutting: pieces per stock with the saw kerf, offcut, stock needed, and material efficiency."
    },
    "meta": {
        "timestamp": "2026-06-05T19:50:19.515Z",
        "request_id": "a1d58db5-dae1-47dc-8deb-fc885dde96f4"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/kerf-api
OpenAPI spec: https://www.oanor.com/api/kerf-api/openapi.json
