api reference · v1
API reference
Every operation is a plain GET. The token rides in the path, the payload rides in the query — no POST body, no SDK, no auth headers. If a client can fetch a URL, it can save state. A REST mirror exists for clients that can do more.
Base URL: https://<host>/v1 — unauthenticated GET /v1 returns {"ok":true,"service":"universal-save","version":1}. OPTIONS works on every route; HEAD only on read routes (g · l · h · kv reads).
quickstart
Zero to saved in three fetches
Mint a token
Sign in, open tokens, pick a scope. The plaintext is shown exactly once — copy it into your agent's config.
Write with GET
GET /v1/s/{token}/{key}?v={value} — the request is the write. No body, no headers.
Read it back
GET /v1/g/{token}/{key} returns the value with its version and metadata.
reference
GET-write operations
# set — --data-urlencode handles the JSON
curl -G "https://<host>/v1/s/us_rw_…/plan" --data-urlencode 'v={"step":1}'
# set via path segment
curl "https://<host>/v1/s/us_w_…/status/done"
# append to a list
curl -G "https://<host>/v1/a/us_w_…/log" --data-urlencode 'v=step 1 done'
# read / list / history / delete
curl "https://<host>/v1/g/us_r_…/plan"
curl "https://<host>/v1/l/us_r_…?prefix=agent/&ns=research"
curl "https://<host>/v1/h/us_r_…/plan"
curl "https://<host>/v1/d/us_rw_…/plan"On non-GET methods the path ops also accept the value as the request body. Keys may contain / — multi-segment paths are one key when ?v= is present.
reference
REST mirror
Same internals for clients that can send headers and bodies: token goes in Authorization: Bearer, values go in the request body — up to 512KB.
# REST auth uses the Authorization header instead of the URL path
curl -X PUT "https://<host>/v1/kv/plan" \
-H "Authorization: Bearer us_rw_…" \
-d '{"step":1}'
curl "https://<host>/v1/kv/plan?ns=research" -H "Authorization: Bearer us_r_…"
curl "https://<host>/v1/kv?prefix=agent/&ns=research" -H "Authorization: Bearer us_r_…"
curl "https://<host>/v1/kv/plan/history" -H "Authorization: Bearer us_r_…"
curl -X POST "https://<host>/v1/kv/log/append" -H "Authorization: Bearer us_rw_…" -d 'step 2 done'
curl -X DELETE "https://<host>/v1/kv/plan" -H "Authorization: Bearer us_rw_…"before you connect
Agent compatibility
Your agent needs a tool that can make HTTP requests. A chat’s web-page reader may enforce crawler restrictions or lack the ability to call an API. Sharing a documentation link alone does not add that capability.
If a chat reports that it cannot fetch the page, paste the instructions below. It still needs fetch, curl, or an HTTP integration to save anything. Treat an access error as a blocked test.
Python urllib clients on the workers.dev address must send a descriptive User-Agent, such as UniversalSave/1.0.
no account needed
Ephemeral mode
GET /v1/new mints a self-service us_e_… token — no sign-up, no human. An agent can bootstrap itself mid-task:
# mint — no account, one GET
curl "https://<host>/v1/new"
# → {"ok":true,"token":"us_e_…","data_ttl_seconds":900,"encrypted":true,…}
# use it exactly like a normal token
curl "https://<host>/v1/s/us_e_…/scratch?v=partial%20result"
curl "https://<host>/v1/g/us_e_…/scratch"
# every write auto-expires 15 min later; values are AES-256-GCM encrypted at restEncrypted at rest. The token is the encryption key — values are AES-256-GCM encrypted server-side with a key derived from it (only the token's hash is stored). Reading the database shows ciphertext, never plaintext.
Self-destructing. Every write is force-expired 900s later — &ttl= can shorten but never extend it. Rewriting a key renews the window.
Bounded. 100 writes + 500 reads per token per day, 30/min burst, 8KB values, 10 mints per IP per hour. The token itself dies after 24h.
Need it to last? Create an account — dashboard tokens have no forced expiry and your data is browsable in the UI.
reference
Query parameters
concepts
How the pieces fit
Tokens & scopes
Tokens look like us_r_…, us_w_…, us_rw_… — read, write, or read-write, with 24 random characters after the prefix. They're stored as SHA-256 hashes, shown once at creation, and revocable in the dashboard. A write token can't read; a read token can't write.
Namespaces
Keys are unique per (account, namespace, key). Pass &ns=research to isolate agents or projects — a token can also be minted with a default namespace. ≤64 chars, [A-Za-z0-9._~-].
Versioning & history
Every write bumps the version and appends to history. GET /v1/h/… returns the newest 50 versions with the agent that wrote each — enough to diff or restore a value by re-writing it.
TTL
&ttl=3600 expires the key in that many seconds. Expired keys behave as missing everywhere except /v1/h (history survives expiry) and are purged on read — good for scratch state and locks.
Idempotency & dedupe
&id=my-key stores the response for 24h and replays it on repeats (X-Idempotent-Replay: true) — safe retries for flaky agents. Separately, an identical write (same token, ns, key, op, value) inside 60s is deduped (X-Dedupe: true) — no new version.
Chunked writes
Values too big for one URL? Send parts: ?part=1&of=3&upload=u1 — any order, each ≤12KB. Non-final parts return 202 with the parts received; the last part assembles and commits the full value (≤512KB).
Size & key limits
12KB per value via GET (the Workers URL cap is ~16KB), 512KB via REST PUT or an assembled upload. Keys ≤256 chars, [A-Za-z0-9._~/-], no ... Agent tags ≤64 chars.
Rate limits
300 writes/day and 1,000 reads/day per token (UTC day), a shared 60-requests/minute burst bucket, a 1,200 writes/day ceiling across all of a user's tokens, and a 240/min per-IP ceiling that runs before auth. Over the limit → 429 with Retry-After. Every request counts, even failed ones. Dashboard accounts can hold ≤25 tokens.
URLs leak — treat them as credentials
A GET-write URL is a bearer credential plus a payload. It lands in server logs, CDN and proxy logs, browser history, monitoring tools — anywhere URLs get recorded. Never save secrets. No API keys, no credentials, no personal data you can't afford to see in a log file.
Rotate tokens on a schedule, and revoke immediately on suspicion — one click in the dashboard. Prefer us_w_… write-only tokens for agents and us_r_… read-only tokens for dashboards and readers, so a leaked link can't be used both ways. Every response carries Cache-Control: no-store, Referrer-Policy: no-referrer, and X-Robots-Tag: noindex — but nothing beats not putting sensitive data in a URL.
reference
Response shapes
write — s · a · d
{"ok":true,"v":1,"key":"plan","ns":"default"}read — g
{
"ok": true, "key": "plan", "ns": "default",
"value": {"step": 1, "status": "researching"},
"type_hint": "json", "version": 1, "size": 32,
"created_at": 1758220800, "updated_at": 1758220800,
"ttl_expires_at": null, "agent": "researcher"
}list — l
{"ok":true,"ns":"default","keys":[{"key":"plan","version":1,"type_hint":"json","size":32,"updated_at":1758220800,"ttl_expires_at":null,"agent":"researcher"}]}history — h
{"ok":true,"key":"plan","ns":"default","versions":[{"version":2,"value":{"step":2},"type_hint":"json","agent":"researcher","created_at":1758224400},{"version":1,"value":{"step":1},"type_hint":"json","agent":null,"created_at":1758220800}]}delete — d
{"ok":true,"deleted":true,"key":"plan","ns":"default"}chunk accepted — 202
{"ok":true,"accepted":true,"have":[1,2]} // 202 — waiting on part 3error — any op
{"ok":false,"error":"not_found","message":"key not found"} // 404?fmt=text
# ?fmt=text — text/plain bodies write ok v=1 get researching (strings unquoted; JSON stays compact JSON) delete ok error error not_found: key not found
Idempotent replays add X-Idempotent-Replay: true; deduped writes add X-Dedupe: true. Every response carries no-store, no-referrer, noindex, and open CORS headers.
reference