{
  "openapi": "3.1.0",
  "info": {
    "title": "IronLedger strength calculators API",
    "version": "1.1.0",
    "description": "Free, read-only strength-training calculators. No account or key. The same functions power the calculators on ironledger.app and the MCP server at /mcp.",
    "contact": {
      "email": "support@ironledger.app",
      "url": "https://www.ironledger.app/tools"
    }
  },
  "servers": [
    {
      "url": "https://www.ironledger.app"
    }
  ],
  "externalDocs": {
    "url": "https://www.ironledger.app/tools",
    "description": "The calculators and how each one works"
  },
  "paths": {
    "/api/tools/one-rep-max": {
      "get": {
        "operationId": "one_rep_max",
        "summary": "One-rep max calculator",
        "description": "Estimate a one-rep max (1RM) from a set of weight × reps, with a percentage table and the load each rep count should allow. Epley by default, Brzycki optional. Estimates above 10 reps are flagged as less reliable.\n\nMethod: Epley (1985): weight × (1 + reps ÷ 30), a single counts as the weight itself. Brzycki (1993): weight × 36 ÷ (37 − reps). Tables round to the nearest 0.5.",
        "parameters": [
          {
            "name": "weight",
            "in": "query",
            "required": true,
            "description": "Weight lifted for the set.",
            "schema": {
              "type": "number",
              "description": "Weight lifted for the set.",
              "minimum": 0.5,
              "maximum": 2000
            }
          },
          {
            "name": "reps",
            "in": "query",
            "required": true,
            "description": "Reps completed, 1 to 30.",
            "schema": {
              "type": "integer",
              "description": "Reps completed, 1 to 30.",
              "minimum": 1,
              "maximum": 30
            }
          },
          {
            "name": "unit",
            "in": "query",
            "required": false,
            "description": "Weight unit for every load in and out: kg or lb.",
            "schema": {
              "type": "string",
              "description": "Weight unit for every load in and out: kg or lb.",
              "enum": [
                "kg",
                "lb"
              ],
              "default": "kg"
            }
          },
          {
            "name": "formula",
            "in": "query",
            "required": false,
            "description": "One-rep max formula: epley (weight × (1 + reps ÷ 30), the one the IronLedger app uses) or brzycki (weight × 36 ÷ (37 − reps)).",
            "schema": {
              "type": "string",
              "description": "One-rep max formula: epley (weight × (1 + reps ÷ 30), the one the IronLedger app uses) or brzycki (weight × 36 ÷ (37 − reps)).",
              "enum": [
                "epley",
                "brzycki"
              ],
              "default": "epley"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "one_rep_max_post",
        "summary": "One-rep max calculator (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "weight": {
                    "type": "number",
                    "description": "Weight lifted for the set.",
                    "minimum": 0.5,
                    "maximum": 2000
                  },
                  "reps": {
                    "type": "integer",
                    "description": "Reps completed, 1 to 30.",
                    "minimum": 1,
                    "maximum": 30
                  },
                  "unit": {
                    "type": "string",
                    "description": "Weight unit for every load in and out: kg or lb.",
                    "enum": [
                      "kg",
                      "lb"
                    ],
                    "default": "kg"
                  },
                  "formula": {
                    "type": "string",
                    "description": "One-rep max formula: epley (weight × (1 + reps ÷ 30), the one the IronLedger app uses) or brzycki (weight × 36 ÷ (37 − reps)).",
                    "enum": [
                      "epley",
                      "brzycki"
                    ],
                    "default": "epley"
                  }
                },
                "required": [
                  "weight",
                  "reps"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/rpe-estimate-max": {
      "get": {
        "operationId": "rpe_estimate_max",
        "summary": "Estimate one-rep max from a set and its RPE",
        "description": "Estimate a one-rep max from weight, reps and RPE, treating RPE as reps in reserve (RPE 8 = 2 reps left) and applying the one-rep max formula to reps + reps in reserve.\n\nMethod: Reps in reserve = 10 − RPE (Zourdos et al. 2016). The set is treated as reps + reps in reserve to failure, then Epley or Brzycki is applied.",
        "parameters": [
          {
            "name": "weight",
            "in": "query",
            "required": true,
            "description": "Weight lifted for the set.",
            "schema": {
              "type": "number",
              "description": "Weight lifted for the set.",
              "minimum": 0.5,
              "maximum": 2000
            }
          },
          {
            "name": "reps",
            "in": "query",
            "required": true,
            "description": "Reps completed, 1 to 20.",
            "schema": {
              "type": "integer",
              "description": "Reps completed, 1 to 20.",
              "minimum": 1,
              "maximum": 20
            }
          },
          {
            "name": "rpe",
            "in": "query",
            "required": true,
            "description": "Rating of perceived exertion, 5 to 10, read as reps in reserve (RPE 8 = 2 reps left). Half points allowed.",
            "schema": {
              "type": "number",
              "description": "Rating of perceived exertion, 5 to 10, read as reps in reserve (RPE 8 = 2 reps left). Half points allowed.",
              "minimum": 5,
              "maximum": 10
            }
          },
          {
            "name": "unit",
            "in": "query",
            "required": false,
            "description": "Weight unit for every load in and out: kg or lb.",
            "schema": {
              "type": "string",
              "description": "Weight unit for every load in and out: kg or lb.",
              "enum": [
                "kg",
                "lb"
              ],
              "default": "kg"
            }
          },
          {
            "name": "formula",
            "in": "query",
            "required": false,
            "description": "One-rep max formula: epley (weight × (1 + reps ÷ 30), the one the IronLedger app uses) or brzycki (weight × 36 ÷ (37 − reps)).",
            "schema": {
              "type": "string",
              "description": "One-rep max formula: epley (weight × (1 + reps ÷ 30), the one the IronLedger app uses) or brzycki (weight × 36 ÷ (37 − reps)).",
              "enum": [
                "epley",
                "brzycki"
              ],
              "default": "epley"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "rpe_estimate_max_post",
        "summary": "Estimate one-rep max from a set and its RPE (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "weight": {
                    "type": "number",
                    "description": "Weight lifted for the set.",
                    "minimum": 0.5,
                    "maximum": 2000
                  },
                  "reps": {
                    "type": "integer",
                    "description": "Reps completed, 1 to 20.",
                    "minimum": 1,
                    "maximum": 20
                  },
                  "rpe": {
                    "type": "number",
                    "description": "Rating of perceived exertion, 5 to 10, read as reps in reserve (RPE 8 = 2 reps left). Half points allowed.",
                    "minimum": 5,
                    "maximum": 10
                  },
                  "unit": {
                    "type": "string",
                    "description": "Weight unit for every load in and out: kg or lb.",
                    "enum": [
                      "kg",
                      "lb"
                    ],
                    "default": "kg"
                  },
                  "formula": {
                    "type": "string",
                    "description": "One-rep max formula: epley (weight × (1 + reps ÷ 30), the one the IronLedger app uses) or brzycki (weight × 36 ÷ (37 − reps)).",
                    "enum": [
                      "epley",
                      "brzycki"
                    ],
                    "default": "epley"
                  }
                },
                "required": [
                  "weight",
                  "reps",
                  "rpe"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/rpe-target-load": {
      "get": {
        "operationId": "rpe_target_load",
        "summary": "Load for a target reps and RPE",
        "description": "Find the load for a set of a given number of reps at a target RPE, from a known or estimated one-rep max. Rounded to the nearest 0.5.\n\nMethod: Percent of max = the formula read backwards at reps + (10 − RPE): 1 ÷ (1 + n ÷ 30) for Epley, (37 − n) ÷ 36 for Brzycki, 100% for a single at RPE 10.",
        "parameters": [
          {
            "name": "oneRepMax",
            "in": "query",
            "required": true,
            "description": "Your one-rep max (tested or estimated).",
            "schema": {
              "type": "number",
              "description": "Your one-rep max (tested or estimated).",
              "minimum": 1,
              "maximum": 2000
            }
          },
          {
            "name": "reps",
            "in": "query",
            "required": true,
            "description": "Target reps, 1 to 20.",
            "schema": {
              "type": "integer",
              "description": "Target reps, 1 to 20.",
              "minimum": 1,
              "maximum": 20
            }
          },
          {
            "name": "rpe",
            "in": "query",
            "required": true,
            "description": "Rating of perceived exertion, 5 to 10, read as reps in reserve (RPE 8 = 2 reps left). Half points allowed.",
            "schema": {
              "type": "number",
              "description": "Rating of perceived exertion, 5 to 10, read as reps in reserve (RPE 8 = 2 reps left). Half points allowed.",
              "minimum": 5,
              "maximum": 10
            }
          },
          {
            "name": "unit",
            "in": "query",
            "required": false,
            "description": "Weight unit for every load in and out: kg or lb.",
            "schema": {
              "type": "string",
              "description": "Weight unit for every load in and out: kg or lb.",
              "enum": [
                "kg",
                "lb"
              ],
              "default": "kg"
            }
          },
          {
            "name": "formula",
            "in": "query",
            "required": false,
            "description": "One-rep max formula: epley (weight × (1 + reps ÷ 30), the one the IronLedger app uses) or brzycki (weight × 36 ÷ (37 − reps)).",
            "schema": {
              "type": "string",
              "description": "One-rep max formula: epley (weight × (1 + reps ÷ 30), the one the IronLedger app uses) or brzycki (weight × 36 ÷ (37 − reps)).",
              "enum": [
                "epley",
                "brzycki"
              ],
              "default": "epley"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "rpe_target_load_post",
        "summary": "Load for a target reps and RPE (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "oneRepMax": {
                    "type": "number",
                    "description": "Your one-rep max (tested or estimated).",
                    "minimum": 1,
                    "maximum": 2000
                  },
                  "reps": {
                    "type": "integer",
                    "description": "Target reps, 1 to 20.",
                    "minimum": 1,
                    "maximum": 20
                  },
                  "rpe": {
                    "type": "number",
                    "description": "Rating of perceived exertion, 5 to 10, read as reps in reserve (RPE 8 = 2 reps left). Half points allowed.",
                    "minimum": 5,
                    "maximum": 10
                  },
                  "unit": {
                    "type": "string",
                    "description": "Weight unit for every load in and out: kg or lb.",
                    "enum": [
                      "kg",
                      "lb"
                    ],
                    "default": "kg"
                  },
                  "formula": {
                    "type": "string",
                    "description": "One-rep max formula: epley (weight × (1 + reps ÷ 30), the one the IronLedger app uses) or brzycki (weight × 36 ÷ (37 − reps)).",
                    "enum": [
                      "epley",
                      "brzycki"
                    ],
                    "default": "epley"
                  }
                },
                "required": [
                  "oneRepMax",
                  "reps",
                  "rpe"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/plates": {
      "get": {
        "operationId": "plate_loading",
        "summary": "Barbell plate calculator",
        "description": "Work out which plates to put on each side of a barbell to reach a target weight, using standard gym plates or the plates you list. Reports the exact load and anything your plates can’t make.\n\nMethod: Bar and collars come off first; the rest is halved and filled per side with the heaviest plate that fits, then the next (the IronLedger app’s plate calculator).",
        "parameters": [
          {
            "name": "target",
            "in": "query",
            "required": true,
            "description": "Total weight wanted on the bar, including the bar.",
            "schema": {
              "type": "number",
              "description": "Total weight wanted on the bar, including the bar.",
              "minimum": 0,
              "maximum": 2000
            }
          },
          {
            "name": "unit",
            "in": "query",
            "required": false,
            "description": "Weight unit for every load in and out: kg or lb.",
            "schema": {
              "type": "string",
              "description": "Weight unit for every load in and out: kg or lb.",
              "enum": [
                "kg",
                "lb"
              ],
              "default": "kg"
            }
          },
          {
            "name": "bar",
            "in": "query",
            "required": false,
            "description": "Bar weight in the chosen unit. Defaults to 20 kg or 45 lb.",
            "schema": {
              "type": "number",
              "description": "Bar weight in the chosen unit. Defaults to 20 kg or 45 lb.",
              "minimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "collars",
            "in": "query",
            "required": false,
            "description": "Count a collar on each side.",
            "schema": {
              "type": "boolean",
              "description": "Count a collar on each side.",
              "default": false
            }
          },
          {
            "name": "collarWeight",
            "in": "query",
            "required": false,
            "description": "Weight of each collar. Defaults to 2.5 kg or 5 lb.",
            "schema": {
              "type": "number",
              "description": "Weight of each collar. Defaults to 2.5 kg or 5 lb.",
              "minimum": 0,
              "maximum": 20
            }
          },
          {
            "name": "plates",
            "in": "query",
            "required": false,
            "description": "Plates available, heaviest first or in any order: \"25,20,15,10,5,2.5,1.25\" for as many as needed, or \"25:4,20:2\" for pairs owned. Defaults to standard gym plates (kg: 25 to 1.25; lb: 45 to 2.5).",
            "schema": {
              "type": "string",
              "description": "Plates available, heaviest first or in any order: \"25,20,15,10,5,2.5,1.25\" for as many as needed, or \"25:4,20:2\" for pairs owned. Defaults to standard gym plates (kg: 25 to 1.25; lb: 45 to 2.5)."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "plate_loading_post",
        "summary": "Barbell plate calculator (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target": {
                    "type": "number",
                    "description": "Total weight wanted on the bar, including the bar.",
                    "minimum": 0,
                    "maximum": 2000
                  },
                  "unit": {
                    "type": "string",
                    "description": "Weight unit for every load in and out: kg or lb.",
                    "enum": [
                      "kg",
                      "lb"
                    ],
                    "default": "kg"
                  },
                  "bar": {
                    "type": "number",
                    "description": "Bar weight in the chosen unit. Defaults to 20 kg or 45 lb.",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "collars": {
                    "type": "boolean",
                    "description": "Count a collar on each side.",
                    "default": false
                  },
                  "collarWeight": {
                    "type": "number",
                    "description": "Weight of each collar. Defaults to 2.5 kg or 5 lb.",
                    "minimum": 0,
                    "maximum": 20
                  },
                  "plates": {
                    "type": "string",
                    "description": "Plates available, heaviest first or in any order: \"25,20,15,10,5,2.5,1.25\" for as many as needed, or \"25:4,20:2\" for pairs owned. Defaults to standard gym plates (kg: 25 to 1.25; lb: 45 to 2.5)."
                  }
                },
                "required": [
                  "target"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/warm-up": {
      "get": {
        "operationId": "warmup_sets",
        "summary": "Warm-up set calculator",
        "description": "Build a warm-up ramp to a working weight: plate-friendly jumps, reps falling from 10 to singles, with the plates for each set. The same ramp the IronLedger app suggests.\n\nMethod: Warm-ups land on bar + 10, + 20, + 30 and so on, spread from about half the working weight (or bar + 50 for heavy lifts) to about 85% of it; reps 10, 5, then singles.",
        "parameters": [
          {
            "name": "workingWeight",
            "in": "query",
            "required": true,
            "description": "The first working set’s weight.",
            "schema": {
              "type": "number",
              "description": "The first working set’s weight.",
              "minimum": 1,
              "maximum": 2000
            }
          },
          {
            "name": "sets",
            "in": "query",
            "required": false,
            "description": "Number of warm-up sets, 1 to 12.",
            "schema": {
              "type": "integer",
              "description": "Number of warm-up sets, 1 to 12.",
              "minimum": 1,
              "maximum": 12,
              "default": 4
            }
          },
          {
            "name": "unit",
            "in": "query",
            "required": false,
            "description": "Weight unit for every load in and out: kg or lb.",
            "schema": {
              "type": "string",
              "description": "Weight unit for every load in and out: kg or lb.",
              "enum": [
                "kg",
                "lb"
              ],
              "default": "kg"
            }
          },
          {
            "name": "bar",
            "in": "query",
            "required": false,
            "description": "Bar weight in the chosen unit. Defaults to 20 kg or 45 lb.",
            "schema": {
              "type": "number",
              "description": "Bar weight in the chosen unit. Defaults to 20 kg or 45 lb.",
              "minimum": 0,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "warmup_sets_post",
        "summary": "Warm-up set calculator (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workingWeight": {
                    "type": "number",
                    "description": "The first working set’s weight.",
                    "minimum": 1,
                    "maximum": 2000
                  },
                  "sets": {
                    "type": "integer",
                    "description": "Number of warm-up sets, 1 to 12.",
                    "minimum": 1,
                    "maximum": 12,
                    "default": 4
                  },
                  "unit": {
                    "type": "string",
                    "description": "Weight unit for every load in and out: kg or lb.",
                    "enum": [
                      "kg",
                      "lb"
                    ],
                    "default": "kg"
                  },
                  "bar": {
                    "type": "number",
                    "description": "Bar weight in the chosen unit. Defaults to 20 kg or 45 lb.",
                    "minimum": 0,
                    "maximum": 100
                  }
                },
                "required": [
                  "workingWeight"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/powerlifting-score": {
      "get": {
        "operationId": "powerlifting_score",
        "summary": "DOTS, IPF GL and Wilks calculator",
        "description": "Score a powerlifting total (or a bench press) against bodyweight with DOTS, IPF GL points and the original Wilks, using the coefficients the OpenPowerlifting rankings use.\n\nMethod: DOTS = total × 500 ÷ (a fourth-order polynomial in bodyweight); IPF GL = total × 100 ÷ (A − B·e^(−C·bodyweight)); Wilks = total × 500 ÷ (a fifth-order polynomial). Coefficients and bodyweight bounds as in OpenPowerlifting’s implementation.",
        "parameters": [
          {
            "name": "total",
            "in": "query",
            "required": true,
            "description": "Total lifted (squat + bench + deadlift), or the bench press for event \"bench\".",
            "schema": {
              "type": "number",
              "description": "Total lifted (squat + bench + deadlift), or the bench press for event \"bench\".",
              "minimum": 1,
              "maximum": 2000
            }
          },
          {
            "name": "bodyweight",
            "in": "query",
            "required": true,
            "description": "Bodyweight in the chosen unit.",
            "schema": {
              "type": "number",
              "description": "Bodyweight in the chosen unit.",
              "minimum": 20,
              "maximum": 400
            }
          },
          {
            "name": "unit",
            "in": "query",
            "required": false,
            "description": "Weight unit for every load in and out: kg or lb.",
            "schema": {
              "type": "string",
              "description": "Weight unit for every load in and out: kg or lb.",
              "enum": [
                "kg",
                "lb"
              ],
              "default": "kg"
            }
          },
          {
            "name": "sex",
            "in": "query",
            "required": true,
            "description": "The formulas have separate male and female coefficients.",
            "schema": {
              "type": "string",
              "description": "The formulas have separate male and female coefficients.",
              "enum": [
                "male",
                "female"
              ]
            }
          },
          {
            "name": "equipment",
            "in": "query",
            "required": false,
            "description": "For IPF GL: raw (classic) or equipped.",
            "schema": {
              "type": "string",
              "description": "For IPF GL: raw (classic) or equipped.",
              "enum": [
                "raw",
                "equipped"
              ],
              "default": "raw"
            }
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "description": "For IPF GL: sbd (full powerlifting total) or bench (bench press only).",
            "schema": {
              "type": "string",
              "description": "For IPF GL: sbd (full powerlifting total) or bench (bench press only).",
              "enum": [
                "sbd",
                "bench"
              ],
              "default": "sbd"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "powerlifting_score_post",
        "summary": "DOTS, IPF GL and Wilks calculator (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "total": {
                    "type": "number",
                    "description": "Total lifted (squat + bench + deadlift), or the bench press for event \"bench\".",
                    "minimum": 1,
                    "maximum": 2000
                  },
                  "bodyweight": {
                    "type": "number",
                    "description": "Bodyweight in the chosen unit.",
                    "minimum": 20,
                    "maximum": 400
                  },
                  "unit": {
                    "type": "string",
                    "description": "Weight unit for every load in and out: kg or lb.",
                    "enum": [
                      "kg",
                      "lb"
                    ],
                    "default": "kg"
                  },
                  "sex": {
                    "type": "string",
                    "description": "The formulas have separate male and female coefficients.",
                    "enum": [
                      "male",
                      "female"
                    ]
                  },
                  "equipment": {
                    "type": "string",
                    "description": "For IPF GL: raw (classic) or equipped.",
                    "enum": [
                      "raw",
                      "equipped"
                    ],
                    "default": "raw"
                  },
                  "event": {
                    "type": "string",
                    "description": "For IPF GL: sbd (full powerlifting total) or bench (bench press only).",
                    "enum": [
                      "sbd",
                      "bench"
                    ],
                    "default": "sbd"
                  }
                },
                "required": [
                  "total",
                  "bodyweight",
                  "sex"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/tools/program-file": {
      "get": {
        "operationId": "check_program_file",
        "summary": "IronLedger program file checker",
        "description": "Check a training program written as a CSV or TSV file exactly as the IronLedger app will import it, before anyone loads it on a phone. Returns the weeks, sessions and exercises it creates, every skipped row and warning with its row number, the exercise names the app will question (\"Did you mean ...?\"), and names that will become new custom exercises. Use it whenever you write a program for someone to import into IronLedger, and fix anything it reports first. The app names the program after the file, so pass the file name you will give it.\n\nMethod: The IronLedger app importer (parseProgramImport, app v1.10.1), ported line for line and matched against the app on 35,000 generated files. Exercise names are checked against the app’s 202-name library with its 0.8 token-similarity threshold.",
        "parameters": [
          {
            "name": "file",
            "in": "query",
            "required": true,
            "description": "The whole program file as text. Canonical header: Week,Day,Exercise,Sets,Reps,Load,RPE,RIR,Rest,Notes, then one row per exercise, such as 1,Day 1,Squat,5,5,100 kg,8,,3:00,belt. Wrap a cell that contains a comma in double quotes; never use a double quote inside a cell.",
            "schema": {
              "type": "string",
              "description": "The whole program file as text. Canonical header: Week,Day,Exercise,Sets,Reps,Load,RPE,RIR,Rest,Notes, then one row per exercise, such as 1,Day 1,Squat,5,5,100 kg,8,,3:00,belt. Wrap a cell that contains a comma in double quotes; never use a double quote inside a cell.",
              "maxLength": 200000
            }
          },
          {
            "name": "fileName",
            "in": "query",
            "required": false,
            "description": "The file name it will be saved as, such as \"Texas Method.csv\". The app names the program after it; without one the program is called Imported Spreadsheet.",
            "schema": {
              "type": "string",
              "description": "The file name it will be saved as, such as \"Texas Method.csv\". The app names the program after it; without one the program is called Imported Spreadsheet.",
              "maxLength": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "check_program_file_post",
        "summary": "IronLedger program file checker (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "The whole program file as text. Canonical header: Week,Day,Exercise,Sets,Reps,Load,RPE,RIR,Rest,Notes, then one row per exercise, such as 1,Day 1,Squat,5,5,100 kg,8,,3:00,belt. Wrap a cell that contains a comma in double quotes; never use a double quote inside a cell.",
                    "maxLength": 200000
                  },
                  "fileName": {
                    "type": "string",
                    "description": "The file name it will be saved as, such as \"Texas Method.csv\". The app names the program after it; without one the program is called Imported Spreadsheet.",
                    "maxLength": 120
                  }
                },
                "required": [
                  "file"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, a one-line summary, the method used and a link to the same result on the site.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tool": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object"
                    },
                    "method": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "tool",
                    "summary",
                    "result",
                    "url"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "An input is missing or out of range.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this address.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "field": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "message"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}