KV / Cache
Get / Set / Delete
Section titled “Get / Set / Delete”# Set with TTLcurl -X PUT https://magnusdb.dev/api/kv/session:abc \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"value": "active", "ttl": 3600}'
# Getcurl https://magnusdb.dev/api/kv/session:abc \ -H "Authorization: Bearer YOUR_API_KEY"
# Deletecurl -X DELETE https://magnusdb.dev/api/kv/session:abc \ -H "Authorization: Bearer YOUR_API_KEY"Redis commands
Section titled “Redis commands”curl -X POST https://magnusdb.dev/api/kv/command \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command": "INCR", "args": ["page:views"]}'Pipeline (sequential)
Section titled “Pipeline (sequential)”curl -X POST https://magnusdb.dev/api/kv/pipeline \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "commands": [ {"command": "SET", "args": ["lock:job1", "1", "EX", "30"]}, {"command": "GET", "args": ["lock:job1"]} ] }'Pipeline commands run sequentially — each result is available before the next command executes.
Simple operations route to Cloudflare KV. Advanced commands (sorted sets, HyperLogLog, streams, pub/sub) route to Upstash Redis when configured.