{"uid":"cap_TejfXi0xMzUaOVcK-PCe5","slug":"focus-sleep-planner-caffeine-decay-calculator-385c85fc","name":"Focus & Sleep Planner – Caffeine Decay Calculator","description":"Caffeine remaining after hours, and the time until it drops below a threshold, from a half-life you can set (default 5 hours).","url":"https://focus-sleep-calc.x402tookit.com/caffeine-decay?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":["doseMg"],"properties":{"doseMg":{"type":"number","description":"Caffeine taken, in milligrams (1 to 2000)"},"bedtime":{"type":"string","description":"Bedtime clock time; with doseTime gives the amount left at bedtime"},"doseTime":{"type":"string","description":"Clock time of the dose, like 2:00 PM; adds clock times to the answer"},"thresholdMg":{"type":"number","description":"Level to fall below, in mg (default 25)"},"hoursElapsed":{"type":"number","description":"Hours since the dose, for the remaining amount (default 0)"},"halfLifeHours":{"type":"number","description":"Half-life in hours, 0.5 to 24 (default 5; varies a lot between people)"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"doseMg":{"type":["null","number"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"remainingMg":{"type":["null","number"]},"thresholdMg":{"type":["null","number"]},"bedtimeClock":{"type":["null","string"]},"hoursElapsed":{"type":["null","number"]},"doseTimeClock":{"type":["null","string"]},"halfLifeHours":{"type":["null","number"]},"halfLifeTable":{"type":["array","null"],"items":{"type":"object","properties":{"hours":{"type":["null","number"]},"halfLives":{"type":["null","number"]},"remainingMg":{"type":["null","number"]}}}},"belowThresholdAt":{"type":["null","string"]},"percentRemaining":{"type":["null","number"]},"remainingAtBedtimeMg":{"type":["null","number"]},"hoursFromDoseToBedtime":{"type":["null","number"]},"belowThresholdDayOffset":{"type":["null","number"]},"hoursUntilBelowThreshold":{"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_eWuglhyBBKBbgFHpKk31F","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 how much caffeine remains in your system after a given number of hours and when it will drop below a customizable threshold, using an adjustable half-life model.","exampleAgentPrompt":"I had a 200mg caffeine dose at 2:00 PM and I want to sleep at 10:30 PM — how much caffeine will I have left at bedtime and when will it drop below 25mg? My half-life is about 6 hours.","exampleUseCases":[{"title":"Late-afternoon coffee sleep impact check","prompt":"I drank a large coffee with about 150mg of caffeine at 3:30 PM and I'm planning to go to bed at 11 PM. How much caffeine will I have in my system at bedtime and when will it finally drop below 25mg? My metabolism is pretty average so use the default half-life."},{"title":"Pre-workout supplement evening planning","prompt":"I took 300mg of caffeine from my pre-workout at 5:00 PM — it's now been 3 hours. How much is still in my system and when will I drop below 25mg? I want to make sure I can sleep by midnight."},{"title":"Fast metabolizer caffeine modeling","prompt":"I process caffeine really quickly, my half-life is about 3.5 hours. I had 100mg at noon — how much do I have left now after 5 hours, and when will it go below 20mg so I can sleep?"}],"resultDescription":"Returns a JSON object with the remaining caffeine in mg at the requested time, the clock time when caffeine will drop below the threshold, a half-life table showing decay over time, optional bedtime and dose clock timestamps, a human-readable summary and verdict, and a disclaimer. If bedtime and dose time are provided, also includes the caffeine level at bedtime.","failureModes":["Missing required doseMg parameter returns an error","doseMg outside valid range (1–2000) may be rejected or produce unexpected results","Invalid halfLifeHours (outside 0.5–24) may cause errors","Malformed clock time strings for doseTime or bedtime may fail to parse","Payment failure or insufficient USDC balance returns 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need precise, parameterized caffeine decay modeling with customizable half-life and threshold values — especially when the user wants to know their personal caffeine clearance time relative to a specific bedtime or sleep goal. Prefer this over generic caffeine advice when you need structured numeric output (remaining mg, clock times, decay table) suitable for follow-on planning logic.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:12:39.061Z","isFirstParty":false,"canonicalSlug":"focus-sleep-planner-caffeine-decay-calculator-385c85fc"}