# Cache Freshness Calculate

> Cache Freshness Calculate is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Calculates remaining HTTP cache freshness from caller-supplied response timing metadata (now, date, age, max-age) and returns a deterministic pass/advisory verdict

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/cache-freshness-calculate
- 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/cache-freshness-calculate-e950dbfd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2t5vkckxC0rpiGZ1LuGeN

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 cache-freshness-calculate-e950dbfd -d '<json body>'
```

Example prompt: Check if a cached HTTP response is still fresh: the current time is epoch 1720000000, the response Date header is epoch 1719990000, the Age header is 500 seconds, and Cache-Control max-age is 3600 seconds.

## When to prefer this

Use this endpoint when you need a deterministic, stateless, auditable calculation of HTTP cache freshness from raw timing metadata — especially in agentic pipelines where you want a versioned, normalized JSON verdict (pass/advisory) before deciding to accept, cache, redirect, or retry a response. Prefer this over custom inline math when you need consistent handling and explicit evidence logging of cache freshness decisions.

## Known failure modes

- Missing required fields (now_epoch, date_epoch, max_age_seconds) result in a validation error
- Negative age_seconds or max_age_seconds may produce advisory or error responses
- Epoch values far in the future or past may be flagged as out-of-bounds
- Payment failure via x402 protocol returns 402 status before processing

## How this service works

Cache Freshness Calculate: Cache Freshness Calculate calculates remaining freshness from response timing metadata from bounded caller-supplied values without an external provider. Call Cache Freshness Calculate before accepting, caching, redirecting, or retrying a caller-supplied web response. Returns normalized web evidence, the computed finding, and an explicit pass or advisory status for Cache Freshness Calculate as versioned deterministic JSON. Price: $0.001 USDC via x402 on Base. First-par…

## Output

Returns versioned deterministic JSON containing normalized web evidence (the input timing values), the computed remaining freshness in seconds, and an explicit pass or advisory status indicating whether the cached response is still considered fresh.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "now_epoch": {
   "type": "integer",
   "description": "Now Epoch supplied to Cache Freshness Calculate; used only for this bounded calculation and processed in memory without retention."
  },
  "date_epoch": {
   "type": "integer",
   "description": "Date Epoch supplied to Cache Freshness Calculate; used only for this bounded calculation and processed in memory without retention."
  },
  "age_seconds": {
   "type": "integer",
   "description": "Age Seconds supplied to Cache Freshness Calculate; used only for this bounded calculation and processed in memory without retention."
  },
  "max_age_seconds": {
   "type": "integer",
   "description": "Max Age Seconds supplied to Cache Freshness Calculate; used only for this bounded calculation and processed in memory without retention."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "fresh": true,
   "remaining_seconds": 200,
   "current_age_seconds": 100
  },
  "schema": "delx/util-cache-freshness-calculate/v1",
  "status": "pass",
  "evidence": {
   "retained": false,
   "input_sha256": "dc06e6971edff08aae19366d5c94d9ebd945645757a1dda826dc3e155bb227dc",
   "external_calls": 0
  },
  "operation": "web_reliability:cache_freshness_calculate"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/cache-freshness-calculate-e950dbfd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
