Endpoints
GET | /v1/cdn/get?key=... | Read a cached object. Honors If-None-Match and returns 304 when the ETag matches. |
|---|---|---|
POST | /v1/cdn/put | Store an object under a key. Optional cache_control: max-age=.... |
POST | /v1/cdn/purge | Purge a single key. Idempotent. |
GET | /v1/cdn/today | Daily request, hit, miss, byte, and revenue counters. |
POST | /mcp | MCP 2024-11-05 over Streamable-HTTP / JSON-RPC 2.0. |
GET | /health | Service health, cache statistics, and pricing. |
MCP tools
cdn_cache_get
Read by key. Returns body, content type, ETag, age, and freshness. Tier 2.
cdn_cache_put
Store under a key with optional Cache-Control. Tier 0.
cdn_purge
Purge a single entry by key. Tier 0, idempotent.
x402 pricing
| Per request | $0.0002 USDC | Charged on every /v1/cdn/get regardless of hit or miss. |
|---|---|---|
| Per GB egress | $0.05 USDC | Charged on bytes returned in 200 responses. 304 responses do not bill egress. |
| Prepay bundle | $1.00 USDC | Buys an access token; reads draw from the prepaid balance until depletion. |
| Settlement | USDC on Base L2. | |
Quick reference
curl -X POST $HOST/v1/cdn/put \
-H 'content-type: application/json' \
-d '{"key":"agents/card/42","body":{"name":"agent-42"},"cache_control":"max-age=600"}'
curl -i "$HOST/v1/cdn/get?key=agents/card/42" \
-H "X-Hive-Access: hive_..." \
-H 'If-None-Match: "..."'