{
  "openapi": "3.1.1",
  "info": {
    "title": "Cycling Data Lab API",
    "description": "Run Cycling Data Lab calculators with your own inputs. See https://cyclingdatalab.com/docs for examples and usage limits.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/api/v1/cadence-speed": {
      "post": {
        "tags": [
          "Cadence-Speed"
        ],
        "summary": "Cadence-Speed",
        "description": "Calculate speeds for combinations of chainring teeth, sprocket teeth and pedaling cadences. Supply one value in each array for a single setup. Tire thickness is measured radially from the rim to the outside of the tire.",
        "operationId": "calculateCadenceSpeed",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CadenceSpeedRequest"
              },
              "example": {
                "chainringTeeth": [
                  50
                ],
                "sprocketTeeth": [
                  17
                ],
                "cadencesRpm": [
                  90
                ],
                "rimDiameterMillimeters": 622,
                "tireThicknessMillimeters": 28
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CadenceSpeedResponse"
                },
                "example": {
                  "cadencesRpm": [
                    90
                  ],
                  "gears": [
                    {
                      "chainringTeeth": 50,
                      "sprocketTeeth": 17,
                      "speedsKmh": [
                        33.8294
                      ]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/training-zones": {
      "post": {
        "tags": [
          "Training Zones"
        ],
        "summary": "Training Zones",
        "description": "Calculate power zones from functional threshold power (FTP), rider mass and the requested training method. A null upper bound means the zone is open-ended.",
        "operationId": "calculateTrainingZones",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingZonesRequest"
              },
              "example": {
                "ftpWatts": 250,
                "riderMassKg": 75,
                "method": "cogganSix"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingZonesResponse"
                },
                "example": {
                  "method": "cogganSix",
                  "zones": [
                    {
                      "name": "Z1",
                      "description": "Active Recovery",
                      "fromWatts": 0,
                      "toWatts": 137.5,
                      "fromWattsPerKg": 0,
                      "toWattsPerKg": 1.8333
                    },
                    {
                      "name": "Z2",
                      "description": "Endurance",
                      "fromWatts": 140,
                      "toWatts": 187.5,
                      "fromWattsPerKg": 1.8667,
                      "toWattsPerKg": 2.5
                    },
                    {
                      "name": "Z3",
                      "description": "Tempo",
                      "fromWatts": 190,
                      "toWatts": 225,
                      "fromWattsPerKg": 2.5333,
                      "toWattsPerKg": 3
                    },
                    {
                      "name": "Z4",
                      "description": "Lactate Threshold",
                      "fromWatts": 227.5,
                      "toWatts": 262.5,
                      "fromWattsPerKg": 3.0333,
                      "toWattsPerKg": 3.5
                    },
                    {
                      "name": "Z5",
                      "description": "VO2 Max",
                      "fromWatts": 265,
                      "toWatts": 300,
                      "fromWattsPerKg": 3.5333,
                      "toWattsPerKg": 4
                    },
                    {
                      "name": "Z6",
                      "description": "Anaerobic Capacity",
                      "fromWatts": 302.5,
                      "toWatts": null,
                      "fromWattsPerKg": 4.0333,
                      "toWattsPerKg": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/critical-power": {
      "post": {
        "tags": [
          "Critical Power"
        ],
        "summary": "Critical Power",
        "description": "Estimate Critical Power, W-prime, FTP and a power-duration curve from three maximal efforts of distinct durations.",
        "operationId": "calculateCriticalPower",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CriticalPowerRequest"
              },
              "example": {
                "riderMassKg": 75,
                "efforts": [
                  {
                    "durationSeconds": 60,
                    "powerWatts": 600
                  },
                  {
                    "durationSeconds": 300,
                    "powerWatts": 360
                  },
                  {
                    "durationSeconds": 1200,
                    "powerWatts": 315
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CriticalPowerResponse"
                },
                "example": {
                  "criticalPowerWatts": 300,
                  "wPrimeJoules": 18000,
                  "estimatedFtpWatts": 288,
                  "criticalPowerWattsPerKg": 4,
                  "estimatedFtpWattsPerKg": 3.84,
                  "powerDurationCurve": [
                    {
                      "durationMinutes": 1,
                      "powerWatts": 600
                    },
                    {
                      "durationMinutes": 2,
                      "powerWatts": 450
                    },
                    {
                      "durationMinutes": 3,
                      "powerWatts": 400
                    },
                    {
                      "durationMinutes": 5,
                      "powerWatts": 360
                    },
                    {
                      "durationMinutes": 8,
                      "powerWatts": 338
                    },
                    {
                      "durationMinutes": 12,
                      "powerWatts": 328
                    },
                    {
                      "durationMinutes": 20,
                      "powerWatts": 320
                    },
                    {
                      "durationMinutes": 30,
                      "powerWatts": 311
                    },
                    {
                      "durationMinutes": 45,
                      "powerWatts": 299
                    },
                    {
                      "durationMinutes": 60,
                      "powerWatts": 288
                    },
                    {
                      "durationMinutes": 90,
                      "powerWatts": 269
                    },
                    {
                      "durationMinutes": 120,
                      "powerWatts": 254
                    },
                    {
                      "durationMinutes": 180,
                      "powerWatts": 233
                    },
                    {
                      "durationMinutes": 240,
                      "powerWatts": 219
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/lactate-thresholds": {
      "post": {
        "tags": [
          "Lactate Thresholds"
        ],
        "summary": "Lactate Thresholds",
        "description": "Estimate lactate thresholds from progressive cycling test steps. Mader requires at least two distinct powers and modified Dmax requires at least three. Unavailable thresholds include an explanation.",
        "operationId": "calculateLactateThresholds",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LactateTestRequest"
              },
              "example": {
                "method": "mader",
                "steps": [
                  {
                    "durationSeconds": 180,
                    "distanceKm": 1,
                    "powerWatts": 150,
                    "lactateMmolPerLiter": 1
                  },
                  {
                    "durationSeconds": 180,
                    "distanceKm": 1,
                    "powerWatts": 200,
                    "lactateMmolPerLiter": 2
                  },
                  {
                    "durationSeconds": 180,
                    "distanceKm": 1,
                    "powerWatts": 300,
                    "lactateMmolPerLiter": 4
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LactateTestResponse"
                },
                "example": {
                  "method": "mader",
                  "peakPowerWatts": 300,
                  "peakLactateMmolPerLiter": 4,
                  "thresholds": [
                    {
                      "name": "LT1 - 2.0 mmol/L",
                      "targetLactateMmolPerLiter": 2,
                      "powerWatts": 200,
                      "isAvailable": true,
                      "note": "2,0 mmol/L interpolated"
                    },
                    {
                      "name": "Mader - 4.0 mmol/L",
                      "targetLactateMmolPerLiter": 4,
                      "powerWatts": 300,
                      "isAvailable": true,
                      "note": "4,0 mmol/L interpolated"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/power-time/time-from-power": {
      "post": {
        "tags": [
          "Power-Time"
        ],
        "summary": "Power-Time",
        "description": "Estimate segment time from steady rider power. Positive headwind opposes travel. The model uses a constant gradient and omits drafting, braking and corners.",
        "operationId": "estimateTimeFromPower",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimeFromPowerRequest"
              },
              "example": {
                "segment": {
                  "riderMassKg": 70,
                  "bikeMassKg": 9,
                  "dragAreaSquareMeters": 0.3,
                  "rollingResistanceCoefficient": 0.005,
                  "drivetrainEfficiency": 0.96,
                  "distanceKm": 5,
                  "startAltitudeMeters": 300,
                  "finishAltitudeMeters": 500,
                  "airTemperatureCelsius": 20,
                  "headwindKmh": 0
                },
                "powerWatts": 250
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PowerTimeResponse"
                },
                "example": {
                  "durationSeconds": 850.6208,
                  "powerWatts": 250,
                  "averageSpeedKmh": 21.161,
                  "verticalAscentMetersPerHour": 846.4406,
                  "wattsPerKg": 3.5714,
                  "gradientPercent": 4,
                  "powerBreakdown": {
                    "riderPowerWatts": 250,
                    "wheelPowerWatts": 240,
                    "drivetrainLossWatts": 10,
                    "aerodynamicWatts": 35.0111,
                    "rollingResistanceWatts": 22.7772,
                    "gravityWatts": 182.2175,
                    "totalResistiveWatts": 240.0058,
                    "gravityAssistWatts": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/power-time/power-for-time": {
      "post": {
        "tags": [
          "Power-Time"
        ],
        "summary": "Power-Time",
        "description": "Estimate the steady power required for a target duration over a segment with constant gradient and conditions.",
        "operationId": "estimatePowerForTime",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PowerForTimeRequest"
              },
              "example": {
                "segment": {
                  "riderMassKg": 70,
                  "bikeMassKg": 9,
                  "dragAreaSquareMeters": 0.3,
                  "rollingResistanceCoefficient": 0.005,
                  "drivetrainEfficiency": 0.96,
                  "distanceKm": 5,
                  "startAltitudeMeters": 300,
                  "finishAltitudeMeters": 500,
                  "airTemperatureCelsius": 20,
                  "headwindKmh": 0
                },
                "targetDurationSeconds": 720
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PowerTimeResponse"
                },
                "example": {
                  "durationSeconds": 720,
                  "powerWatts": 312,
                  "averageSpeedKmh": 25,
                  "verticalAscentMetersPerHour": 1000,
                  "wattsPerKg": 4.4571,
                  "gradientPercent": 4,
                  "powerBreakdown": {
                    "riderPowerWatts": 312,
                    "wheelPowerWatts": 299.52,
                    "drivetrainLossWatts": 12.48,
                    "aerodynamicWatts": 57.732,
                    "rollingResistanceWatts": 26.9094,
                    "gravityWatts": 215.275,
                    "totalResistiveWatts": 299.9164,
                    "gravityAssistWatts": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/power-time/best-effort": {
      "post": {
        "tags": [
          "Power-Time"
        ],
        "summary": "Power-Time",
        "description": "Estimate the fastest effort using rider Critical Power and W-prime. The model searches candidate durations from 30 seconds to 3 hours.",
        "operationId": "estimateBestEffort",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BestEffortRequest"
              },
              "example": {
                "segment": {
                  "riderMassKg": 70,
                  "bikeMassKg": 9,
                  "dragAreaSquareMeters": 0.3,
                  "rollingResistanceCoefficient": 0.005,
                  "drivetrainEfficiency": 0.96,
                  "distanceKm": 5,
                  "startAltitudeMeters": 300,
                  "finishAltitudeMeters": 500,
                  "airTemperatureCelsius": 20,
                  "headwindKmh": 0
                },
                "criticalPowerWatts": 300,
                "wPrimeJoules": 18000
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PowerTimeResponse"
                },
                "example": {
                  "durationSeconds": 694.6945,
                  "powerWatts": 328.4162,
                  "averageSpeedKmh": 25.9107,
                  "verticalAscentMetersPerHour": 1036.4268,
                  "wattsPerKg": 4.6917,
                  "gradientPercent": 4,
                  "powerBreakdown": {
                    "riderPowerWatts": 328.4162,
                    "wheelPowerWatts": 315.2795,
                    "drivetrainLossWatts": 13.1366,
                    "aerodynamicWatts": 64.2736,
                    "rollingResistanceWatts": 27.8896,
                    "gravityWatts": 223.1168,
                    "totalResistiveWatts": 315.28,
                    "gravityAssistWatts": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fit/summary": {
      "post": {
        "tags": [
          "FIT Activity"
        ],
        "summary": "FIT Activity",
        "description": "Summarize an uploaded FIT activity and list its laps. Set maxSamples to 0–1000 to request evenly spaced samples of recorded data, which may include GPS coordinates.",
        "operationId": "summarizeFitActivity",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "maxSamples": {
                        "type": "integer",
                        "format": "int32"
                      }
                    }
                  }
                ]
              },
              "example": {
                "file": "ride.fit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FitSummary"
                },
                "example": {
                  "startTimeUtc": "2026-01-01T09:00:00Z",
                  "recordCount": 9,
                  "elapsedSeconds": 40,
                  "timerSeconds": 40,
                  "distanceMeters": 267.27,
                  "averageSpeedKmh": 24.0543,
                  "powerWatts": {
                    "average": 162,
                    "minimum": 150,
                    "maximum": 168
                  },
                  "speedKmh": {
                    "average": 24.0543,
                    "minimum": 23.4,
                    "maximum": 24.7104
                  },
                  "heartRateBpm": {
                    "average": 130,
                    "minimum": 128,
                    "maximum": 132
                  },
                  "cadenceRpm": {
                    "average": 84,
                    "minimum": 82,
                    "maximum": 85
                  },
                  "altitudeMeters": {
                    "average": 307.6,
                    "minimum": 300,
                    "maximum": 316
                  },
                  "cropUnavailableReason": null,
                  "laps": [
                    {
                      "number": 1,
                      "startSeconds": 0,
                      "endSeconds": 40
                    }
                  ],
                  "samples": [ ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/fit/crop": {
      "post": {
        "tags": [
          "FIT Activity"
        ],
        "summary": "FIT Activity",
        "description": "Export a section of an uploaded single-session FIT activity as a FIT file. Send either startSeconds and endSeconds since the first record, or firstLap and lastLap from the summary.",
        "operationId": "cropFitActivity",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "startSeconds": {
                        "type": "number",
                        "format": "double"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "endSeconds": {
                        "type": "number",
                        "format": "double"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "firstLap": {
                        "type": "integer",
                        "format": "int32"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "lastLap": {
                        "type": "integer",
                        "format": "int32"
                      }
                    }
                  }
                ]
              },
              "example": {
                "file": "ride.fit",
                "startSeconds": 5,
                "endSeconds": 20
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "200": {
            "description": "A FIT file attachment.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/vnd.ant.fit": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/race-simulator": {
      "post": {
        "tags": [
          "Race Simulator"
        ],
        "summary": "Race Simulator",
        "description": "Simulate pacing on a FIT or GPX course using rider and bike settings. Supported modes are manual, bestEffort, targetPower and targetTime. Manual mode generates the calculator’s balanced starting plan.",
        "operationId": "simulateRacePacing",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    }
                  },
                  {
                    "$ref": "#/components/schemas/RaceSettings"
                  }
                ]
              },
              "example": {
                "file": "course.gpx",
                "mode": "manual"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RaceResponse"
                },
                "example": {
                  "mode": "manual",
                  "distanceMeters": 2223.8985,
                  "durationSeconds": 368.5864,
                  "averageSpeedKmh": 21.7209,
                  "averagePowerWatts": 222.1694,
                  "elevationGainMeters": 70,
                  "workKilojoules": 81.8886,
                  "isPacingSustainable": true,
                  "targetTimeGapSeconds": null,
                  "pacingWarning": null,
                  "segments": [
                    {
                      "index": 0,
                      "distanceMeters": 1111.9493,
                      "startAltitudeMeters": 300,
                      "finishAltitudeMeters": 350,
                      "gradientPercent": 4.4966,
                      "targetPowerWatts": 227,
                      "durationSeconds": 220.2118,
                      "averageSpeedKmh": 18.178,
                      "wPrimeRemainingJoules": 15815.975,
                      "cumulativeSeconds": 220.2118
                    },
                    {
                      "index": 1,
                      "distanceMeters": 1111.9493,
                      "startAltitudeMeters": 350,
                      "finishAltitudeMeters": 370,
                      "gradientPercent": 1.7986,
                      "targetPowerWatts": 215,
                      "durationSeconds": 148.3746,
                      "averageSpeedKmh": 26.9791,
                      "wPrimeRemainingJoules": 14777.353,
                      "cumulativeSeconds": 368.5864
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/race-simulator/export": {
      "post": {
        "tags": [
          "Race Simulator"
        ],
        "summary": "Race Simulator",
        "description": "Simulate pacing and return a FIT pacing course (format=pacingCourse) or Garmin workout (format=garminWorkout). A pacing course requires a route with GPS data.",
        "operationId": "exportRacePacing",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": true,
            "schema": {
              "pattern": "^(pacingCourse|garminWorkout)$",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "$ref": "#/components/schemas/IFormFile"
                      }
                    }
                  },
                  {
                    "$ref": "#/components/schemas/RaceSettings"
                  }
                ]
              },
              "example": {
                "file": "course.gpx",
                "mode": "manual"
              }
            }
          },
          "required": true
        },
        "responses": {
          "400": {
            "description": "Bad Request",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          },
          "200": {
            "description": "A FIT file attachment.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/vnd.ant.fit": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "RateLimit-Policy": {
                "description": "Structured quota policy for this client IP and app instance. q is burst capacity and w is the rounded-up full refill time in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Structured snapshot of available requests (r). When empty, t is the suggested wait in seconds. On 429, use Retry-After.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiProblem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiProblem": {
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "BestEffortRequest": {
        "required": [
          "segment",
          "criticalPowerWatts",
          "wPrimeJoules"
        ],
        "type": "object",
        "properties": {
          "segment": {
            "$ref": "#/components/schemas/SegmentInput"
          },
          "criticalPowerWatts": {
            "maximum": 2000,
            "minimum": 1,
            "type": "number",
            "format": "double"
          },
          "wPrimeJoules": {
            "maximum": 100000,
            "minimum": 1,
            "type": "number",
            "format": "double"
          }
        }
      },
      "CadenceSpeedRequest": {
        "required": [
          "chainringTeeth",
          "sprocketTeeth",
          "cadencesRpm",
          "rimDiameterMillimeters",
          "tireThicknessMillimeters"
        ],
        "type": "object",
        "properties": {
          "chainringTeeth": {
            "maxItems": 4,
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "sprocketTeeth": {
            "maxItems": 24,
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "cadencesRpm": {
            "maxItems": 26,
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "rimDiameterMillimeters": {
            "maximum": 800,
            "minimum": 300,
            "type": "number",
            "format": "double"
          },
          "tireThicknessMillimeters": {
            "maximum": 65,
            "minimum": 18,
            "type": "number",
            "format": "double"
          }
        }
      },
      "CadenceSpeedResponse": {
        "required": [
          "cadencesRpm",
          "gears"
        ],
        "type": "object",
        "properties": {
          "cadencesRpm": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "gears": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GearSpeeds"
            }
          }
        }
      },
      "CriticalPowerRequest": {
        "required": [
          "riderMassKg",
          "efforts"
        ],
        "type": "object",
        "properties": {
          "riderMassKg": {
            "maximum": 200,
            "minimum": 1,
            "type": "number",
            "format": "double"
          },
          "efforts": {
            "maxItems": 3,
            "minItems": 3,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Effort"
            }
          }
        }
      },
      "CriticalPowerResponse": {
        "required": [
          "criticalPowerWatts",
          "wPrimeJoules",
          "estimatedFtpWatts",
          "criticalPowerWattsPerKg",
          "estimatedFtpWattsPerKg",
          "powerDurationCurve"
        ],
        "type": "object",
        "properties": {
          "criticalPowerWatts": {
            "type": "number",
            "format": "double"
          },
          "wPrimeJoules": {
            "type": "number",
            "format": "double"
          },
          "estimatedFtpWatts": {
            "type": "number",
            "format": "double"
          },
          "criticalPowerWattsPerKg": {
            "type": "number",
            "format": "double"
          },
          "estimatedFtpWattsPerKg": {
            "type": "number",
            "format": "double"
          },
          "powerDurationCurve": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PowerDurationPoint"
            }
          }
        }
      },
      "Effort": {
        "required": [
          "durationSeconds",
          "powerWatts"
        ],
        "type": "object",
        "properties": {
          "durationSeconds": {
            "maximum": 60000,
            "minimum": 60,
            "type": "integer",
            "format": "int32"
          },
          "powerWatts": {
            "maximum": 2000,
            "minimum": 1,
            "type": "number",
            "format": "double"
          }
        }
      },
      "FitLap": {
        "required": [
          "number",
          "startSeconds",
          "endSeconds"
        ],
        "type": "object",
        "properties": {
          "number": {
            "type": "integer",
            "format": "int32"
          },
          "startSeconds": {
            "type": "number",
            "format": "double"
          },
          "endSeconds": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "FitMetric": {
        "required": [
          "average",
          "minimum",
          "maximum"
        ],
        "type": "object",
        "properties": {
          "average": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "minimum": {
            "type": "number",
            "format": "double"
          },
          "maximum": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "FitSample": {
        "required": [
          "elapsedSeconds",
          "distanceMeters",
          "altitudeMeters",
          "speedKmh",
          "powerWatts",
          "cadenceRpm",
          "heartRateBpm",
          "latitude",
          "longitude"
        ],
        "type": "object",
        "properties": {
          "elapsedSeconds": {
            "type": "number",
            "format": "double"
          },
          "distanceMeters": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "altitudeMeters": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "speedKmh": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "powerWatts": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "cadenceRpm": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "heartRateBpm": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "latitude": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "longitude": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "FitSummary": {
        "required": [
          "startTimeUtc",
          "recordCount",
          "elapsedSeconds",
          "timerSeconds",
          "distanceMeters",
          "averageSpeedKmh",
          "powerWatts",
          "speedKmh",
          "heartRateBpm",
          "cadenceRpm",
          "altitudeMeters",
          "cropUnavailableReason",
          "laps",
          "samples"
        ],
        "type": "object",
        "properties": {
          "startTimeUtc": {
            "type": "string",
            "format": "date-time"
          },
          "recordCount": {
            "type": "integer",
            "format": "int32"
          },
          "elapsedSeconds": {
            "type": "number",
            "format": "double"
          },
          "timerSeconds": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "distanceMeters": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "averageSpeedKmh": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "powerWatts": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FitMetric"
              }
            ]
          },
          "speedKmh": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FitMetric"
              }
            ]
          },
          "heartRateBpm": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FitMetric"
              }
            ]
          },
          "cadenceRpm": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FitMetric"
              }
            ]
          },
          "altitudeMeters": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FitMetric"
              }
            ]
          },
          "cropUnavailableReason": {
            "type": [
              "null",
              "string"
            ]
          },
          "laps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FitLap"
            }
          },
          "samples": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FitSample"
            }
          }
        }
      },
      "GearSpeeds": {
        "required": [
          "chainringTeeth",
          "sprocketTeeth",
          "speedsKmh"
        ],
        "type": "object",
        "properties": {
          "chainringTeeth": {
            "type": "integer",
            "format": "int32"
          },
          "sprocketTeeth": {
            "type": "integer",
            "format": "int32"
          },
          "speedsKmh": {
            "type": "array",
            "items": {
              "type": "number",
              "format": "double"
            }
          }
        }
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "LactateStep": {
        "required": [
          "durationSeconds",
          "distanceKm",
          "powerWatts",
          "lactateMmolPerLiter"
        ],
        "type": "object",
        "properties": {
          "durationSeconds": {
            "maximum": 10859,
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          },
          "distanceKm": {
            "maximum": 100,
            "minimum": 0.0000000000000000000000000000,
            "type": "number",
            "format": "double"
          },
          "powerWatts": {
            "maximum": 2500,
            "minimum": 0.0000000000000000000000000000,
            "type": "number",
            "format": "double"
          },
          "lactateMmolPerLiter": {
            "maximum": 30,
            "minimum": 0.0000000000000000000000000000,
            "type": "number",
            "format": "double"
          }
        }
      },
      "LactateTestMethod": {
        "enum": [
          "mader",
          "dmax"
        ]
      },
      "LactateTestRequest": {
        "required": [
          "method",
          "steps"
        ],
        "type": "object",
        "properties": {
          "method": {
            "$ref": "#/components/schemas/LactateTestMethod"
          },
          "steps": {
            "maxItems": 50,
            "minItems": 2,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LactateStep"
            }
          }
        }
      },
      "LactateTestResponse": {
        "required": [
          "method",
          "peakPowerWatts",
          "peakLactateMmolPerLiter",
          "thresholds"
        ],
        "type": "object",
        "properties": {
          "method": {
            "$ref": "#/components/schemas/LactateTestMethod"
          },
          "peakPowerWatts": {
            "type": "number",
            "format": "double"
          },
          "peakLactateMmolPerLiter": {
            "type": "number",
            "format": "double"
          },
          "thresholds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LactateThreshold"
            }
          }
        }
      },
      "LactateThreshold": {
        "required": [
          "name",
          "targetLactateMmolPerLiter",
          "powerWatts",
          "isAvailable",
          "note"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "targetLactateMmolPerLiter": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "powerWatts": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "isAvailable": {
            "type": "boolean"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "PowerBreakdownModel": {
        "type": "object",
        "properties": {
          "riderPowerWatts": {
            "type": "number",
            "format": "double"
          },
          "wheelPowerWatts": {
            "type": "number",
            "format": "double"
          },
          "drivetrainLossWatts": {
            "type": "number",
            "format": "double"
          },
          "aerodynamicWatts": {
            "type": "number",
            "format": "double"
          },
          "rollingResistanceWatts": {
            "type": "number",
            "format": "double"
          },
          "gravityWatts": {
            "type": "number",
            "format": "double"
          },
          "totalResistiveWatts": {
            "type": "number",
            "format": "double"
          },
          "gravityAssistWatts": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "PowerDurationPoint": {
        "required": [
          "durationMinutes",
          "powerWatts"
        ],
        "type": "object",
        "properties": {
          "durationMinutes": {
            "type": "number",
            "format": "double"
          },
          "powerWatts": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "PowerForTimeRequest": {
        "required": [
          "segment",
          "targetDurationSeconds"
        ],
        "type": "object",
        "properties": {
          "segment": {
            "$ref": "#/components/schemas/SegmentInput"
          },
          "targetDurationSeconds": {
            "maximum": 86459,
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "PowerTimeResponse": {
        "required": [
          "durationSeconds",
          "powerWatts",
          "averageSpeedKmh",
          "verticalAscentMetersPerHour",
          "wattsPerKg",
          "gradientPercent",
          "powerBreakdown"
        ],
        "type": "object",
        "properties": {
          "durationSeconds": {
            "type": "number",
            "format": "double"
          },
          "powerWatts": {
            "type": "number",
            "format": "double"
          },
          "averageSpeedKmh": {
            "type": "number",
            "format": "double"
          },
          "verticalAscentMetersPerHour": {
            "type": "number",
            "format": "double"
          },
          "wattsPerKg": {
            "type": "number",
            "format": "double"
          },
          "gradientPercent": {
            "type": "number",
            "format": "double"
          },
          "powerBreakdown": {
            "$ref": "#/components/schemas/PowerBreakdownModel"
          }
        }
      },
      "PowerZoneMethod": {
        "enum": [
          "cogganSeven",
          "cogganSix",
          "trainerRoad",
          "eightyTwenty"
        ]
      },
      "RaceResponse": {
        "required": [
          "mode",
          "distanceMeters",
          "durationSeconds",
          "averageSpeedKmh",
          "averagePowerWatts",
          "elevationGainMeters",
          "workKilojoules",
          "isPacingSustainable",
          "targetTimeGapSeconds",
          "pacingWarning",
          "segments"
        ],
        "type": "object",
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/RaceSimulationMode"
          },
          "distanceMeters": {
            "type": "number",
            "format": "double"
          },
          "durationSeconds": {
            "type": "number",
            "format": "double"
          },
          "averageSpeedKmh": {
            "type": "number",
            "format": "double"
          },
          "averagePowerWatts": {
            "type": "number",
            "format": "double"
          },
          "elevationGainMeters": {
            "type": "number",
            "format": "double"
          },
          "workKilojoules": {
            "type": "number",
            "format": "double"
          },
          "isPacingSustainable": {
            "type": "boolean"
          },
          "targetTimeGapSeconds": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "pacingWarning": {
            "type": [
              "null",
              "string"
            ]
          },
          "segments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RaceSegment"
            }
          }
        }
      },
      "RaceSegment": {
        "required": [
          "index",
          "distanceMeters",
          "startAltitudeMeters",
          "finishAltitudeMeters",
          "gradientPercent",
          "targetPowerWatts",
          "durationSeconds",
          "averageSpeedKmh",
          "wPrimeRemainingJoules",
          "cumulativeSeconds"
        ],
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "distanceMeters": {
            "type": "number",
            "format": "double"
          },
          "startAltitudeMeters": {
            "type": "number",
            "format": "double"
          },
          "finishAltitudeMeters": {
            "type": "number",
            "format": "double"
          },
          "gradientPercent": {
            "type": "number",
            "format": "double"
          },
          "targetPowerWatts": {
            "type": "number",
            "format": "double"
          },
          "durationSeconds": {
            "type": "number",
            "format": "double"
          },
          "averageSpeedKmh": {
            "type": "number",
            "format": "double"
          },
          "wPrimeRemainingJoules": {
            "type": "number",
            "format": "double"
          },
          "cumulativeSeconds": {
            "type": "number",
            "format": "double"
          }
        }
      },
      "RaceSettings": {
        "type": "object",
        "properties": {
          "minSegmentLengthMeters": {
            "maximum": 100000,
            "minimum": 50,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "gradientChangeTolerancePercent": {
            "maximum": 30,
            "minimum": 0.1,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "riderMassKg": {
            "maximum": 200,
            "minimum": 1,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "bikeMassKg": {
            "maximum": 50,
            "minimum": 1,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "dragAreaSquareMeters": {
            "maximum": 1,
            "minimum": 0.1,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "rollingResistanceCoefficient": {
            "maximum": 0.02,
            "minimum": 0,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "drivetrainEfficiency": {
            "maximum": 1,
            "minimum": 0.001,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "airTemperatureCelsius": {
            "maximum": 60,
            "minimum": -50,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "windSpeedKmh": {
            "maximum": 200,
            "minimum": 0,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "windDirectionDegrees": {
            "maximum": 360,
            "minimum": 0,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "criticalPowerWatts": {
            "maximum": 2000,
            "minimum": 1,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "wPrimeJoules": {
            "maximum": 100000,
            "minimum": 1,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "maximumPowerWatts": {
            "maximum": 2500,
            "minimum": 1,
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "powerIncrementWatts": {
            "maximum": 100,
            "minimum": 1,
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "coastingGradientPercent": {
            "maximum": 0,
            "minimum": -50,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "mode": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RaceSimulationMode"
              }
            ]
          },
          "targetAveragePowerWatts": {
            "maximum": 2000,
            "minimum": 1,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "targetDurationSeconds": {
            "maximum": 86400,
            "minimum": 1,
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "RaceSimulationMode": {
        "enum": [
          "bestEffort",
          "manual",
          "targetPower",
          "targetTime"
        ]
      },
      "SegmentInput": {
        "required": [
          "riderMassKg",
          "bikeMassKg",
          "dragAreaSquareMeters",
          "rollingResistanceCoefficient",
          "drivetrainEfficiency",
          "distanceKm",
          "startAltitudeMeters",
          "finishAltitudeMeters",
          "airTemperatureCelsius",
          "headwindKmh"
        ],
        "type": "object",
        "properties": {
          "riderMassKg": {
            "maximum": 200,
            "minimum": 1,
            "type": "number",
            "format": "double"
          },
          "bikeMassKg": {
            "maximum": 50,
            "minimum": 1,
            "type": "number",
            "format": "double"
          },
          "dragAreaSquareMeters": {
            "maximum": 1,
            "minimum": 0.1,
            "type": "number",
            "format": "double"
          },
          "rollingResistanceCoefficient": {
            "maximum": 0.02,
            "minimum": 0,
            "type": "number",
            "format": "double"
          },
          "drivetrainEfficiency": {
            "maximum": 1,
            "minimum": 0.001,
            "type": "number",
            "format": "double"
          },
          "distanceKm": {
            "maximum": 1000,
            "minimum": 0.001,
            "type": "number",
            "format": "double"
          },
          "startAltitudeMeters": {
            "maximum": 20000,
            "minimum": 0,
            "type": "number",
            "format": "double"
          },
          "finishAltitudeMeters": {
            "maximum": 20000,
            "minimum": 0,
            "type": "number",
            "format": "double"
          },
          "airTemperatureCelsius": {
            "maximum": 60,
            "minimum": -50,
            "type": "number",
            "format": "double"
          },
          "headwindKmh": {
            "maximum": 200,
            "minimum": -200,
            "type": "number",
            "format": "double"
          }
        }
      },
      "TimeFromPowerRequest": {
        "required": [
          "segment",
          "powerWatts"
        ],
        "type": "object",
        "properties": {
          "segment": {
            "$ref": "#/components/schemas/SegmentInput"
          },
          "powerWatts": {
            "maximum": 2000,
            "minimum": 1,
            "type": "number",
            "format": "double"
          }
        }
      },
      "TrainingZone": {
        "required": [
          "name",
          "description",
          "fromWatts",
          "toWatts",
          "fromWattsPerKg",
          "toWattsPerKg"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "fromWatts": {
            "type": "number",
            "format": "double"
          },
          "toWatts": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          },
          "fromWattsPerKg": {
            "type": "number",
            "format": "double"
          },
          "toWattsPerKg": {
            "type": [
              "null",
              "number"
            ],
            "format": "double"
          }
        }
      },
      "TrainingZonesRequest": {
        "required": [
          "ftpWatts",
          "riderMassKg",
          "method"
        ],
        "type": "object",
        "properties": {
          "ftpWatts": {
            "maximum": 600,
            "minimum": 1,
            "type": "number",
            "format": "double"
          },
          "riderMassKg": {
            "maximum": 200,
            "minimum": 1,
            "type": "number",
            "format": "double"
          },
          "method": {
            "$ref": "#/components/schemas/PowerZoneMethod"
          }
        }
      },
      "TrainingZonesResponse": {
        "required": [
          "method",
          "zones"
        ],
        "type": "object",
        "properties": {
          "method": {
            "$ref": "#/components/schemas/PowerZoneMethod"
          },
          "zones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrainingZone"
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Cadence-Speed"
    },
    {
      "name": "Training Zones"
    },
    {
      "name": "Critical Power"
    },
    {
      "name": "Lactate Thresholds"
    },
    {
      "name": "Power-Time"
    },
    {
      "name": "FIT Activity"
    },
    {
      "name": "Race Simulator"
    }
  ]
}