{"uid":"cap_7L8mu9trTC_bPIj0GGLn-","slug":"focus-sleep-planner-sleep-debt-calculator-c6425202","name":"Focus & Sleep Planner – Sleep Debt Calculator","description":"Tally nightly sleep hours against a nightly need: net shortfall, short nights, average, and extra hours a night to even out.","url":"https://focus-sleep-calc.x402tookit.com/sleep-debt?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["nights"],"properties":{"nights":{"type":"string","description":"Comma-separated hours slept each night, like 7,6.5,5,8 (1 to 60 nights, 0 to 24 each)"},"needHours":{"type":"number","description":"Hours you aim to sleep per night, 1 to 16 (default 8)"},"recoverNights":{"type":"number","description":"Nights over which to spread the catch-up, 1 to 60 (default 7)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"needHours":{"type":["null","number"]},"disclaimer":{"type":["null","string"]},"hoursSlept":{"type":["null","number"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"hoursWanted":{"type":["null","number"]},"shortNights":{"type":["null","number"]},"averageHours":{"type":["null","number"]},"nightsCounted":{"type":["null","number"]},"recoverNights":{"type":["null","number"]},"surplusOnlyHours":{"type":["null","number"]},"longestNightHours":{"type":["null","number"]},"netShortfallHours":{"type":["null","number"]},"shortestNightHours":{"type":["null","number"]},"shortfallOnlyHours":{"type":["null","number"]},"extraHoursPerNightToEvenOut":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_2FzaviL50jOABhsW0q2Oh","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates sleep debt by tallying nightly sleep hours against a target need, returning net shortfall, short night count, average sleep, and extra hours per night needed to recover.","exampleAgentPrompt":"I slept 6, 7, 5, 6.5, 8, 5 hours over the last 6 nights and I aim for 8 hours a night — calculate my total sleep debt, how many short nights I had, my average, and how much extra I'd need each night to catch up over the next 7 nights.","exampleUseCases":[{"title":"Weekly sleep debt after bad stretch","prompt":"I had a rough week — here are my sleep hours: 5, 6, 4.5, 7, 6, 5.5, 8. My target is 8 hours a night. What's my total sleep shortfall and how much extra sleep do I need each night over the next 7 nights to recover?"},{"title":"Recovery plan after all-nighter crunch","prompt":"I've been pulling late nights for a project — I slept 3, 4, 5, 6, 4 hours over the last 5 nights. I normally need 7.5 hours. How much sleep debt have I built up and how many extra hours per night would I need to even out over the next 5 nights?"},{"title":"Check if teenager is sleeping enough","prompt":"My teenager slept 7, 6.5, 8, 7, 9, 6, 7.5 hours this week — their nightly need is 9 hours. How many nights were short, what's the average, and what's the total deficit?"}],"resultDescription":"Returns a JSON object with: total hours slept, hours wanted, net shortfall hours, shortfall-only hours, surplus-only hours, number of short nights, average hours per night, longest and shortest night, extra hours per night needed to even out over the recovery window, nights counted, and a plain-language summary and verdict.","failureModes":["Missing 'nights' parameter returns an error","Values outside 0–24 per night are rejected","More than 60 nights supplied triggers a validation error","Non-numeric or malformed comma-separated string causes a parse error","needHours outside 1–16 or recoverNights outside 1–60 are rejected"],"whenToPreferThis":"Use this endpoint when you need a detailed breakdown of accumulated sleep debt from a list of nightly sleep durations — including shortfall, average, short-night count, and a per-night catch-up figure. Prefer it over generic sleep advice services when you have concrete nightly data and want structured numeric output for a recovery plan.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:15:02.255Z","isFirstParty":false,"canonicalSlug":"focus-sleep-planner-sleep-debt-calculator-c6425202"}