# Relative Time Formatter

> Relative Time Formatter is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.0022/call, status unknown (last checked 2026-09-13).

Formats a datetime as a human-readable relative time string (e.g. '3 hours ago', 'in 2 days') relative to now or a specified base time.

## Facts

- Endpoint: GET https://api.x402node.dev/time/format-relative
- Price: $0.0022/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-x402node-dev-b5f9f935
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_N8UCEU2Hh0DtM8M4mxt78

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 api-x402node-dev-b5f9f935
```

Example prompt: Format this timestamp as a relative human-readable string like '3 hours ago' or 'in 2 days': the datetime is 2025-06-10T08:30:00Z, using now as the base.

## When to prefer this

Use this endpoint when you need to display timestamps in a social-media-friendly, human-readable relative format (e.g. blog posts, activity feeds, comment timestamps) and want a simple POST-based utility without building your own date arithmetic.

## Known failure modes

- Invalid datetime format returns a 400 error
- Missing required datetime field returns validation error
- Future or past dates with extreme ranges may produce edge-case labels
- Malformed base datetime causes fallback to current time or error

## How this service works

Relative time formatter, time ago, X minutes ago, in 2 hours, human readable time, fuzzy time, relative datetime, social media timestamps. Format a datetime as relative to now or another base (e.g. '3 hours ago', 'in 2 days'). Accepts payment on Base or Solana — either network works.

## Output

A human-readable relative time string such as '3 hours ago', 'in 2 days', 'just now', or '5 minutes ago', representing the input datetime relative to now or a specified base time.

## 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",
     "properties": {
      "base": {
       "type": "string",
       "description": "Base (optional)"
      },
      "time": {
       "type": "string",
       "description": "Time (optional)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-x402node-dev-b5f9f935/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402node.dev](https://www.zero.xyz/host/api.x402node.dev/llms.txt)
