> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to Upstash Redis

The Upstash Redis connector lets your AI agent act in each user's Upstash Redis account. Each user connects their own Upstash Redis access token once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 28 tools.

**Authentication:** Bearer Token
**Categories:** Databases, Developer Tools
**Tools:** 28: 13 read, 5 write, 10 destructive
**Users sign in with:** Access token
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=UPSTASHREDIS)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Upstash Redis connection

   In **AgentKit > Connections**, create an Upstash Redis connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   import { ScalekitClient } from '@scalekit-sdk/node'
   import 'dotenv/config'
   import { createInterface } from 'node:readline/promises'

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   )
   const actions = scalekit.actions

   const connector = 'upstashredis'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
   console.log('Authorize Upstash Redis:', link)
   const rl = createInterface({ input: process.stdin, output: process.stdout })
   await rl.question('Press Enter after authorizing...')
   rl.close()

   // Make your first call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'upstashredis_database_size_get',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_dotenv()

   scalekit_client = ScalekitClient(
       env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
       client_id=os.getenv("SCALEKIT_CLIENT_ID"),
       client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
   )
   actions = scalekit_client.actions

   connection_name = "upstashredis"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_response = actions.get_authorization_link(
       connection_name=connection_name,
       identifier=identifier,
   )
   print("Authorize Upstash Redis:", link_response.link)
   input("Press Enter after authorizing...")

   # Make your first call
   result = actions.execute_tool(
       tool_input={},
       tool_name="upstashredis_database_size_get",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their Upstash Redis credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'upstashredis_database_size_get',
  toolInput: {},
  connector: 'upstashredis',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="upstashredis_database_size_get",
    tool_input={},
    connection_name="upstashredis",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `upstashredis_database_size_get`

Get Database Size · Read-only

Get the number of keys in the database (Redis DBSIZE).
Returns {"result": <count>} as an integer.
Use this for a quick key count or to check the connection works. Use upstashredis_key_scan to list key names.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs: none.

Example input: `{}`

### `upstashredis_hash_field_get`

Get Hash Field · Read-only

Get the value of one field in a hash (Redis HGET).
Returns {"result": "<value>"}, or {"result": null} when the field or key does not exist.
Use this for a single field. Use upstashredis_hash_get_all to read every field of the hash.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `field` (`string`, required): The field name within the hash. Example: email.
- `key` (`string`, required): The Redis hash key name. Any characters are allowed, including slashes and colons. Example: user:42.

Example input: `{"field":"<field>","key":"<key>"}`

### `upstashredis_hash_get_all`

Get All Hash Fields · Read-only

Get every field and value in a hash (Redis HGETALL).
Returns {"result": ["field1", "value1", "field2", "value2", ...]} as a flat list, or an empty list when the key does not exist.
Use this to read a whole hash. Use upstashredis_hash_field_get for one field of a large hash.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis hash key name. Any characters are allowed, including slashes and colons. Example: user:42.

Example input: `{"key":"<key>"}`

### `upstashredis_key_exists`

Check Keys Exist · Read-only

Check whether one or more keys exist (Redis EXISTS).
Returns {"result": <count>} with how many of the given keys exist; a key listed twice counts twice.
Use this to test for keys without reading values. Use upstashredis_key_type_get to learn a key's data type.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `keys` (`array`, required): One or more Redis key names, as a JSON array of strings. Example: ["user:42", "user:43"].

Example input: `{"keys":["user:42","user:43"]}`

### `upstashredis_key_scan`

Scan Keys · Read-only

Iterate over key names in the database a page at a time, optionally filtered by a glob pattern and type (Redis SCAN).
Returns {"result": ["<next cursor>", ["key", ...]]}; a next cursor of "0" means the scan is complete. A page can be empty even when more keys remain.
Use this to discover keys. Start with cursor 0 and pass back the returned cursor until it is "0". Use upstashredis_database_size_get for a count only.
Works with either the standard or the read-only REST token.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `count` (`integer`, optional): Optional hint for how many keys to examine per call. Redis may return more or fewer. Example: 100.
- `cursor` (`string`, optional): The cursor from the previous call. Use "0" to start a new scan. Example: 0.
- `match` (`string`, optional): Optional glob pattern to filter key names, using * ? and [] wildcards. Example: user:*.
- `type` (`string`, optional): Optional data type filter: string, list, set, zset, hash or stream. One of: `string`, `list`, `set`, `zset`, `hash`, `stream`.

Example input: `{}`

### `upstashredis_key_ttl_get`

Get Key TTL · Read-only

Get the remaining time to live of a key in seconds (Redis TTL).
Returns {"result": <seconds>}; -1 means the key has no expiry and -2 means the key does not exist.
Use this to check when a key expires. Use upstashredis_key_expire to change it.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis key name. Any characters are allowed, including slashes and colons. Example: user:42.

Example input: `{"key":"<key>"}`

### `upstashredis_key_type_get`

Get Key Type · Read-only

Get the data type stored at a key (Redis TYPE).
Returns {"result": "string" | "list" | "set" | "zset" | "hash" | "stream" | "none"}.
Use this before reading a key to pick the right tool, for example upstashredis_hash_get_all for a hash.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis key name. Any characters are allowed, including slashes and colons. Example: user:42.

Example input: `{"key":"<key>"}`

### `upstashredis_list_range_get`

Get List Range · Read-only

Get a range of elements from a list by index, without removing them (Redis LRANGE).
Returns {"result": ["element", ...]}; an empty list when the key does not exist or the range is out of bounds.
Use this to read a list. Use start 0 and stop -1 for the whole list. Use upstashredis_list_pop_left to read and remove.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis list key name. Any characters are allowed, including slashes and colons. Example: user:42.
- `start` (`integer`, optional): Zero-based start index, inclusive. Negative values count from the end. Defaults to 0. Example: 0.
- `stop` (`integer`, optional): Zero-based stop index, inclusive. -1 means the last element. Defaults to -1. Example: 9.

Example input: `{"key":"<key>"}`

### `upstashredis_set_members_list`

List Set Members · Read-only

Get every member of a set (Redis SMEMBERS).
Returns {"result": ["member", ...]} in no particular order, or an empty list when the key does not exist.
Use this to read a whole set. Use upstashredis_sorted_set_range_get for sorted sets.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis set key name. Any characters are allowed, including slashes and colons. Example: user:42.

Example input: `{"key":"<key>"}`

### `upstashredis_sorted_set_range_get`

Get Sorted Set Range · Read-only

Get members of a sorted set by index rank or by score range, optionally reversed and with scores (Redis ZRANGE).
Returns {"result": ["member", ...]}, or ["member", "score", ...] alternating when with_scores is true.
Use this to read leaderboards or score ranges. Use start 0 and stop -1 for every member by rank.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis sorted set key name. Any characters are allowed, including slashes and colons. Example: user:42.
- `start` (`string`, required): Range start. By rank: a zero-based index such as 0. By score: a score such as 10, (10 for exclusive, or -inf. Example: 0.
- `stop` (`string`, required): Range end, inclusive. By rank: an index such as -1 for the last member. By score: a score such as 100, (100 for exclusive, or +inf. Example: -1.
- `by_score` (`boolean`, optional): If true (BYSCORE), start and stop are scores instead of indexes.
- `limit_count` (`integer`, optional): Optional maximum number of members to return; only valid with by_score. Example: 10.
- `offset` (`integer`, optional): Optional number of members to skip; only valid with by_score. Requires limit_count. Example: 0.
- `reverse` (`boolean`, optional): If true (REV), return members from highest to lowest score. With by_score, give start as the higher score.
- `with_scores` (`boolean`, optional): If true (WITHSCORES), include each member's score after it in the result.

Example input: `{"key":"<key>","start":"<start>","stop":"<stop>"}`

### `upstashredis_stream_range_get`

Get Stream Range · Read-only

Get stream entries between two IDs in ascending order (Redis XRANGE).
Returns {"result": [["<id>", ["field", "value", ...]], ...]}.
Use this to read a stream. Use - and + for the whole stream, and count to page; pass (<last id> as start to continue after an entry.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis stream key name. Any characters are allowed, including slashes and colons. Example: user:42.
- `count` (`integer`, optional): Optional maximum number of entries to return. Example: 100.
- `end` (`string`, optional): End entry ID, inclusive. Use + for the last entry. Defaults to +. Example: +.
- `start` (`string`, optional): Start entry ID, inclusive. Use - for the first entry, or (<id> to exclude that ID. Defaults to -. Example: 1700000000000-0.

Example input: `{"key":"<key>"}`

### `upstashredis_string_get`

Get String Value · Read-only

Get the string value stored at a key (Redis GET).
Returns {"result": "<value>"}, or {"result": null} when the key does not exist.
Use this for one key. Use upstashredis_string_get_many to read several keys in one call, and upstashredis_hash_get_all for hash keys.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis key name. Any characters are allowed, including slashes and colons. Example: user:42.

Example input: `{"key":"<key>"}`

### `upstashredis_string_get_many`

Get Multiple String Values · Read-only

Get the string values of several keys in one call (Redis MGET).
Returns {"result": [...]} with one value per key, in the order given, and null for keys that are missing or not strings.
Use this to read several keys at once. Use upstashredis_string_get for a single key.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `keys` (`array`, required): One or more Redis key names, as a JSON array of strings. Example: ["user:42", "user:43"].

Example input: `{"keys":["user:42","user:43"]}`

### `upstashredis_counter_increment`

Increment Counter · Write

Increment the integer value of a key by a given amount, creating it at 0 first if missing (Redis INCRBY).
Returns {"result": <new value>} as an integer.
Use this for counters and rate tracking. Use a negative increment to decrement. Use upstashredis_string_set to set an exact value.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `key` (`string`, required): The Redis key name. Any characters are allowed, including slashes and colons. Example: user:42.
- `increment` (`integer`, optional): The amount to add. Defaults to 1. Use a negative number to decrement. Example: 5.

Example input: `{"key":"<key>"}`

### `upstashredis_list_push_left`

Push to List Head · Write

Insert one or more elements at the head (left) of a list, creating the list if needed (Redis LPUSH).
Returns {"result": <length>} with the list length after the push. Elements are inserted one after another, so the last one given ends up first.
Use this for stack-style or newest-first lists. Use upstashredis_list_push_right to append to the tail.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `elements` (`array`, required): The elements to add, as a JSON array. Non-string values are stored as their JSON text. Example: ["job-1", "job-2"].
- `key` (`string`, required): The Redis list key name. Any characters are allowed, including slashes and colons. Example: user:42.

Example input: `{"elements":["job-1","job-2"],"key":"<key>"}`

### `upstashredis_list_push_right`

Push to List Tail · Write

Append one or more elements to the tail (right) of a list, creating the list if needed (Redis RPUSH).
Returns {"result": <length>} with the list length after the push.
Use this for queues and logs in arrival order. Use upstashredis_list_push_left to insert at the head.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `elements` (`array`, required): The elements to add, as a JSON array. Non-string values are stored as their JSON text. Example: ["job-1", "job-2"].
- `key` (`string`, required): The Redis list key name. Any characters are allowed, including slashes and colons. Example: user:42.

Example input: `{"elements":["job-1","job-2"],"key":"<key>"}`

### `upstashredis_set_members_add`

Add Set Members · Write

Add one or more members to a set, creating the set if needed; members already present are ignored (Redis SADD).
Returns {"result": <count>} with the number of members newly added.
Use this to add unique values. Use upstashredis_sorted_set_members_add when members need a score or order.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis set key name. Any characters are allowed, including slashes and colons. Example: user:42.
- `members` (`array`, required): The members to add, as a JSON array of strings. Example: ["red", "blue"].

Example input: `{"key":"<key>","members":["red","blue"]}`

### `upstashredis_sorted_set_members_add`

Add Sorted Set Members · Write

Add members with scores to a sorted set, or update the scores of existing members (Redis ZADD).
Returns {"result": <count>} with the number of members added (or added plus changed when changed is true).
Use this for leaderboards and priority queues. Use upstashredis_set_members_add for plain sets without scores.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis sorted set key name. Any characters are allowed, including slashes and colons. Example: user:42.
- `members` (`array`, required): The members to add, as a JSON array of objects, each with a numeric score and a member string. Example: [{"score": 100, "member": "ada"}, {"score": 85.5, "member": "bob"}].
- `changed` (`boolean`, optional): If true (CH), the returned count includes members whose score changed, not just new members.
- `comparison` (`string`, optional): Optional. GT only updates a score when the new one is greater; LT only when it is less. Cannot be combined with condition NX. One of: `GT`, `LT`.
- `condition` (`string`, optional): Optional. NX only adds new members and never updates scores; XX only updates existing members and never adds. One of: `NX`, `XX`.

Example input: `{"key":"<key>","members":[{"score":100,"member":"ada"},{"score":85.5,"member":"bob"}]}`

### `upstashredis_hash_fields_delete`

Delete Hash Fields · Destructive

Permanently remove one or more fields from a hash (Redis HDEL).
Returns {"result": <count>} with the number of fields removed.
Use this to remove fields inside a hash. Use upstashredis_key_delete to delete the whole hash.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `fields` (`array`, required): The field names to remove, as a JSON array of strings. Example: ["email", "phone"].
- `key` (`string`, required): The Redis hash key name. Any characters are allowed, including slashes and colons. Example: user:42.

Example input: `{"fields":["email","phone"],"key":"<key>"}`

### `upstashredis_hash_fields_set`

Set Hash Fields · Destructive

Set one or more fields in a hash, creating the hash if needed and overwriting existing field values (Redis HSET).
Returns {"result": <count>} with the number of fields that were newly added (updated fields are not counted).
Use this to write hash fields. Use upstashredis_hash_fields_delete to remove fields.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `fields` (`object`, required): The fields and values to set, as a JSON object mapping field name to value. Non-string values are stored as their JSON text. Example: {"name": "Ada", "email": "ada@example.com"}.
- `key` (`string`, required): The Redis hash key name. Any characters are allowed, including slashes and colons. Example: user:42.

Example input: `{"fields":{"name":"Ada","email":"ada@example.com"},"key":"<key>"}`

### `upstashredis_key_delete`

Delete Keys · Destructive

Permanently delete one or more keys of any type (Redis DEL).
Returns {"result": <count>} with the number of keys that existed and were removed.
Use this to remove whole keys. Use upstashredis_hash_fields_delete, upstashredis_set_members_remove or upstashredis_sorted_set_members_remove to remove items inside a key.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `keys` (`array`, required): One or more Redis key names, as a JSON array of strings. Example: ["user:42", "user:43"].

Example input: `{"keys":["user:42","user:43"]}`

### `upstashredis_key_expire`

Set Key Expiry · Destructive

Set a time to live in seconds on a key, after which Redis deletes it (Redis EXPIRE).
Returns {"result": 1} when the expiry was set, or {"result": 0} when the key does not exist or the condition stopped it.
Use this to schedule a key's removal. Use upstashredis_key_ttl_get to read the remaining time, and upstashredis_string_set with ex to write a value and expiry together.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis key name. Any characters are allowed, including slashes and colons. Example: user:42.
- `seconds` (`integer`, required): Time to live in seconds. A value of 0 or less deletes the key immediately. Example: 3600.
- `condition` (`string`, optional): Optional condition. NX sets only if the key has no expiry; XX only if it has one; GT only if the new expiry is later; LT only if it is sooner. One of: `NX`, `XX`, `GT`, `LT`.

Example input: `{"key":"<key>","seconds":3600}`

### `upstashredis_list_pop_left`

Pop from List Head · Destructive

Remove and return elements from the head (left) of a list (Redis LPOP).
Returns {"result": "<element>"} without count, {"result": ["element", ...]} with count, or {"result": null} when the list is empty or missing.
Use this to consume a queue. Use upstashredis_list_range_get to read without removing.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `key` (`string`, required): The Redis list key name. Any characters are allowed, including slashes and colons. Example: user:42.
- `count` (`integer`, optional): Optional number of elements to pop. Without it, one element is returned as a plain value. Example: 5.

Example input: `{"key":"<key>"}`

### `upstashredis_set_members_remove`

Remove Set Members · Destructive

Permanently remove one or more members from a set (Redis SREM).
Returns {"result": <count>} with the number of members removed.
Use this to remove values from a set. Use upstashredis_key_delete to delete the whole set.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis set key name. Any characters are allowed, including slashes and colons. Example: user:42.
- `members` (`array`, required): The members to remove, as a JSON array of strings. Example: ["red", "blue"].

Example input: `{"key":"<key>","members":["red","blue"]}`

### `upstashredis_sorted_set_members_remove`

Remove Sorted Set Members · Destructive

Permanently remove one or more members from a sorted set (Redis ZREM).
Returns {"result": <count>} with the number of members removed.
Use this to remove entries from a leaderboard or queue. Use upstashredis_key_delete to delete the whole sorted set.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis sorted set key name. Any characters are allowed, including slashes and colons. Example: user:42.
- `members` (`array`, required): The members to remove, as a JSON array of strings. Example: ["red", "blue"].

Example input: `{"key":"<key>","members":["red","blue"]}`

### `upstashredis_stream_entry_add`

Add Stream Entry · Destructive

Append an entry of field-value pairs to a stream, creating the stream if needed, with optional trimming (Redis XADD).
Returns {"result": "<entry id>"} such as "1700000000000-0", or {"result": null} when no_create is true and the stream does not exist. Fields are stored in alphabetical order of field name, not the order given.
Use this to log events. Use upstashredis_stream_range_get to read entries back. Setting max_length permanently trims the oldest entries.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: yes. Idempotent (safe to retry): no.

Inputs:

- `fields` (`object`, required): The entry's fields and values, as a JSON object mapping field name to value. Example: {"event": "signup", "user": "42"}.
- `key` (`string`, required): The Redis stream key name. Any characters are allowed, including slashes and colons. Example: user:42.
- `approximate` (`boolean`, optional): If true, trim with ~ (approximately max_length, more efficient). Only used with max_length.
- `id` (`string`, optional): Optional explicit entry ID in <milliseconds>-<sequence> form. Defaults to * so Redis generates one. Example: *.
- `max_length` (`integer`, optional): Optional cap on the stream length (MAXLEN). Older entries beyond it are permanently deleted. Example: 1000.
- `no_create` (`boolean`, optional): If true (NOMKSTREAM), do not create the stream when it does not exist.

Example input: `{"fields":{"event":"signup","user":"42"},"key":"<key>"}`

### `upstashredis_string_set`

Set String Value · Destructive

Set a key to a string value, replacing any existing value and type (Redis SET), with optional expiry and NX/XX condition.
Returns {"result": "OK"}, or {"result": null} when an NX/XX condition stopped the write.
Use this to write one key. Use upstashredis_string_set_many for several keys, and upstashredis_key_expire to change only the expiry.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `key` (`string`, required): The Redis key name. Any characters are allowed, including slashes and colons. Example: user:42.
- `value` (`string`, required): The value to store, as a string. Slashes and special characters are sent safely in the JSON body. Example: {"plan":"pro"} or hello world.
- `condition` (`string`, optional): Optional write condition. NX writes only if the key does not exist; XX writes only if it already exists. One of: `NX`, `XX`.
- `ex` (`integer`, optional): Optional time to live in seconds (EX). Do not combine with px or keep_ttl. Example: 60.
- `keep_ttl` (`boolean`, optional): If true, keep the key's existing time to live (KEEPTTL) instead of clearing it. Do not combine with ex or px.
- `px` (`integer`, optional): Optional time to live in milliseconds (PX). Do not combine with ex or keep_ttl. Example: 1500.

Example input: `{"key":"<key>","value":"<value>"}`

### `upstashredis_string_set_many`

Set Multiple String Values · Destructive

Set several keys to string values in one atomic call (Redis MSET), replacing existing values.
Returns {"result": "OK"}.
Use this to write several keys at once with no expiry. Use upstashredis_string_set for one key or to set an expiry or NX/XX condition.
Needs the standard (read-write) REST token; a read-only token gets a 403 NOPERM error, and the connection stays active.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `entries` (`object`, required): The keys and values to set, as a JSON object mapping each key name to its value. Non-string values are stored as their JSON text. Example: {"user:42:name": "Ada", "user:42:plan": "pro"}.

Example input: `{"entries":{"user:42:name":"Ada","user:42:plan":"pro"}}`

## Related

Other Databases connectors ([all 39](/agentkit/connectors/?category=databases)):

- [AWS Redshift](/agentkit/connectors/redshift/): Scalekit connector, Trusted identity provider, 10 tools
- [Google BigQuery](/agentkit/connectors/bigquery/): Scalekit connector, OAuth, 47 tools
- [Airtable](/agentkit/connectors/airtable/): Scalekit connector, OAuth, 26 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
