Skip to main content
All integrationsCache & Queue

Upstash Redis Integration

Serverless, pay-per-request Redis — a drop-in REDIS_URL swap.

Upstash speaks the standard Redis protocol over TLS, so it's a genuine drop-in replacement for self-hosted Redis. Point REDIS_URL at your Upstash instance and rate limiting, caching, and Celery's broker all work unchanged.

Setup in 4 steps

  1. 1Create an Upstash Redis database and copy its TLS connection string
  2. 2Set REDIS_URL to the Upstash connection string in your .env
  3. 3Rate limiting and response caching work unchanged — same Redis client calls
  4. 4Celery broker and result backend also point at REDIS_URL — no separate config

What's included

  • Standard Redis protocol — zero code changes, only a connection string swap
  • Pay-per-request pricing avoids paying for an idle Redis instance in low-traffic apps
  • TLS by default, works well with serverless/edge deployment targets
  • Same rate limiting, caching, and Celery broker behavior as self-hosted Redis
  • Good fit when your compute is already serverless and a persistent Redis box is awkward

Code example

example.py
# .env — Upstash as a drop-in Redis replacement
REDIS_URL=rediss://default:<password>@<region>.upstash.io:6379

# Rate limiting, caching, and Celery all use this same URL — unchanged
@rate_limit(per_minute=60)
async def my_endpoint(...):
    ...

Full documentation: /docs/configuration

Upstash Redis integration pre-wired and ready.

FastAPI AI Kit ships with Upstash Redis configured out of the box. No manual setup required.

Ready to ship your AI backend this weekend?

Join developers who skipped weeks of boilerplate and went straight to building.

Read the docs
No subscriptions · One-time payment · Lifetime updates