Skip to content
中文

Upstash-compatible API

Upstash Redis REST compatibility face of a key-value database (kind kv): existing Redis REST clients, including @upstash/redis, work against a database of this platform by changing only the URL and the token. Base URL: https://api.deepraxis.com/redis/&lt;database_id>, where database_id is the id (db_…) of a database created with kind kv; the token is a Praxis API key sent as Authorization: Bearer <key>, never an Upstash token. Send one command as a JSON array to POST /redis/<database_id>, a batch to /pipeline, a transaction to /multi-exec. The path form also works: GET or POST /redis/<database_id>/<command>/<arg>/<arg>… names the command in the path, and for POST the request body becomes the last argument. With the header Upstash-Encoding: base64 (which @upstash/redis sends by default) every string in a reply is base64-encoded; without it strings come back as plain text. Unlike Upstash, the platform serves one Redis 7 command set: no Lua scripting (EVAL), blocking commands, Pub/Sub or Streams; there is no Upstash management API, no global replication and no per-database token (the Praxis API key is the credential). Limits: a value and a request body are at most 1 MiB, a key at most 1 KiB, a pipeline or transaction at most 1000 commands, one reply at most 8 MiB (above that the reply is ERR reply exceeds 8 MiB; read in ranges with SCAN, HSCAN, LRANGE or ZRANGE), and a database at most 1 GiB. A credential that is read-only for the database may run read commands only; a write returns 403 NOPERM this credential is read-only for <database_id>. A table database (kind table) answers 400 ERR database <id> is not a key-value database, and an unknown id answers 404 ERR database not found. Errors have the Upstash shape: a JSON object with a single field error that holds the Redis error text. To manage keys with typed JSON instead of Redis commands, use the keys and commands operations of the Database API.

Read and write a key-value database with the Upstash Redis REST protocol and the official @upstash/redis client.

Database API →

Base URL

https://api.deepraxis.com/redis/{database_id}

Part Meaning
{database_id} ID returned when a key-value database is created; each database has its own URL.
Token A Praxis API key sent as Authorization: Bearer; not an Upstash token.
import { Redis } from "@upstash/redis";
const redis = new Redis({
url: `https://api.deepraxis.com/redis/${process.env.DATABASE_ID}`,
token: process.env.PRAXIS_API_KEY,
});

Paths and bodies

Path Body
POST /redis/{database_id} One command as a string array, for example ["SET","k","v"]
POST /redis/{database_id}/pipeline An array of command arrays; one failing command does not affect the others
POST /redis/{database_id}/multi-exec The same, run as one transaction; if any command cannot be parsed the whole call answers 400 EXECABORT
GET|POST /redis/{database_id}/{command}/{arg}/{arg}… The command is named in the path; for POST the body is the last argument

With the header Upstash-Encoding: base64 (sent by @upstash/redis by default) every string in a reply is base64-encoded; numbers and null stay as they are and error text is never encoded.

Differences from Upstash

  • No Lua scripting (EVAL), blocking commands, Pub/Sub or Streams.
  • No Upstash management API, global replication or per-database token; the credential is a Praxis API key.
  • A table database answers 400 ERR database <id> is not a key-value database; an unknown id answers 404 ERR database not found.
  • A write with a read-only credential answers 403 NOPERM this credential is read-only for <id>.

Limits

Limit Maximum
Key 1 KiB
One value 1 MiB
One request body 1 MiB
Commands per pipeline or transaction 1000
One reply 8 MiB; above it the reply is ERR reply exceeds 8 MiB, so read in ranges with SCAN, HSCAN, LRANGE or ZRANGE
One database 1 GiB

Errors have the Upstash shape {"error": "<Redis text>"}.

Typed keys and commands API