Skip to main content

Documentation Index

Fetch the complete documentation index at: https://upstash.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Arguments

key
string
required
The key to set the timeout on.
seconds
integer
How many seconds until the key should be deleted.

Response

1 if the timeout was set, 0 otherwise
await redis.set("mykey", "Hello");
await redis.expire("mykey", 10);