Agent memory API with no account: memory
Agent memory API, the plain kind: PUT https://agentic402.dev/v1/memory/{key} stores the request body under that key for $0.005 per write. The first write returns a token; any run that sends the token can read, list and delete for free. Values can be up to 1 MB, and a space is kept until 30 days after its last write.
There is no signup, no API key and no model in the loop: you get back exactly the bytes you stored.
# first write: no token yet, so a new space is created ($0.005) PUT /v1/memory/notes/plan.md Content-Type: text/markdown 1. Read the three pricing pages 2. Compare plans 3. Report 201 {"key": "notes/plan.md", "size": 60, "token": "<64 hex characters>"} # any later run, with the token (free) GET /v1/memory/notes/plan.md Authorization: Bearer <token> 200 1. Read the three pricing pages 2. Compare plans 3. Report
Two different things are sold as agent memory
Search for an agent memory API and you'll find two kinds of product under one name. The first kind reads conversations and decides what to remember. Cloudflare's Agent Memory documentation lists "Automatic extraction of facts, events, instructions, and tasks from conversations", and Google's Memory Bank quickstart generates memories from Agent Platform Sessions. These are recall systems: you hand over text and ask questions later.
The second kind is storage. You choose the key, you choose what to keep, and a read returns those exact bytes. agentic402 memory is this kind. Nothing is summarised, embedded or rewritten, which makes it a good fit for things an agent must get back word for word: a plan, a progress file, a list of URLs already visited, a fetched page, a signed statement.
The two also differ in setup. Each of the recall services above sits inside a cloud account, as the comparison below shows. agentic402 memory has no account at all: payment opens the space and the token is the only key.
| Service | What it keeps | Access |
|---|---|---|
| Cloudflare Agent Memory | Facts, events, instructions and tasks it extracts from conversations | "All requests require an API token with the appropriate Agent Memory permissions." |
| Google Memory Bank | Memories generated from sessions, grouped by scope | Google Cloud setup first: "you must first follow the steps in" its setup guide |
| Databricks memory store API | "Free-form memory text content" | OAuth token from the Databricks CLI. The docs say this legacy API "will be turned down soon" |
| agentic402 memory | Any value you send, byte for byte, under your key | A token returned by the first paid write. No account. |
The first write and the token
A write without an Authorization header creates a new space and answers 201 with a fresh 64-character hex token. Keep it. A write with Authorization: Bearer <token> goes into that existing space and answers 200 without repeating the token. Each successful write costs $0.005, whether it creates a key or overwrites one.
The token is the space. Internally, each space is a Cloudflare Durable Object named after the SHA-256 hash of the token, so agentic402 stores the hash, never the token itself. That has one hard consequence: a lost token can't be recovered or reset, by you or by us. Store it where the agent keeps its other secrets.
Bad input is rejected before payment. A key with characters outside the allowed set gets 400, a malformed or unknown token gets 401, and a value over 1 MB gets 413, all without a 402 and without cost.
Reading, listing and deleting are free
Three operations need the token and cost nothing. GET /v1/memory/{key} returns the stored value with its content type. GET /v1/memory?prefix=notes/ lists keys that start with the prefix, each with its size in bytes and updated_at time, sorted by key, up to 1,000 per call. DELETE /v1/memory/{key} removes one key and answers 204.
A missing key returns 404, and a missing or unknown token returns 401. Free calls still count toward the limit of 60 API requests a minute per IP address.
Reads are strongly consistent. Every request for a space goes to the same Durable Object, so a read straight after a write sees the new value. Eventually consistent key-value stores can serve the old value for a while after a write, which breaks an agent that writes its progress and immediately reads it back to decide what to do next.
A progress file that survives restarts
The most common use is the simplest one: an agent that may be stopped at any point keeps a small JSON file saying how far it got. At the start of each run it reads the file; a 404 means this is the first run. After each finished step it writes the file again. A crash, a timeout or a deliberate stop then costs at most one step of repeated work.
const H = { Authorization: `Bearer ${TOKEN}` };
const base = "https://agentic402.dev/v1/memory/state/progress.json";
const r = await fetch(base, { headers: H }); // free
const state = r.status === 404 ? { done: [] } : await r.json();
for (const step of plan.filter((s) => !state.done.includes(s))) {
await run(step);
state.done.push(step);
await payFetch(base, { method: "PUT", // $0.005
headers: { ...H, "Content-Type": "application/json" },
body: JSON.stringify(state) });
}
The reads go through plain fetch because they're free; only the write needs the x402-paying client. A ten-step task costs ten writes, $0.05, however many times the agent restarts along the way.
How much fits in a space
A space holds 50 MB across at most 10,000 keys. For text, that is a lot. In our token study of 12 web pages, the median page converted to about 18,800 characters of Markdown, roughly 18 KB for mostly English text. At that size a single space could hold more than 2,600 pages before reaching 50 MB. The largest page in the study, the Wikipedia article on large language models, came to about 188,000 characters, well inside the 1 MB value limit.
Binary data uses the space faster. A 1 MB PDF stored as-is takes 1 MB. Converting it to Markdown with fetch first means you store only its text. If a job outgrows one space, open a second one with a new token and keep the two tokens together.
When memory is the wrong choice
memory is meant for an agent's working state and the material it collects, not for an application's main database. It has no queries beyond key and prefix, no transactions across keys, no backups and no way to keep data past 30 days without writes. If several services need to query the same records, or the data must outlive a project, use a database you control.
Local files are the other option, and they're free. They work while the agent runs in one place, but they vanish with a container and can't be read by a second agent on another machine. memory sits between the two: no setup, and the data is reachable from anywhere that has the token.
Designing keys
Keys are 1 to 256 characters from A-Z a-z 0-9 . _ - /. The slash has no special meaning to the store, but it makes prefix listing useful: write sources/stripe-pricing and sources/vercel-pricing, then list sources/ to see everything the agent has read so far.
URLs can't be used as keys directly, because :, ? and = aren't allowed. Hash the URL with SHA-256 and use the hex digest (64 characters), or turn it into a slug. Hashing is safer: two URLs can easily turn into the same slug, while two URLs with the same SHA-256 digest are, in practice, never seen.
A layout that works for most agents: state/progress.json for where the task stands, notes/ for working notes, sources/<sha256 of url> for fetched pages, and proofs/ for signed statements from attest. The recipe for reading a page once and keeping it uses exactly this layout with fetch.
Limits per value and per space
The limits below are set in the memory code as of 3 December 2026.
| Limit | Value | Past it |
|---|---|---|
| Key | 1–256 characters, A-Z a-z 0-9 . _ - / | 400 before payment |
| Value | 1 MB | 413 before payment |
| Space size | 50 MB in total | 413 "space is full (50 MB)", not charged |
| Keys per space | 10,000 | 413 "space is full (10,000 keys)", not charged |
| Listing | 1,000 keys per call | Use a narrower prefix |
| Retention | 30 days after the last write | Whole space deleted |
Overwriting a key replaces its size in the total rather than adding to it, so rewriting a 1 MB progress file a hundred times still uses 1 MB.
Content types, and why HTML comes back as bytes
The Content-Type you send with a write is stored and returned on reads, but only from a short list: application/json, text/plain, text/markdown, text/csv and application/octet-stream. Anything else, including text/html and image/svg+xml, is stored as application/octet-stream.
The reason is safety for everyone using the domain. If memory served stored HTML as a web page from agentic402.dev, anyone could host a phishing page on it for half a cent. Reads also carry a sandbox Content Security Policy and the X-Content-Untrusted: true header. Your data is unchanged; only the label a browser sees is restricted.
Retention: 30 days from the last write
Every write resets a 30-day timer on the space. When it runs out, the whole space is deleted: every key, every value. Reads don't reset the timer, so a space the agent only reads from will still expire 30 days after it was last written.
To keep a long-lived space, write something small to it at least once a month, for example the current date to state/heartbeat. That costs $0.005 a month. If the agent won't otherwise be running, a wake job can start it once a month so it can make that write.
One more edge case: a space exists only while it holds at least one key. Delete every key and the token becomes unknown, so later writes with it get 401 and a new write without a token starts a new space. Keep one key you never delete.
Sharing memory between agents
Two agents share a space by sharing its token. A research agent can write sources/ while a writing agent lists and reads them; a parent agent can hand the token to a sub-agent and read its results afterwards. There are no per-key permissions: whoever has the token can read, write and delete everything in the space. A space's token can't be changed either, so to cut off an agent you shared it with, copy the keys you need into a new space and stop using the old token.
Writes to the same key are last-writer-wins. There is no locking or compare-and-swap, so two agents updating one shared file at once can overwrite each other. Give each agent its own keys, such as results/agent-a.json and results/agent-b.json, and merge them when reading.
Values are untrusted when read back
The store returns whatever was written. If an agent saved a fetched web page or an inbox item, the text inside is still third-party text and can contain prompt injection. The same applies to a space shared with an agent you don't control. Reads carry the untrusted-content header, and over MCP the result includes "content_is_untrusted": true. Limits and untrusted content across all tools has the details.
memory over MCP
On the agentic402 MCP server the same store appears as four tools. memory_put costs $0.005 and takes a key, a text value, an optional content_type (default text/plain) and an optional token; without one it creates a space and returns the token. memory_get, memory_list and memory_delete are free. Over MCP, values are text; binary data needs the HTTP API.
Payment works the same way on both: a write is paid only when it succeeds. How agentic402 charges for a call explains verify-then-settle.
Questions about storage for agents
- Can I search memory by meaning, like a vector database?
- No. memory finds values by exact key or by key prefix. If you need semantic recall, store embeddings yourself as values or use a recall service. Memory is the place for things you must get back exactly.
- Can I recover a lost token?
- No. Only the token's SHA-256 hash is stored, and a hash can't be turned back into the token. The space stays until 30 days after its last write and is then deleted.
- Can an agent store images or other binary files?
- Yes, over HTTP. Send the raw bytes as the PUT body; any value up to 1 MB is accepted. Types outside the short list, such as
image/png, are stored and returned asapplication/octet-stream, so the agent should remember what the bytes are, for example in the key name. Over MCP, values are text only. - How is memory different from fetch's cache?
- fetch serves a shared cached copy of a public page to any caller while the copy is younger than their
max_age(a day by default), and you can't choose what it holds. memory is a private space that only token holders can read, holding whatever you choose to write, for 30 days after the last write. - Is there a charge for storage over time?
- No. You pay $0.005 per write and nothing per month. Spaces are limited to 50 MB and expire 30 days after the last write instead.
Cite this page: agentic402, "Agent memory API with no account: memory", https://agentic402.dev/tools/memory/, published 3 December 2026. Limits are taken from src/memory.js and src/index.js as of that date; competitor descriptions are quoted from their documentation as read that day.