Cache LRU Trace

Replay size-weighted LRU cache access, including oversize bypasses and evictions, to estimate cache hit and byte-hit counts.

Custom requests cost 0.04 USDC on Base.

Download example JSON · OpenAPI · Source and usage

Pay with a browser wallet · Open example in checkout

POST a JSON request to /cache-lru-trace/v1/check with an x402 V2 client.

Worked example

Request

{
  "capacity_bytes": 10,
  "requests": [
    {
      "key": "a",
      "bytes": 4
    },
    {
      "key": "b",
      "bytes": 6
    },
    {
      "key": "a",
      "bytes": 4
    },
    {
      "key": "c",
      "bytes": 5
    },
    {
      "key": "skip",
      "bytes": 12
    }
  ]
}

Result

{
  "hits": 1,
  "misses": 4,
  "hit_bytes": 4,
  "requested_bytes": 31,
  "evicted": [
    "b"
  ],
  "bypassed": [
    "skip"
  ],
  "ending_bytes": 9,
  "least_to_most_recent": [
    "a",
    "c"
  ]
}

Support catalog maintenance through GitHub Sponsors. Sponsor gptenv · Sponsor Jeremy Carter