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
| Field | Type | Description |
prompt | string | The goal or focus of the workout (e.g. “core stability”, “strength training”) |
duration | number | Workout length in minutes |
style | string | Optional: style preset (e.g. “strength”, “hiit”, “mobility”) |
workoutType | string | "reps" or "duration" |
equipment | array | Optional list of equipment (e.g. ["kettlebell", "bands"]) |
Each section (warmup, main, cooldown, backup) contains an array of structured exercises:
| Field | Type | Description |
name | string | Exercise name |
description | string | Instructions and form cues |
duration | number | Minutes (for timed exercises) |
sets | number | Sets count |
reps | number | Repetitions per set |
weight | number / string | Suggested 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
| Category | Details |
| Platform | Firebase Cloud Functions |
| Model | Mixtral, Gemini, Claude (via OpenRouter) |
| Language | Node.js |
| Credits | Free 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."
}
]
}