{
  "openapi": "3.1.1",
  "info": {
    "title": "Kerfwise CNC Feeds & Speeds Calculator API",
    "version": "1.0.0",
    "summary": "CNC router rpm, feed, chip load with chip thinning, removal rate and spindle power.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://kerfwisefeedsspeeds.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "CNC router rpm, feed, chip load with chip thinning, removal rate and spindle power.",
        "description": "Calculates a starting spindle speed and feed rate for a CNC router or mill: rpm from cutting speed and diameter (or your spindle speed), feed = rpm × flutes × chip load, chip loads from a published router-bit chart for wood, plywood, MDF, plastics, acrylic and aluminium, the depth-of-cut reduction, radial chip thinning for light side cuts, material removal rate and a power estimate from the specific cutting energy. Metric or imperial.\n\nMethodology:\n- Spindle speed n = Vc × 1000 / (π × D) with Vc in m/min and D in mm (imperial: n = SFM × 12 / (π × D) with D in inch), limited to the spindle minimum and maximum. Without a cutting speed your spindle speed is used and the resulting cutting speed is shown.\n- Chip load per tooth: the published router-bit chart gives a low–high range at 1/8, 1/4, 3/8 and 1/2 inch (and larger); between the columns the range is interpolated linearly, below 1/8 inch it is scaled with the diameter. You choose the low end, the middle or the high end, or enter your own chip load.\n- Depth of cut: up to 1 × D the chart value is used, at 2 × D it is reduced by 25 % and at 3 × D by 50 % (linear in between).\n- Radial chip thinning: with a side cut narrower than half the diameter the real chip is thinner than the feed per tooth, so the programmed chip load is raised by 1 / √(1 − (1 − 2 ae/D)²) to keep the target chip thickness.\n- Feed vf = n × flutes × programmed chip load. Material removal rate Q = ae × ap × vf. Cutting power P = Q × specific cutting energy; spindle power = P / efficiency.\n\nChart values are starting points for rigid machines and sharp solid-carbide bits. Start at the low end, listen and look at the chips, then adjust. Check the tool maker’s data and your machine’s limits.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "kerfwise_feeds_speeds",
        "x-owner-app": "kerfwise",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KerfwiseFeedsSpeedsInput"
              },
              "examples": {
                "example1": {
                  "summary": "6 mm 2-flute compression bit in MDF, full slot 6 mm deep, 18 000 rpm",
                  "value": {
                    "units": "metric",
                    "material": "mdf",
                    "diameter": 6,
                    "flutes": 2,
                    "rpm": 18000,
                    "axialDepth": 6
                  }
                },
                "example2": {
                  "summary": "1/4\" single-flute in aluminium, 600 SFM, 20 % side cut (chip thinning), imperial",
                  "value": {
                    "units": "imperial",
                    "material": "aluminium",
                    "diameter": 0.25,
                    "flutes": 1,
                    "cuttingSpeed": 600,
                    "radialEngagement": 0.05,
                    "axialDepth": 0.25
                  }
                },
                "example3": {
                  "summary": "Acrylic with 3 mm O-flute, cutting speed 250 m/min, spindle max 24 000 rpm",
                  "value": {
                    "units": "metric",
                    "material": "acrylic",
                    "diameter": 3,
                    "flutes": 1,
                    "cuttingSpeed": 250,
                    "spindleMaxRpm": 24000,
                    "axialDepth": 3,
                    "chipLoadPosition": "low"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KerfwiseFeedsSpeedsResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "KerfwiseFeedsSpeedsInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "units": {
            "title": "Units",
            "type": "string",
            "enum": [
              "metric",
              "imperial"
            ],
            "default": "metric"
          },
          "material": {
            "title": "Material",
            "type": "string",
            "enum": [
              "hardwood",
              "softwood",
              "plywood",
              "mdf",
              "acrylic",
              "hard-plastic",
              "aluminium",
              "custom"
            ],
            "default": "mdf"
          },
          "diameter": {
            "title": "Cutter diameter",
            "description": "mm (metric) or inch (imperial).",
            "type": "number",
            "minimum": 0.008,
            "maximum": 100,
            "default": 6
          },
          "flutes": {
            "title": "Flutes (cutting edges)",
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "default": 2
          },
          "rpm": {
            "title": "Spindle speed",
            "description": "Used when no cutting speed is entered.",
            "type": "integer",
            "minimum": 100,
            "maximum": 100000,
            "default": 18000,
            "x-unit": "rpm"
          },
          "cuttingSpeed": {
            "title": "Cutting speed (optional)",
            "description": "m/min (metric) or SFM (imperial). When set, the spindle speed is calculated from it.",
            "type": "number",
            "minimum": 1,
            "maximum": 10000
          },
          "spindleMinRpm": {
            "title": "Spindle minimum (optional)",
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "x-unit": "rpm"
          },
          "spindleMaxRpm": {
            "title": "Spindle maximum (optional)",
            "type": "integer",
            "minimum": 0,
            "maximum": 100000,
            "x-unit": "rpm"
          },
          "chipLoad": {
            "title": "Chip load per tooth (optional)",
            "description": "mm or inch. Required for a custom material; overrides the chart otherwise.",
            "type": "number",
            "minimum": 0.00001,
            "maximum": 5
          },
          "chipLoadPosition": {
            "title": "Start in the chart range at",
            "type": "string",
            "enum": [
              "low",
              "mid",
              "high"
            ],
            "default": "mid"
          },
          "radialEngagement": {
            "title": "Radial engagement ae (optional)",
            "description": "Width of cut, mm or inch. Empty = full slot (ae = diameter). Below half the diameter the feed is raised for chip thinning.",
            "type": "number",
            "minimum": 0.0001,
            "maximum": 100
          },
          "axialDepth": {
            "title": "Depth of cut ap (optional)",
            "description": "mm or inch. Empty = one diameter.",
            "type": "number",
            "minimum": 0.0001,
            "maximum": 400
          },
          "specificEnergy": {
            "title": "Specific cutting energy (optional)",
            "description": "W·s/mm³ (1 hp·min/in³ = 2.73 J/mm³). Empty = the material’s planning value, where one is built in.",
            "type": "number",
            "minimum": 0.001,
            "maximum": 20,
            "x-unit": "J/mm³"
          },
          "efficiency": {
            "title": "Spindle efficiency",
            "type": "number",
            "minimum": 0.3,
            "maximum": 1,
            "default": 0.8
          }
        },
        "required": []
      },
      "KerfwiseFeedsSpeedsResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "required": [
              "units",
              "material",
              "rpm",
              "cuttingSpeed",
              "chipLoad",
              "feed",
              "mrr",
              "warnings"
            ],
            "properties": {
              "units": {
                "type": "string",
                "enum": [
                  "metric",
                  "imperial"
                ]
              },
              "material": {
                "type": "string"
              },
              "materialName": {
                "type": "string"
              },
              "diameter": {
                "type": "number"
              },
              "flutes": {
                "type": "integer"
              },
              "rpm": {
                "type": "integer"
              },
              "rpmSource": {
                "type": "string",
                "enum": [
                  "cutting-speed",
                  "rpm"
                ]
              },
              "rpmClamped": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "cuttingSpeed": {
                "type": "number",
                "description": "m/min (metric) or SFM (imperial) at the used spindle speed."
              },
              "chipLoad": {
                "type": "object",
                "properties": {
                  "chartLow": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "chartHigh": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "base": {
                    "type": "number"
                  },
                  "source": {
                    "type": "string"
                  },
                  "depthFactor": {
                    "type": "number"
                  },
                  "target": {
                    "type": "number"
                  },
                  "thinningFactor": {
                    "type": "number"
                  },
                  "programmed": {
                    "type": "number"
                  }
                }
              },
              "feed": {
                "type": "number",
                "description": "mm/min (metric) or in/min (imperial)."
              },
              "radialEngagement": {
                "type": "number"
              },
              "axialDepth": {
                "type": "number"
              },
              "mrr": {
                "type": "number",
                "description": "cm³/min (metric) or in³/min (imperial)."
              },
              "power": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "specificEnergy": {
                    "type": "number"
                  },
                  "efficiency": {
                    "type": "number"
                  },
                  "cuttingKw": {
                    "type": "number"
                  },
                  "spindleKw": {
                    "type": "number"
                  },
                  "spindleHp": {
                    "type": "number"
                  },
                  "source": {
                    "type": "string"
                  }
                }
              },
              "warnings": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}