# Focus & Sleep Planner – Sleep Debt Calculator

> Focus & Sleep Planner – Sleep Debt Calculator is a paid API for AI agents from focus-sleep-calc.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-29).

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.

## Facts

- Endpoint: GET https://focus-sleep-calc.x402tookit.com/sleep-debt?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/focus-sleep-planner-sleep-debt-calculator-c6425202
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7L8mu9trTC_bPIj0GGLn-

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability focus-sleep-planner-sleep-debt-calculator-c6425202
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Tally nightly sleep hours against a nightly need: net shortfall, short nights, average, and extra hours a night to even out.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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"

… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/focus-sleep-planner-sleep-debt-calculator-c6425202/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from focus-sleep-calc.x402tookit.com](https://www.zero.xyz/host/focus-sleep-calc.x402tookit.com/llms.txt)
