# WOD Coach: AI Personal Trainer & Workout API

> Fitness API for AI agents and apps. AI personal trainer (injury-safe personalised training programs),
> workout generator (CrossFit, Hyrox, functional fitness, running), exercise substitutions for injuries,
> a race pace calculator for HYROX-format races and a warm-up generator. Pay per call with x402
> (USDC on Base, eip155:8453): no API keys, no sign-up.

## How to pay
Call any paid endpoint. You get HTTP 402 with a `PAYMENT-REQUIRED` header (base64 JSON x402 challenge).
Sign the EIP-3009 USDC authorization and retry with `PAYMENT-SIGNATURE`. Failed requests are never charged.
Machine-readable spec: [https://wod-api-production.up.railway.app/openapi.json](https://wod-api-production.up.railway.app/openapi.json)

## Paid endpoints
- [POST /wod/custom](https://wod-api-production.up.railway.app/wod/custom): $0.35 USDC. AI personal trainer and strength coach. Personalised workout plan or training program from your equipment, goals and injuries, with strict injury-safe exercise substitutions. Home gym, full gym or bodyweight; single workout or 3-8 week periodised block. Fitness, CrossFit, HYROX-format racing, running. $0.35 USDC on Base via x402. Independent; not affiliated with HYROX.
- [GET /wod](https://wod-api-production.up.railway.app/wod): $0.05 USDC. Workout generator (WOD): instant gym, home-gym, CrossFit, functional fitness, running or HYROX-format race workout. Formats: Strength, Metcon, Engine (cardio), Long Metcon, Speed Run, Zone 2 Run. $0.05 USDC on Base via x402. Independent; not affiliated with HYROX.
- [POST /tools/substitute](https://wod-api-production.up.railway.app/tools/substitute): $0.02 USDC. Exercise substitution for injuries, $0.02 USDC on Base: give a movement (e.g. barbell back squat) and an injury or limitation (e.g. knee pain, shoulder impingement) and get 3-5 safe alternative exercises with prescriptions, coaching cues and stop signs. Physio-informed, not medical advice. Gym, home gym, CrossFit, functional fitness.
- [GET /tools/race-pace](https://wod-api-production.up.railway.app/tools/race-pace): $0.01 USDC. Race pace calculator for HYROX-format fitness races, $0.01 USDC on Base: target finish time to splits for all 8 x 1 km runs and 8 stations (ski, sled push, sled pull, burpee broad jumps, row, farmers carry, lunges, wall balls), run pace per km, transition time, strategy and an optional 5k check. Independent; not affiliated with HYROX.
- [GET /tools/warmup](https://wod-api-production.up.railway.app/tools/warmup): $0.01 USDC. Warm-up generator, $0.01 USDC on Base: a targeted warm-up for a session type (strength, metcon, engine, speed run, zone 2) with optional prehab for the shoulder, knee, hip, lower back, ankle or wrist. 5-20 minutes, returns structured blocks plus Markdown. Gym, CrossFit, running.

## Free endpoints
- [GET /wod/today](https://wod-api-production.up.railway.app/wod/today): today's workout of the day (add ?format=json)
- [GET /wod/week](https://wod-api-production.up.railway.app/wod/week): this week's programme
- [GET /wod/day/YYYY-MM-DD](https://wod-api-production.up.railway.app/wod/today): a past day's workout

## MCP server
Streamable HTTP at https://wod-api-production.up.railway.app/mcp. Free tools: `get_todays_wod`, `get_weekly_programme`. Paid (x402 over MCP):
- `coach_programme`: $0.35 USDC
- `generate_workout`: $0.05 USDC
- `substitute_exercise`: $0.02 USDC
- `race_pace_plan`: $0.01 USDC
- `warmup_generator`: $0.01 USDC

## Legal
HYROX is a registered trademark of its owner. WOD Coach is an independent product and is not affiliated with, endorsed by or sponsored by HYROX.

## Discovery
- OpenAPI: https://wod-api-production.up.railway.app/openapi.json
- A2A agent card: https://wod-api-production.up.railway.app/.well-known/agent-card.json
- x402 resources: https://wod-api-production.up.railway.app/.well-known/x402
