{"uid":"cap_Y2ZOvgouUars6Dmg8xk-I","slug":"2s-agent-memory-put-da6528cc","name":"2s Agent Memory Put","description":"The (most) everything API: one pay-per-call API giving AI agents ground-truth data across hundreds of endpoints — public records, finance, crypto, security, legal, health, geo, and EDI. USDC via x402, no signup, no API keys.","url":"https://2s.io/api/agent/memory/put","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"key":{"type":"string","description":"1-200 chars from [A-Za-z0-9._/-]."},"value":{"description":"Arbitrary JSON (object/array/scalar). Max 64 KiB serialized."},"ttlSeconds":{"type":"integer","description":"Optional TTL 1..31536000. Omit for no expiry."}}},"responseSchema":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","required":["ok","items","total","source"],"properties":{"ok":{"type":"boolean"},"items":{"type":"array","items":{"type":"object","required":["key","etag","createdAt","expiresAt","sizeBytes","updatedAt"],"properties":{"key":{"type":"string"},"etag":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"sizeBytes":{"type":"number"},"updatedAt":{"type":"string"}}}},"total":{"type":"number"},"source":{"type":"object","required":["url","license","provider"],"properties":{"url":{"type":"string"},"license":{"type":"string"},"provider":{"type":"string"}}}}},"meta":{"type":"object","required":["cost","caller","version","endpoint","settlement"],"properties":{"cost":{"type":"object","required":["usd","tier"],"properties":{"usd":{"type":"number"},"tier":{"type":"number"}}},"caller":{"type":"string"},"version":{"type":"null"},"endpoint":{"type":"string"},"settlement":{"type":"object","required":["txHash","network","success"],"properties":{"txHash":{"type":"string"},"network":{"type":"string"},"success":{"type":"boolean"}}}}}}},"example":{"request":{"key":"test-memory-entry","value":{"message":"Hello from QA test","timestamp":"2024-01-15T10:30:00Z"},"ttlSeconds":3600},"response":{"data":{"ok":true,"items":[{"key":"test-memory-entry","etag":"36aa4caaaa27e350","createdAt":"2026-06-12T05:07:54Z","expiresAt":"2026-06-18T07:24:36Z","sizeBytes":67,"updatedAt":"2026-06-18T06:24:36Z"}],"total":1,"source":{"url":"https://2s.io","license":"No upstream data license","provider":"2s.io agent primitives"}},"meta":{"cost":{"usd":0.0012,"tier":0},"caller":"x402","version":null,"endpoint":"agent.memory.put","settlement":{"txHash":"0xae1bd365e702d25d7d27e3191108a9861e5d11392da3911d7236c28a96f5b8b2","network":"eip155:8453","success":true}}}},"exampleRequest":{"key":"test-memory-entry","value":{"message":"Hello from QA test","timestamp":"2024-01-15T10:30:00Z"},"ttlSeconds":3600},"tags":["x402"],"displayCostAmount":"0.0012","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":1,"rating":{"score":"0.00","successRate":"0.00","reviews":1,"stars":null,"state":"rated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.0012/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0012","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0012","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_H4JYXYHHfCgAozqRIIlDI","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0012","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Stores or updates a key-value pair in persistent agent memory with optional TTL, returning the stored item's metadata.","exampleAgentPrompt":"Remember the value {\"status\":\"active\",\"score\":42} under the key 'projects/2026/q1' in agent memory — keep it for 7 days (604800 seconds).","exampleUseCases":null,"resultDescription":"Returns a JSON object with ok:true and an items array containing the stored entry's key, etag, createdAt, updatedAt, expiresAt, and sizeBytes. Confirms successful write.","failureModes":["Key contains invalid characters (outside A-Za-z0-9._/-) — validation error returned","Value exceeds 64 KiB serialized — payload too large error","TTL outside range 1..31536000 — invalid parameter error","Payment fails or insufficient USDC balance — 402 Payment Required","Key not provided — missing required field error"],"whenToPreferThis":"Use this endpoint when an AI agent needs to persist arbitrary JSON state between sessions or tool calls without signing up for a dedicated storage service. Ideal for lightweight stateful memory where pay-per-use pricing is preferred over monthly storage subscriptions, and when the agent already operates within the 2s.io x402 payment ecosystem.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":3,"lastUsedAt":"2026-07-18T00:20:39.139Z","lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T07:16:09.112Z","isFirstParty":false}