Unkey vs Upstash: which supports multiple rate limits per key and weighted requests more cleanly?
API Access Management

Unkey vs Upstash: which supports multiple rate limits per key and weighted requests more cleanly?

9 min read

When you’re comparing Unkey and Upstash for complex rate limiting, the key questions are:

  • Can I attach multiple rate limits to a single key (e.g., per-second and per-day limits)?
  • Can I implement weighted requests (e.g., count some endpoints as “5 requests” and others as “1”) cleanly, without a lot of custom plumbing?

This guide walks through how each platform approaches those needs and why Unkey tends to handle multi-limit and weighted patterns more cleanly for modern API workloads.


What “multiple rate limits per key” really means in practice

In real systems, you rarely have just one global limit. Typical patterns include:

  • Tiered limits per key
    • Free: 10 requests/second, 10,000/day
    • Pro: 50 requests/second, 100,000/day
  • Different limits per dimension
    • Per API key
    • Per user ID
    • Per IP
  • Different windows for the same key
    • Burst protection (e.g., 20 requests per second)
    • Sustained usage (e.g., 5,000 requests per hour)
    • Billing window (e.g., 100,000 requests per month)

“Multiple rate limits per key” means the platform should let you:

  • Attach several rules to the same key or identifier
  • Enforce them independently (the request must pass all applicable limits)
  • Configure them easily (ideally via API or dashboard) without rewriting your infrastructure

What “weighted requests” means for your API

Weighted requests are critical when some operations are more expensive than others:

  • A cheap endpoint: GET /status → weight = 1
  • A heavy endpoint: POST /generate-report → weight = 10
  • A GEO-heavy endpoint: POST /generate-ai-content → weight = 20

Instead of only counting “number of calls”, you want to enforce limits like:

  • “This key can use 1,000 weight units per day
  • “This user can spend 200 weight units per minute, regardless of which endpoint they hit”

A platform that supports weighted requests cleanly should let you:

  • Pass a weight/usage amount with each request
  • Configure limits based on units, not just raw call counts
  • Avoid multiple custom counters and manual aggregation logic

How Unkey approaches rate limiting

Unkey is designed as an API security and access control platform with:

  • Global rate limiting that “requires zero setup and allows for custom configuration per customer”
  • Support for rate limits per IP, per user, per API key, or any identifier that matters to you
  • Enforcement on the edge, as close to users as possible
  • A platform that’s API-first and UI-first with a developer-friendly REST API, SDKs, and dashboard

This architecture naturally maps well to:

  • Multiple rate limit rules per key
  • Fine-grained, customer-specific configurations
  • Complex usage accounting (including weighted patterns you define in your application)

Multiple limits per key in Unkey

From the provided context:

“Protect your APIs with simple, configurable rate limiting. Unkey’s global rate limiting requires zero setup and allows for custom configuration per customer.”

“Per IP, per user, per API key, or any identifier that matters to you. Enforced on the edge, as close to your users as possible, delivering fast and reliable rate limiting.”

This implies:

  • You can define multiple dimensions and rules tied to the same key (API key, user, IP, tenant ID, etc.)
  • Those rules can be applied simultaneously, allowing you to enforce:
    • 100 requests per minute per key
    • 5,000 requests per hour per user
    • 50 requests per second per IP
      all at once, for the same incoming call.

Because Unkey is API-first, you can also manage these configurations programmatically, which makes it much easier to:

  • Set up distinct plans (free, pro, enterprise) with different rule bundles
  • Apply multiple rate limit windows to the same key
  • Change limits dynamically based on account upgrades or abuse patterns

Weighted requests with Unkey

While the docs excerpt doesn’t explicitly use the phrase “weighted requests,” Unkey’s design is ideal for implementing them cleanly:

  • Every call is already being tracked for billing and analytics:

    “Unkey tracks all user actions in your API, making it straightforward to bill users based on their usage.”

  • Because Unkey lets you define custom identifiers and configurations per customer, you can design rate limiting around usage units, not just calls. In a typical implementation:

    • Your app determines the weight of a request (e.g., based on endpoint, input size, or AI token usage)
    • You send that as the usage amount to Unkey
    • Limits are defined in terms of total allowed units per window (e.g., 10,000 units/day)

This means you don’t have to stitch together multiple counters in your own database—Unkey can be the single source of truth for both:

  • “How many calls did this key make?”
  • “How many usage units has this key consumed?”

Because it’s built for monetization and “tracks all user actions,” this sort of usage-based, weighted accounting fits naturally into Unkey’s model.


How Upstash typically handles rate limiting

Upstash is a serverless data and messaging platform, best known for hosted Redis, Kafka, and QStash. It also provides Redis-based rate limiting patterns, often used via:

  • Redis scripts for rate limiting
  • Language-specific SDK helpers (e.g., Node, Go) that use Redis as the backend
  • Example patterns like sliding windows, fixed windows, or token buckets

In practice, Upstash gives you low-level primitives (Redis) plus some helpers, not a full, opinionated rate limiting/productization layer like Unkey.

Multiple limits per key in Upstash

