# Delx Commerce — Cache Freshness Calculate

> Delx Commerce — Cache Freshness Calculate is a paid API for AI agents from commerce.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Calculates whether a cached resource is still fresh given its age, max-age, and current timestamp, returning remaining freshness seconds.

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/cache-freshness-calculate?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-cache-freshness-calculate-6aeded0c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9BaEvQbEEhfLnvncy9xYS

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 delx-commerce-cache-freshness-calculate-6aeded0c -d '<json body>'
```

Example prompt: I have a cached resource that was fetched at epoch 1700000000, is currently 100 seconds old, and has a max-age of 300 seconds — the current time is epoch 1700000100. Is it still fresh, and how many seconds does it have left?

## When to prefer this

Use this endpoint when you need a deterministic, pay-per-call, stateless computation of HTTP cache freshness with cryptographic evidence of non-retention. Prefer it over rolling your own freshness logic when you need verifiable, auditable cache evaluation with no data stored server-side, especially in agent pipelines that require provable computation.

## Known failure modes

- Missing required fields (now_epoch, date_epoch, age_seconds, max_age_seconds) result in validation errors
- Non-integer epoch or age values cause schema rejection
- Payment failure via x402 protocol blocks request
- Negative age_seconds or max_age_seconds may produce unexpected results

## How this service works

Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.

## Output

Returns a JSON object indicating whether the cache entry is fresh (true/false), how many seconds of freshness remain, and the current computed age in seconds. Also includes an evidence block with input hash, no external calls made, and confirmation that no data is retained.

## 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/delx-commerce-cache-freshness-calculate-6aeded0c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from commerce.delx.ai](https://www.zero.xyz/host/commerce.delx.ai/llms.txt)
