# x402 Agent Memory Store — Key-Value Storage for AI Agents

> x402 Agent Memory Store — Key-Value Storage for AI Agents is a paid API for AI agents from x402-services-production.up.railway.app, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Stores arbitrary JSON values under a namespaced key with token-based authentication, providing persistent key-value memory for AI agents.

## Facts

- Endpoint: POST https://x402-services-production.up.railway.app/api/memory/set
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-agent-memory-store-key-value-storage-for-ai-agents-f42e4f44
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pvvLrEcPaWIxaw8pFOygV

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 x402-agent-memory-store-key-value-storage-for-ai-agents-f42e4f44 -d '<json body>'
```

Example prompt: Save my trading bot's last-seen token list under namespace 'mybot-prod', key 'watched_tokens', with secret token 'abc123', and store the value ['SOL','ETH','ARB'].

## When to prefer this

Use this endpoint when an AI agent needs lightweight, pay-per-call persistent key-value storage without managing accounts, API keys, or subscriptions. Ideal for trading or onchain agents that need to checkpoint state, cache intermediate results, or share data across sessions. Prefer this over full databases when low-friction, token-secured namespaced storage is sufficient and you want to pay in stablecoins per call.

## Known failure modes

- Missing required fields (ns, key, token, or value) returns a 400 error
- Value exceeds 16KB size limit returns a 400 or 413 error
- Wrong token on subsequent writes returns a 401/403 authentication error
- Namespace or key exceeds character limits (ns: 1-128 chars) returns a validation error
- Payment not attached or insufficient returns a 402 error

## How this service works

Agent Memory: durable key-value storage that survives between agent runs. Write a JSON value (16KB max) under a key. First write to a namespace claims it with your secret token. Send { ns, token, key, value }.

## Output

A confirmation response indicating whether the key-value pair was successfully written to the agent memory store. On first write the token is established; subsequent writes require the same token to authenticate.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "key",
  "ns",
  "token",
  "value"
 ],
 "properties": {
  "ns": {
   "type": "string",
   "description": "Your namespace (1-128 chars)"
  },
  "key": {
   "type": "string",
   "description": "Key to store under"
  },
  "token": {
   "type": "string",
   "description": "Your secret token; set on first write, required after"
  },
  "value": {
   "type": "object",
   "description": "Any JSON value, 16KB max"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-agent-memory-store-key-value-storage-for-ai-agents-f42e4f44/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-services-production.up.railway.app](https://www.zero.xyz/host/x402-services-production.up.railway.app/llms.txt)
