# Agent Memory API – Store Memory

> Agent Memory API – Store Memory is a paid API for AI agents from agent-memory-api-production-f2c4.up.railway.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Persists a key-value memory record for an AI agent with optional namespace isolation, TTL, and metadata.

## Facts

- Endpoint: POST https://agent-memory-api-production-f2c4.up.railway.app/v1/memories
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-memory-api-store-memory-7b9c4032
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oRnX0hftq_uLHi4beVLX8

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 agent-memory-api-store-memory-7b9c4032 -d '<json body>'
```

Example prompt: Save a memory for agent 'assistant-42' with key 'user_preference_theme' and value 'dark_mode' in the 'assistant-42' namespace, and have it expire in 86400 seconds.

## When to prefer this

Choose this endpoint when an AI agent needs to persist state, preferences, or context between sessions with namespace isolation per agent instance. It is ideal when you need optional automatic expiration (TTL) and metadata tagging for future filtering. Prefer it over generic databases when you want a lightweight, agent-native key-value store with per-call micropayment pricing and no setup overhead.

## Known failure modes

- Missing required 'key' or 'value' fields returns a 400 validation error
- Invalid JSON in the value field may cause a parse error
- Namespace conflicts or permission issues may prevent writes
- TTL value of 0 or negative integer may be rejected
- Payment failure (x402) blocks the request before processing
- Network timeouts to the Railway-hosted service cause request failures

## How this service works

Store a persistent key-value memory for an AI agent (namespace-isolated, optional TTL and metadata). Returns the stored memory record as JSON.

## Output

Returns the stored memory record as a JSON object, including the key, value, namespace, metadata, TTL, and any system-generated timestamps or identifiers confirming the write.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "key": {
   "type": "string",
   "description": "Memory identifier"
  },
  "value": {
   "description": "Any JSON value or string"
  },
  "metadata": {
   "type": "object",
   "description": "Arbitrary metadata for filtering"
  },
  "namespace": {
   "type": "string",
   "description": "Isolation scope (e.g. agent ID)"
  },
  "ttl_seconds": {
   "type": "integer",
   "description": "Auto-expire after N seconds"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-memory-api-store-memory-7b9c4032/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-memory-api-production-f2c4.up.railway.app](https://www.zero.xyz/host/agent-memory-api-production-f2c4.up.railway.app/llms.txt)
