# P0 Agent Economy Index – KV Store (Write)

> P0 Agent Economy Index – KV Store (Write) is a paid API for AI agents from x402-bazaar-rank.x402-bazaar-rank-worker.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-11-16).

Stores a key-value pair in a wallet-namespaced Cloudflare KV store, accessible only to calls paid by the same wallet

## Facts

- Endpoint: POST https://x402-bazaar-rank.x402-bazaar-rank-worker.workers.dev/kv/put?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/p0-agent-economy-index-kv-store-write-e2779b3a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FZ7P5vKYkPb0sNfLsZ2_f

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 p0-agent-economy-index-kv-store-write-e2779b3a -d '<json body>'
```

Example prompt: Store the key 'session/last-run' with the value '2026-10-19T12:00:00Z' and keep it for 24 hours (86400 seconds) in my wallet-namespaced KV store.

## When to prefer this

Use this endpoint when an AI agent needs lightweight, wallet-scoped persistent storage to carry state between runs, cache intermediate results, or checkpoint a workflow — especially within the x402 micropayment ecosystem where the paying wallet acts as the natural namespace. Prefer it over general-purpose databases when you need zero-config, globally distributed key-value storage with automatic TTL expiry and the data is non-sensitive (not encrypted at rest). Not suitable for secrets, large blobs (>8 KB), or cross-wallet data sharing.

## Known failure modes

- Key exceeds 128 characters or contains invalid characters — rejected with validation error
- Value exceeds 8 KB — rejected with size error
- TTL below 60 or above 7,776,000 seconds — rejected with range error
- Payment not received or insufficient — x402 payment required error returned
- Cloudflare KV eventual consistency delay — key may not be visible globally for up to ~60 seconds after write
- Reading key from a different wallet namespace — access denied, key not found

## How this service works

An open index of the machine-to-machine (agent) economy. x402 routes: ranked discovery over a verified x402 seller set (sellers whose 402 P0 read itself plus registry-verified entries), scored by relevance and evidence of a live 402 challenge, with a receipt naming the snapshot hash and scoring revision; demand figures are P0's own on-chain counts of transfers to the sellers' wallets. /economy routes, for Tempo MPP, Virtuals ACP, Olas, Masumi, ERC-8004 agent registries, Solana agent registries, Base agent contracts and MCP servers (Official MCP Registry): each protocol's published figures (agent or server counts, transactions or payment events; payers and USD volume only where the source publishes them: payers for x402 and Tempo MPP, USD volume for x402 and Virtuals ACP), each with its unit, window and source; units differ, so totals are not summed. L402 listings are not covered.

## Output

Returns a JSON object confirming the write with fields: stored (boolean), key, namespace (the paying wallet address), bytes written, stored_as type (json or string), ttl_seconds, expires_at timestamp, and as_of timestamp of the operation.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "key": {
   "type": "string",
   "pattern": "^[A-Za-z0-9._:/-]{1,128}$",
   "description": "Key, 1-128 characters from A-Z a-z 0-9 . _ : / -"
  },
  "ttl": {
   "type": "integer",
   "default": 2592000,
   "maximum": 7776000,
   "minimum": 60,
   "description": "Seconds to keep the key"
  },
  "value": {
   "type": [
    "string",
    "object",
    "array",
    "number",
    "boolean"
   ],
   "description": "Text, or JSON stored as text (max 8 KB)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "key": "session/last-run",
  "note": "Namespace = the wallet that paid for this call: only calls paid by the same wallet can read these keys. Stored in Cloudflare KV (eventually consistent, visible everywhere within about 60 s), plain text, not encrypted at the application level: do not store secrets. Expired keys disappear.",
  "as_of": "2026-10-19T12:00:00.000Z",
  "bytes": 26,
  "stored": true,
  "namespace": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
  "stored_as": "json",
  "expires_at": "2026-10-20T12:00:00.000Z",
  "ttl_seconds": 86400
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/p0-agent-economy-index-kv-store-write-e2779b3a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-bazaar-rank.x402-bazaar-rank-worker.workers.dev](https://www.zero.xyz/host/x402-bazaar-rank.x402-bazaar-rank-worker.workers.dev/llms.txt)
