Skip to content
PithLab

↑↓ to move · Enter to open · Esc to close

Sleep Calculator API

Bedtimes for a wake-up time, or wake-up times for a bedtime, timed to whole 90-minute sleep cycles (6, 5, 4 or 3 cycles).

POST /api/v1/tools/sleep-calculatorMCP sleep_calculatorTime & Date

Find the best time to go to bed or wake up based on 90-minute sleep cycles plus the time it takes you to fall asleep, so you wake between cycles.

Input

Send these as a JSON object. Unknown fields are rejected.

mode
wake: time is when you want to wake up; returns bedtimes. bed: time is when you go to bed; returns wake-up times. (string, one of wake, bed, required)
time
Time of day as "HH:MM" (24-hour) or "h:mm am/pm", e.g. "07:00" or "6:30 AM". (string, up to 12 characters, required)
fallAsleepMinutes
Minutes it takes to fall asleep. (integer, 0 to 120, default 15)
clock
Output time format. (string, one of 24h, 12h, default "24h")
curl https://pithlab.com/api/v1/tools/sleep-calculator \n  -H "Authorization: Bearer $PITHLAB_KEY" \n  -H "Content-Type: application/json" \n  -d '{"mode":"wake","time":"07:00"}'