{"uid":"cap_9BaEvQbEEhfLnvncy9xYS","slug":"delx-commerce-cache-freshness-calculate-6aeded0c","name":"Delx Commerce — Cache Freshness Calculate","description":"Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.","url":"https://commerce.delx.ai/api/v1/x402/cache-freshness-calculate?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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."}}},"responseSchema":{"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"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_TEXsWwpNY07zEPtGmp1lh","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates whether a cached resource is still fresh given its age, max-age, and current timestamp, returning remaining freshness seconds.","exampleAgentPrompt":"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?","exampleUseCases":[{"title":"CDN cache freshness check","prompt":"I'm serving a cached API response that's 100 seconds old with a max-age of 300. The current epoch is 1700000100 and the resource date epoch is 1700000000. Is it still fresh and how much time is left before it expires?"},{"title":"Stale cache detection before refresh","prompt":"Before re-fetching a resource, can you check if it's still fresh? It has an age of 250 seconds and a max-age of 200 seconds, now epoch is 1700001000 and date epoch is 1699999900."},{"title":"Cache TTL validation in agent pipeline","prompt":"My agent just pulled a cached result with an age of 50 seconds and max-age of 600 seconds. Current epoch is 1700005000, date epoch is 1700004950. Tell me if it's still good to use and how many seconds remain."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T00:53:39.729Z","isFirstParty":false,"canonicalSlug":"delx-commerce-cache-freshness-calculate-6aeded0c"}