API Reference
Input Format
Settings schema, data format, and all configuration options.
The request body is a JSON object with three fields: settings, data, and memory. All are stringified JSON strings.
Settings
| Field | Type | Default | Description |
|---|---|---|---|
fixedSpeed | boolean | required | true for treadmill/fixed-pace tests, false for variable-speed activities |
speed | float | — | Speed in m/s (required if fixedSpeed: true) |
fit | boolean | false | Whether to fit E, Vmax, P from the data |
returnPrediction | boolean | false | Include predicted HR array in result |
returnStats | boolean | false | Include derived metrics (energy, recovery, zones, etc.) |
returnErrors | boolean | false | Include memory error surface |
Parameter constraints (when fit: true)
| Field | Type | Default | Description |
|---|---|---|---|
Econstraints | [min, max, step] | [0.01, 0.99, 0.01] | Endurance search range |
V5constraints | [min, max, step] | [3.0, 12.0, 0.07] | Internal speed parameter range (m/s). Affects Vmax output. |
Pconstraints | [min, max, step] | [140, 220, 1.0] | HRmax search range (bpm) |
Fixed parameters (when fit: false)
| Field | Type | Default | Description |
|---|---|---|---|
E | float | 0.5 | Endurance (0–1) |
Vmax | float | 6.2 | Maximum speed (m/s) |
P | float | 180 | HRmax (bpm) |
Demographics (for derived stats)
Required when returnStats: true.
| Field | Type | Default | Description |
|---|---|---|---|
weight | float | 75 | Body mass (kg) |
height | float | 175 | Height (cm) |
age | int | 30 | Age (years) |
gender | string | "male" | "male" or "female" |
Sport mode
| Field | Type | Default | Description |
|---|---|---|---|
sport | string | "running" | "running", "cycling", or "team_sports" |
squadMeanE | float | — | Squad average E (for team archetype classification) |
squadMeanVmax | float | — | Squad average Vmax in m/s |
measuredRHR | float | — | Measured resting HR in bpm (for RZI calculation) |
Data
An array of timestamped objects. Required fields: time and hr.
| Field | Type | Required | Description |
|---|---|---|---|
time | float | Yes | Seconds from start |
hr | float | Yes | Heart rate (bpm) |
speed | float | Required for variable-speed | Speed (m/s). Required if fixedSpeed: false. |
Example
[
{"time": 0, "hr": 80, "speed": 2.5},
{"time": 1, "hr": 82, "speed": 2.5},
{"time": 6, "hr": 91, "speed": 2.6}
]
Data requirements
- Minimum: ~60 samples for basic fitting, 300+ for reliable results
- Sample rate: 1 Hz down to once every 6 seconds. Timestamps don't need to be consecutive.
- Session length: no hard limit — marathons, multi-hour rides, full matches are all supported
- Speed: in m/s. For cycling, power/100 can be used as a speed proxy.
Memory
The memory field contains the Bayesian prior from previous sessions. Always pass memory between sessions for the same individual — parameter estimates improve significantly with each session, and without prior data the SDK returns single-session fits which may not have fully converged.
For the first session with a new user, omit the memory field. The SDK will initialize a new memory and return it in the response. Store it and pass it back for every subsequent session.
{
"settings": "...",
"data": "...",
"memory": "{\"secsSinceEpoch\":1712000000,\"confidence\":3.5,\"minKey\":\"18504265\",\"keys\":[...],\"errorsX1000\":[...]}"
}
For the first session (no prior data), omit the memory field. The SDK will initialize a new memory and return it in the response.
See Bayesian Memory for details on the memory format, key encoding, and confidence decay.