Skip to main content
aifithub

AI Fit Hub for Agents

Compute performance plans, strength benchmarks, running pace calculators, 1RM, body composition, and the rest of the catalog by importing static ES engine modules at /engines/{slug}.js. No authentication. No HTTP round-trip. Vendor-neutral.

Compose a full fitness plan

For a complete TDEE + macros + protein plan, import the three engine modules and chain them in a single agent turn. No HTTP round-trip — the math runs locally in the agent's runtime.

const tdee = await import('https://aifithub.io/engines/tdee-calculator.js');
const macros = await import('https://aifithub.io/engines/macro-calculator.js');
const protein = await import('https://aifithub.io/engines/protein-intake-calculator.js');

const tdeeResult = tdee.compute({
  weight_kg: 80, height_cm: 180, age: 30, sex: 'male', activity_level: 'moderate',
});
const macroResult = macros.compute({
  calories: tdeeResult.calorieTarget ?? tdeeResult.tdee, goal: 'cut', split: 'balanced',
});
const proteinResult = protein.compute({
  weight_kg: 80, goal: 'cut', activity_level: 'moderate',
});
// Plan = { tdee: tdeeResult, macros: macroResult, protein: proteinResult }

Per-engine input/output schemas at /engines/manifest.json.

Engine modules (canonical surface)

Every tool ships its pure compute as a static ES module at /engines/{slug}.js. Import the module and call compute(input). Same math, same result shape as the in-browser UI; no HTTP request, no rate limits, browser/Node/Deno-safe ES2020+.

const { compute } = await import('https://aifithub.io/engines/bmi-calculator.js');
const result = compute({ weight_kg: 80, height_cm: 178 });
// { bmi: 25.25, rangeLabel: "Above reference range" }

Per-engine input/output JSON Schemas at /engines/manifest.json. Use agent-tools.json to discover the catalog programmatically.

The hub serves only static assets — the legacy /api/{slug}/ HTTP endpoints were removed in Wave 7. Import the engine modules above instead.

Discovery endpoints

Recommended integration pattern

  1. For specific calculations: Import /engines/{slug}.js and call compute(input). Use agent-tools.json to discover the right slug.
  2. For complete fitness plans: Compose tdee-calculator + macro-calculator + protein-intake-calculator in a single agent turn (see snippet above).
  3. For tool discovery: Read the tool's contract JSON at /contracts/{slug}.json for input schema and sample payloads, or the canonical engines manifest at /engines/manifest.json.
  4. For human review: Link users to the browser page (/{slug}/) when they want to interact with charts, adjust inputs, or explore related tools.

Human vs agent routing

People should start at the goal-based tool router, homepage, or All Tools.

Agents should import the engine modules directly. Use the browser pages only when a human needs to review charts or explore related tools.