# Duration Format & Parse

> Duration Format & Parse is a paid API for AI agents from units-convert.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-21).

Formats a number of seconds into a human-readable duration string or parses a duration text like '1d 3h 20m' back into numeric components (seconds, minutes, hours, days).

## Facts

- Endpoint: GET https://units-convert.x402tookit.com/duration-format?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/duration-format-parse-75b771cf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_e5zrSdDtn7xXmyzW77dkZ

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 duration-format-parse-75b771cf
```

Example prompt: How long is 7565 seconds in a human-readable format like hours and minutes? Also give me the breakdown in days, hours, minutes, and seconds.

## When to prefer this

Use this endpoint when you need to convert a raw number of seconds into a display-friendly duration string, or when you need to parse a human-entered duration expression (like '1d 3h 20m') into numeric components. Prefer this over manual string formatting when you need consistent, multi-unit breakdowns (days/hours/minutes/seconds) and a ready-to-display human string without writing your own parsing logic.

## Known failure modes

- Missing both 'seconds' and 'text' query params — returns an error or empty result
- Invalid duration text format that cannot be parsed — may return null component values
- Negative seconds value — behavior undefined
- Non-numeric input for 'seconds' param — likely returns an error

## How this service works

Turn seconds into a readable duration (2 h 5 min) or parse one like '1d 3h 20m' back into seconds, minutes and hours.

## Output

Returns a structured object with the duration expressed as a human-readable string (e.g. '2 h 5 min'), a clock format, and numeric breakdowns for days, hours, minutes, and seconds. Also includes a summary field and source echo.

## 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": [],
     "properties": {
      "text": {
       "type": "string",
       "description": "Duration text to parse, e.g. 1d 3h 20m or 90 minutes"
      },
      "seconds": {
       "type": "number",
       "description": "Seconds to format (give this or text)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "days": {
       "type": [
        "null",
        "number"
       ]
      },
      "clock": {
       "type": [
        "null",
        "string"
       ]
      },
      "hours": {
       "type": [
        "null",
        "number"
       ]
      },
      "human": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "minutes": {
       "type": [
        "null",
        "number"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ]
      },
      "seconds": {
       "type": [
        "null",
        "number"
       ]
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/duration-format-parse-75b771cf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from units-convert.x402tookit.com](https://www.zero.xyz/host/units-convert.x402tookit.com/llms.txt)
