{"uid":"cap_pvvLrEcPaWIxaw8pFOygV","slug":"x402-agent-memory-store-key-value-storage-for-ai-agents-f42e4f44","name":"x402 Agent Memory Store — Key-Value Storage for AI Agents","description":"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 }.","url":"https://x402-services-production.up.railway.app/api/memory/set","method":"POST","headers":{},"bodySchema":{"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"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ryCAZd7K3fHw8JaCEgX-t","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Stores arbitrary JSON values under a namespaced key with token-based authentication, providing persistent key-value memory for AI agents.","exampleAgentPrompt":"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'].","exampleUseCases":[{"title":"Persist trading bot watchlist","prompt":"Store my bot's current watchlist under namespace 'tradingbot-v2', key 'watchlist', secret token 'tok_xyz', value ['BTC','ETH','SOL'] so it survives restarts."},{"title":"Save agent session state","prompt":"Write my agent's session context to namespace 'agent-session-42', key 'last_checkpoint', token 'secret99', with the JSON value {'step': 7, 'pending': ['approve','swap']}."},{"title":"Cache DeFi lending positions","prompt":"Persist my current DeFi positions under namespace 'defi-agent', key 'positions', token 'mytoken456', value [{'protocol':'Aave','asset':'USDC','amount':5000}] so I can retrieve them later."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:55:02.744Z","isFirstParty":false}