{
  "openapi": "3.1.1",
  "info": {
    "title": "One-Rep-Max & Plate Loader API",
    "version": "1.0.0",
    "summary": "1RM from any set (7 formulas + average), % and RPE tables, and which plates to load.",
    "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://onerepmaxcalculator.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "1RM from any set (7 formulas + average), % and RPE tables, and which plates to load.",
        "description": "Estimates your one-repetition maximum from the weight and reps of a set to failure (or with an RPE) with the Epley, Brzycki, Lander, Lombardi, Mayhew, O'Conner and Wathan equations and their average, prints a percentage table and an RPE table, and tells you which plates to put on each side of a kg or lb bar using only the plates you actually have.\n\nMethodology:\n- Seven published equations estimate the 1RM from the weight w and repetitions r to failure, as tabulated by LeSuer et al. (1997): Epley w(1 + 0.0333r); Brzycki 100w/(102.78 − 2.78r); Lander 100w/(101.3 − 2.67123r); Lombardi w·r^0.10; Mayhew 100w/(52.2 + 41.9e^(−0.055r)); O'Conner w(1 + 0.025r); Wathan 100w/(48.8 + 53.8e^(−0.075r)). The average of all seven is the headline estimate.\n- With 1 rep (and no RPE) the 1RM is the weight lifted.\n- RPE: reps in reserve = 10 − RPE are added to the reps (e.g. 5 reps at RPE 8 count as 7 reps to failure). The RPE table uses the same idea with the Epley relation %1RM = 1 ÷ (1 + 0.0333 × (reps + 10 − RPE)); it is derived, not a copy of a published RPE chart.\n- Percentage table: weight = % × average 1RM; the approximate reps at each percentage invert the Epley equation: reps = (1/% − 1) ÷ 0.0333.\n- Plate loader: per side = (target − bar − collars) ÷ 2. Plates are taken heaviest first (greedy) from the pairs you have; if that misses but an exact combination exists (possible with unusual plate sets), an exact subset-sum search finds the combination with the fewest plates. If the weight cannot be loaded exactly, the nearest loadable weights below and above are shown.",
        "tags": [
          "calculators"
        ],
        "x-mcp-tool": "one_rep_max_calculator",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OneRepMaxCalculatorInput"
              },
              "examples": {
                "example1": {
                  "summary": "100 kg × 5 reps, load 85%",
                  "value": {
                    "weight": 100,
                    "reps": 5,
                    "unit": "kg",
                    "targetPercent": 85
                  }
                },
                "example2": {
                  "summary": "225 lb × 8 at RPE 8, load 275 lb",
                  "value": {
                    "weight": 225,
                    "reps": 8,
                    "unit": "lb",
                    "rpe": 8,
                    "targetWeight": 275
                  }
                },
                "example3": {
                  "summary": "Home gym: 62.5 kg with a 15 kg bar and few plates",
                  "value": {
                    "weight": 50,
                    "reps": 10,
                    "unit": "kg",
                    "targetWeight": 62.5,
                    "barWeight": 15,
                    "plates": [
                      {
                        "weight": 10,
                        "count": 2
                      },
                      {
                        "weight": 5,
                        "count": 4
                      },
                      {
                        "weight": 2.5,
                        "count": 2
                      },
                      {
                        "weight": 1.25,
                        "count": 2
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OneRepMaxCalculatorResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "OneRepMaxCalculatorInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "weight": {
            "title": "Weight lifted",
            "type": "number",
            "minimum": 0.5,
            "maximum": 2000,
            "default": 100
          },
          "reps": {
            "title": "Repetitions",
            "description": "Reps completed in the set. Estimates are most reliable up to about 10 reps.",
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "default": 5
          },
          "unit": {
            "title": "Unit",
            "type": "string",
            "enum": [
              "kg",
              "lb"
            ],
            "default": "kg"
          },
          "rpe": {
            "title": "RPE of the set",
            "description": "Optional (6–10). 10 = to failure; 8 = two more reps were possible. Reps in reserve are added before estimating.",
            "type": "number",
            "minimum": 6,
            "maximum": 10
          },
          "targetWeight": {
            "title": "Weight to load",
            "description": "Optional total bar weight for the plate loader.",
            "type": "number",
            "minimum": 0,
            "maximum": 2000
          },
          "targetPercent": {
            "title": "Or: percentage of 1RM to load",
            "description": "Used when no weight to load is given; default 100% of the average estimate.",
            "type": "number",
            "minimum": 1,
            "maximum": 110,
            "x-unit": "%"
          },
          "barWeight": {
            "title": "Bar weight",
            "description": "Default 20 kg or 45 lb.",
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "collarWeight": {
            "title": "Collars (both together)",
            "type": "number",
            "minimum": 0,
            "maximum": 20,
            "default": 0
          },
          "plates": {
            "title": "Plates available",
            "description": "Plate weight and how many you have in total (both sides). Empty = a standard set (kg: 25–1.25, lb: 45–2.5).",
            "type": "array",
            "maxItems": 15,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "weight": {
                  "title": "Plate weight",
                  "type": "number",
                  "minimum": 0.05,
                  "maximum": 100
                },
                "count": {
                  "title": "Count",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 100
                }
              },
              "required": [
                "weight",
                "count"
              ]
            }
          }
        },
        "required": [
          "weight",
          "reps"
        ]
      },
      "OneRepMaxCalculatorResult": {
        "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",
            "additionalProperties": false,
            "required": [
              "unit",
              "weight",
              "reps",
              "effectiveReps",
              "estimates",
              "average",
              "percentTable",
              "rpeTable",
              "loader"
            ],
            "properties": {
              "unit": {
                "type": "string",
                "enum": [
                  "kg",
                  "lb"
                ]
              },
              "weight": {
                "type": "number"
              },
              "reps": {
                "type": "integer"
              },
              "effectiveReps": {
                "type": "number",
                "description": "Reps + reps in reserve (10 − RPE)."
              },
              "estimates": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "formula",
                    "oneRepMax"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "formula": {
                      "type": "string"
                    },
                    "oneRepMax": {
                      "type": "number"
                    }
                  }
                }
              },
              "average": {
                "type": "number"
              },
              "percentTable": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "percent",
                    "weight",
                    "approxReps"
                  ],
                  "properties": {
                    "percent": {
                      "type": "number"
                    },
                    "weight": {
                      "type": "number"
                    },
                    "approxReps": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  }
                }
              },
              "rpeTable": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "reps",
                    "rpe",
                    "percent",
                    "weight"
                  ],
                  "properties": {
                    "reps": {
                      "type": "integer"
                    },
                    "rpe": {
                      "type": "number"
                    },
                    "percent": {
                      "type": "number"
                    },
                    "weight": {
                      "type": "number"
                    }
                  }
                }
              },
              "loader": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "target",
                  "bar",
                  "collars",
                  "exact",
                  "perSide",
                  "loaded",
                  "method",
                  "nearestBelow",
                  "nearestAbove"
                ],
                "properties": {
                  "target": {
                    "type": "number"
                  },
                  "bar": {
                    "type": "number"
                  },
                  "collars": {
                    "type": "number"
                  },
                  "exact": {
                    "type": "boolean"
                  },
                  "perSide": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    }
                  },
                  "loaded": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "method": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "nearestBelow": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "total": {
                        "type": "number"
                      },
                      "perSide": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      }
                    }
                  },
                  "nearestAbove": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": false,
                    "properties": {
                      "total": {
                        "type": "number"
                      },
                      "perSide": {
                        "type": "array",
                        "items": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}