# Agent402 ISO-8601 Duration Parser

> Agent402 ISO-8601 Duration Parser is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Parses an ISO-8601 duration string (e.g. P1DT2H30M) into its component parts (days, hours, minutes, etc.) plus a total_seconds value

## Facts

- Endpoint: POST https://agent402.co.uk/v1/utils/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-iso-8601-duration-parser-5b0b478e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_aVlOrNQF64u93pxqwoSP_

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-iso-8601-duration-parser-5b0b478e -d '<json body>'
```

Example prompt: Can you parse the ISO-8601 duration 'P1DT2H30M' and tell me how many total seconds that is, along with the breakdown of days, hours, and minutes?

## When to prefer this

Use this endpoint when an agent needs to programmatically interpret an ISO-8601 duration string — especially for scheduling, countdown logic, or converting calendar-sourced intervals into machine-usable seconds. Prefer it over manual string parsing when accuracy and validation are both required in a single call.

## Known failure modes

- Invalid or malformed ISO-8601 string returns valid: false
- Missing 'duration' field in request body causes a 400-level error
- Ambiguous durations involving months/years may use approximate second counts (e.g. 30-day month)
- Empty string input likely returns valid: false with zeroed components

## How this service works

Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.

## Output

Returns a JSON object with the duration broken into components (days, hours, minutes, and any other applicable fields like years/months), a boolean 'valid' flag indicating whether the input was a valid ISO-8601 duration, and a 'total_seconds' integer representing the full duration in seconds.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "duration": {
   "type": "string",
   "description": "ISO-8601 duration"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "days": 1,
  "hours": 2,
  "valid": true,
  "minutes": 30,
  "total_seconds": 95400
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-iso-8601-duration-parser-5b0b478e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.co.uk](https://www.zero.xyz/host/agent402.co.uk/llms.txt)
