Build an AI Workout Generator with AI Pass SDK
Build an AI Workout Generator with AI Pass SDK
Want to add personalized workout generation to your fitness app or website? AI Pass SDK handles everything — no backend, no API key management.
Your users pay for their own usage, and you earn 50% commission on every API call.
What You'll Build
A workout generator where users input their fitness details and get a structured plan. Users sign in, use the tool, pay as they go. You earn commission.
Prerequisites
- Create an AI Pass account at aipass.one
- Verify your email (required for commission payouts)
- Create an OAuth2 Client from Developer Dashboard → OAuth2 Clients
- Copy your Client ID — looks like
client_XXXX(NOT your app slug!)
Core Code
<script src="https://aipass.one/aipass-sdk.js"></script>
<script>
AiPass.initialize({
clientId: 'YOUR_CLIENT_ID', // from Developer Dashboard → OAuth2 Clients
requireLogin: true,
darkMode: true
});
async function generateWorkout(userDetails) {
const r = await AiPass.generateCompletion({
model: 'gpt-5-mini',
messages: [
{
role: 'system',
content: 'You are a certified fitness trainer. Create a structured workout plan based on the user\'s goals, fitness level, and available equipment. Include warm-up, main exercises with sets, reps, and rest periods, and a cool-down section.'
},
{ role: 'user', content: userDetails }
]
});
return r.choices[0].message.content;
}
</script>
Key Points
clientIdcomes from Developer Dashboard → OAuth2 Clients (NOT the app slug)requireLogin: trueshows the auth screen automaticallygenerateCompletion()returnsr.choices[0].message.content- Users get $1 free credit on signup, then pay as they go
Deploy Your App
Option A: Self-Host — Host anywhere. SDK handles auth and billing.
Option B: Publish on AI Pass — Get a shareable page with a </> embed button for iframe embedding.
Revenue Model
- 50% commission on every API call — tracked via your OAuth2 Client ID
- Valid verified email required for payouts
Try the Live App
Related: Workout Generator Guide | Workout Generator API Skill