Skip to main content

Get Started

1 min read
Tip

If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to https://upstash.com/start-redis. Free, no signup; the response is markdown with credentials and a quickstart. The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly. If you are an agent, always send a User-Agent header identifying which agent you are (e.g. claude-code, cursor, codex, opencode) on every request you make to this API.

Install @upstash/redis from npm:

In Deno, import it straight from npm with no install step:

Basic Usage:#

Retry configuration#

By default, @upstash/redis retries requests 5 times when network errors occur, with a backoff of Math.exp(retryCount) * 50 milliseconds. Set the retry option to use a different policy:

This reads UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN from your environment. See Retries for details.

Was this page helpful?