API Reference
Authentication
Pass your API key as a bearer token on every request:
Authorization: Bearer tlab_live_...
POST /api/v1/generate
Generates a complete one-week training plan. Costs 5 tokens from your account balance, deducted only after the response passes validation - you're never charged for a failed generation. Rate limited to 20 requests/hour per key.
Request body
primary_goal / secondary_goal: loose_weightbuild_muscleimprove_enduranceimprove_strengthincrease_mobility
activities (max 2): gymrunninghiitswimmingtraining_at_home
user_profile.experience: novicesome_experiencefew_yearsamateur_veteranprofessional
user_profile.muscle_mass_level: lowregularfitmuscledextremely_muscular
schedule.days_selected (2-7): montuewedthufrisatsun
preferences.training_length: up_to_40_minutesup_to_60_minutesup_to_90_minutesup_to_120_minutes
preferences.gear_type (optional): bodyweightfree_weightsmachine
preferences.type_of_sets: supersetssingle_exercisescontrast_sets
preferences.exercise_complexity: beginnerintermediateadvanced
preferences.rest_between_sets (optional): 30_seconds1_minute2_minutes
preferences.rest_between_exercises (optional): 1_minute2_minutes3_minutes
Plus:
- user_profile (date_of_birth, sex, height_cm, weight_kg)
- schedule.user_adjusted_split (how many of the selected days go to each activity)
- injuries (array of { area, occurred, current_impact })
- notes - optional, max 500 chars, freeform steering (e.g. "focus on more leg volume")
Response
200 - The generated plan (name, summary, warnings, and a day-by-day exercise schedule, each exercise enriched with reference images/instructions where available).
Error codes
401- missing, malformed, or invalid/revoked API key400- request body failed validation402- insufficient token balance422- the model declined to generate this plan429- rate limit exceeded502- generation failed after retry