# agent402.tools Duration Parser & Humanizer

> agent402.tools Duration Parser & Humanizer is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Parses human-readable duration strings like '2h30m' or '1d4h' into seconds, or converts a number of seconds into a human-readable duration string.

## Facts

- Endpoint: POST https://agent402.tools/api/duration
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-duration-parser-humanizer-62857d92
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap___a6LM339b8k_aBWk5Ec1

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 agent402-tools-duration-parser-humanizer-62857d92 -d '<json body>'
```

Example prompt: How many seconds is '1d4h30m'? Parse that duration string for me and give me the total seconds.

## When to prefer this

Use this endpoint when you need to convert human-readable duration strings (e.g. '1d4h', '90s', '2h30m') to seconds for scheduling or computation, or when you need to display a raw seconds count as a readable label. Prefer this over manual parsing logic when the duration format may vary.

## Known failure modes

- Invalid or unrecognized duration string format — returns error indicating unparseable input
- Missing 'value' field in request body — returns validation error
- Negative seconds value may produce unexpected output or error
- Ambiguous or empty input string returns parsing error

## How this service works

Parse a duration like "2h30m" / "1d4h" / "90s" to seconds, or humanize a number of seconds.

## Output

Returns either the total number of seconds corresponding to the parsed duration string, or a human-readable duration string (e.g. '2 hours, 30 minutes') when given a raw seconds value as input.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "value": {
   "description": "Duration string (\"1d2h3m4s\") or number of seconds"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "human": "2h 30m",
  "iso8601": "PT2H30M",
  "seconds": 9000
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-duration-parser-humanizer-62857d92/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