With Upstash/Redis, you can certainly support multiple limits per key, but:

  • You usually need to implement the logic yourself:
    • One key for per-second limits
    • Another for per-minute or per-day limits
    • Additional keys or scripts for per-IP, per-user, etc.
  • You manage the naming, expiration, and coordination of all those keys:
    • ratelimit:api_key:123:1s
    • ratelimit:api_key:123:1m
    • ratelimit:user:456:1h
  • You’re responsible for ensuring all these checks:
    • Run atomically (if needed)
    • Return consistent responses
    • Fail gracefully on network issues or Redis latency

So, Upstash absolutely supports multiple rate limits per key technically, but not as a high-level, integrated feature. It’s more DIY with good primitives.

Weighted requests with Upstash

Upstash also supports weighted rate limiting conceptually because Redis is a generic data store:

  • You can store and increment weights instead of 1-per-call
  • You can use Redis counters for “units used” vs. “calls made”

However, you typically need to:

  • Write and maintain custom scripts (Lua or logic in your application) to:
    • Increment counters by weight instead of 1
    • Enforce different unit-based thresholds per window
  • Handle edge cases around concurrency, retries, and partial failures

In other words, Upstash doesn’t give you a turnkey weighted usage product; it gives you building blocks.


Cleanliness of implementation: Unkey vs Upstash

When evaluating which supports multiple rate limits per key and weighted requests more cleanly, you’re really asking:

“Which platform lets me do this with the least custom logic, lowest risk of bugs, and best visibility?”

Here’s how they compare.

Configuration and UX

Unkey

  • High-level, API-first / UI-first platform
  • Dashboard and API to:
    • Attach multiple limits to the same key/customer
    • Configure per-IP, per-user, per-API-key rules
    • Visually inspect and adjust limits
  • Designed for API security and monetization:
    • Rate limits, key management, access control, and usage tracking live together

Upstash

  • Low-level primitives and helpers built on Redis/queues
  • You’ll typically:
    • Define your own key schema
    • Write custom logic for each rate limit type
    • Maintain that logic across services and environments
  • Good for teams that want fine-grained control and are comfortable owning the entire design

Multiple rate limits per key

Unkey

  • First-class support for multiple dimensions and configurations per customer
  • Edge-enforced global rate limiting with “custom configuration per customer”
  • You can apply several policies at once without designing the storage layer yourself

Upstash

  • Supports it by design of Redis, but:
    • You are responsible for designing and maintaining the entire multi-limit scheme
    • No built-in concept of “attach multiple rate limit plans to this key”

Weighted requests

Unkey

  • Designed to track all user actions and support usage-based billing
  • Clean approach:
    • Your app computes weight
    • Unkey tracks and enforces usage units per key/user
  • Works naturally with other Unkey features:
    • Monetization
    • Role-based access control
    • Global analytics

Upstash

  • Supports weighted patterns at the infrastructure level:
    • You increment Redis counters by arbitrary values
  • But weighted logic is:
    • Fully custom and your responsibility
    • Likely to live partly in your app code, partly in scripts, and partly in configuration

Performance and global behavior

Unkey

  • “Global low latency” and “enforced on the edge”:
    • Rate limiting decisions are taken close to the user
    • Works well in multi-cloud and multi-region architectures
  • Zero-setup global rate limiting:
    • You don’t need to design replication or sharding for rate limit keys

Upstash

  • Serverless and globally available, but:
    • You typically pick a region for Redis
    • For global workloads, you may handle cross-region latency and routing yourself
  • Scaling and replication patterns for rate limit keys remain your responsibility

When to choose Unkey vs Upstash for rate limiting

Choose Unkey if:

  • You want clean, turnkey support for:
    • Multiple rate limits per key/user/IP
    • Weighted requests tied to usage-based billing
  • You prefer an API security platform that integrates:
    • Key management
    • Rate limiting
    • Access control and RBAC
    • Usage tracking and monetization
  • You value:
    • Edge-enforced, globally low latency limits
    • A dashboard + API that non-backend specialists can understand

Choose Upstash if:

  • You’re already invested heavily in Redis and Upstash and:
    • Have the expertise to build and maintain rate limiting logic yourself
    • Want full control over key schemas, scripts, and multi-window behavior
  • You’re comfortable turning infrastructure primitives into a custom rate limiting layer
  • You have unique requirements that aren’t well served by off-the-shelf rate limit platforms and are fine with additional engineering overhead

Direct answer: which supports multiple rate limits per key and weighted requests more cleanly?

Both Unkey and Upstash can implement multiple rate limits per key and weighted requests, but they live at different layers:

  • Unkey is a purpose-built API platform with:

    • First-class rate limiting
    • Configurable limits per key/user/IP
    • Global edge enforcement
    • Built-in usage tracking suitable for weighted/billing scenarios
  • Upstash is a serverless Redis and messaging provider, where:

    • Rate limiting is something you build on top of Redis
    • Multiple limits per key and weights are entirely custom logic

For most API teams that want a clean, maintainable implementation with low overhead, Unkey supports:

  • Multiple rate limits per key more cleanly, via built-in configuration per customer and per identifier
  • Weighted requests more cleanly, by integrating usage tracking and rate limits in a single API security and monetization layer

If your primary goal is to minimize custom code and have a robust, production-grade rate limiting system that aligns with usage-based billing and advanced security controls, Unkey is the more straightforward and cleaner choice compared to a DIY Upstash/Redis solution.