Skip to main content
An open AI workout generator API powered by OpenRouter and Firebase. No account needed — just use the public demo key below.

🧠 Overview

The Workout Generator API creates structured JSON workouts based on a text prompt, workout style, duration, and available equipment. You can use it to generate warm-ups, main sets, cooldowns, and backups — perfect for building your own fitness app, prototype, or integration.

🔑 Access

To use the API, include this demo key in your request headers:
Authorization: Bearer dontbeajerk
If you see a 401 Unauthorized error, the key may have rotated. Check this page for the latest demo key.

🚀 Endpoint

POST https://us-central1-ios-workout-app-6bc96.cloudfunctions.net/generateWorkoutPublic

⚙️ Parameters

FieldTypeDescription
promptstringThe goal or focus of the workout (e.g. “core stability”, “strength training”)
durationnumberWorkout length in minutes
stylestringOptional: style preset (e.g. “strength”, “hiit”, “mobility”)
workoutTypestring"reps" or "duration"
equipmentarrayOptional list of equipment (e.g. ["kettlebell", "bands"])

🧰 Response Format

Each section (warmup, main, cooldown, backup) contains an array of structured exercises:
FieldTypeDescription
namestringExercise name
descriptionstringInstructions and form cues
durationnumberMinutes (for timed exercises)
setsnumberSets count
repsnumberRepetitions per set
weightnumber / stringSuggested weight (or "light", "medium", "heavy")

💡 Example Use Case

Build a “Generate Workout” button in your app:
const response = await fetch(
  "https://us-central1-ios-workout-app-6bc96.cloudfunctions.net/generateWorkoutPublic",
  {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "Authorization": "Bearer dontbeajerk",
    },
    body: JSON.stringify({
      prompt: "full body strength circuit",
      duration: 30,
      style: "hiit",
      equipment: ["kettlebell"],
    }),
  }
);
const workout = await response.json();
console.log(workout.main);

🏗️ Project Details

CategoryDetails
PlatformFirebase Cloud Functions
ModelMixtral, Gemini, Claude (via OpenRouter)
LanguageNode.js
CreditsFree access with demo key
curl -X POST https://us-central1-ios-workout-app-6bc96.cloudfunctions.net/generateWorkoutPublic \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer dontbeajerk" \
  -d '{
    "prompt": "upper body push workout focused on chest and triceps",
    "duration": 45,
    "style": "strength",
    "workoutType": "reps",
    "equipment": ["bench", "dumbbells", "bands"]
  }'
{
  "warmup": [
    {
      "name": "Arm Circles",
      "description": "Stand with feet shoulder-width apart. Extend arms out to the sides at shoulder height. Make small, circular movements with both arms going forward for 30 seconds. Then, reverse the direction for another 30 seconds.",
      "duration": 1,
      "sets": 1,
      "reps": 0,
      "weight": 0
    }
  ],
  "main": [
    {
      "name": "Dumbbell Chest Press",
      "description": "Lie on a bench with your feet flat on the floor. Hold a dumbbell in each hand at chest level with your palms facing your legs. Press the dumbbells straight up, fully extending your arms. Lower the dumbbells back to chest level, keeping a slight bend in your elbows.",
      "sets": 3,
      "reps": 10,
      "weight": "medium"
    }
  ],
  "cooldown": [
    {
      "name": "Shoulder Stretch",
      "description": "Reach one arm across your chest and use your other arm to deepen the stretch. Hold for 15–30 seconds per side."
    }
  ],
  "backup": [
    {
      "name": "Push-ups",
      "description": "Perform push-ups for 3 sets of 10–12 reps. Keep your core engaged and your body in a straight line."
    }
  ]
}