# Redis Key-value store with expiry, counters, and sorted sets. Execute commands over HTTP — no Redis client or TCP connection needed. ## Prerequisites Provision this resource before use. Edge requests without provisioning will error. ### Provision curl -s -X POST https://cohesivity.ai/api/resources/redis \ -H "Authorization: Bearer " ### Delete curl -s -X DELETE https://cohesivity.ai/api/resources/redis \ -H "Authorization: Bearer " **Important:** Provision this resource now, before building or running the application. Provisioning is the agent's job, not the application's. > **Server-side only.** `coh_application_key` is a secret. Call this from your `vercel-hosting` API routes, `cloudflare-workers`, or your own server tier — never from a browser, mobile app, or other client-side code. See the canonical key-secrecy directive in `.cohesivity` for details. ## Edge Usage - **Base URL:** https://cohesivity.ai/edge/redis - **Auth:** `coh_application_key` as the **key** query parameter - **Method:** POST with JSON body `{ "command": "SET", "args": ["key", "value"] }` - **Response:** `{ "result": ... }` ## Supported Commands - **Key-value:** GET, SET, DEL, MGET, MSET, EXISTS, KEYS, TTL, TYPE - **Expiry:** EXPIRE, PEXPIRE, EXPIREAT, PERSIST - **Counters:** INCR, DECR, INCRBY, DECRBY, INCRBYFLOAT - **Sorted sets:** ZADD, ZREM, ZSCORE, ZRANK, ZRANGE, ZREVRANGE, ZRANGEBYSCORE, ZCARD, ZCOUNT, ZINCRBY All other commands are blocked. ## Examples - Set a key: `POST https://cohesivity.ai/edge/redis?key=` with `{ "command": "SET", "args": ["mykey", "myvalue"] }` - Get a key: `{ "command": "GET", "args": ["mykey"] }` → `{ "result": "myvalue" }` - Set with expiry: `{ "command": "SET", "args": ["session", "data"] }` then `{ "command": "EXPIRE", "args": ["session", "3600"] }` - Counter: `{ "command": "INCR", "args": ["visits"] }` → `{ "result": 1 }` - Sorted set: `{ "command": "ZADD", "args": ["leaderboard", "100", "alice", "200", "bob"] }` → `{ "result": 2 }` - Get range: `{ "command": "ZRANGE", "args": ["leaderboard", "0", "-1", "WITHSCORES"] }` → `{ "result": ["alice", "100", "bob", "200"] }` - Multiple keys: `{ "command": "MSET", "args": ["a", "1", "b", "2"] }` → `{ "result": "OK" }` - Get multiple: `{ "command": "MGET", "args": ["a", "b"] }` → `{ "result": ["1", "2"] }` - List keys: `{ "command": "KEYS", "args": ["*"] }` → `{ "result": ["mykey", "session", "visits", ...] }` - Delete: `{ "command": "DEL", "args": ["mykey"] }` → `{ "result": 1 }` ## Launch Rate Limits Ephemeral tenants pause as a whole if any authoritative hard cap below is exceeded. Claimed tiers use account-scoped buckets shared across every project owned by the Cohesivity user; OpenAI, Deepgram, and Exa are fluid-only after tier, rate, and concurrency checks; Deepgram has no fixed monthly usage bucket for claimed tiers. **Ephemeral** - commands: 100000 per ephemeral tenant lifetime before claim or expiry - commands: 120 per minute **Claimed Free** - commands: 600 per minute - commands: 500000 per month **Claimed Plus** - commands: 3000 per minute - commands: 5000000 per month **Claimed Pro** - commands: 15000 per minute - commands: 25000000 per month