Why use identities?
Without identities, each API key is standalone. If a user has 3 keys, you need to update each one individually. With identities:| Without Identities | With Identities |
|---|---|
| Update rate limits on each key separately | Update once on the identity, applies to all keys |
| Metadata stored per-key | Shared metadata across all keys |
| Analytics scattered across keys | Aggregated analytics per identity |
| No concept of “this user’s total usage” | Shared rate limit pool across all keys |
Real-world example
Imagine you’re building a developer platform like Stripe. Each customer might have:- A test key for development
- A production key for live traffic
- Multiple restricted keys for different services
Use cases
Share rate limits across keys
Share rate limits across keys
Aggregate analytics per customer
Aggregate analytics per customer
Instead of piecing together usage from individual keys, get total usage per identity. Perfect for billing dashboards and customer insights.
Centralized configuration
Centralized configuration
Store plan tier, feature flags, or custom limits on the identity. All keys inherit this configuration without needing individual updates.
Multi-tenant organizations
Multi-tenant organizations
Map identities to organizations in your system. When an org adds team members or creates new keys, they all share the same identity and limits.
Data model
Unkey’s internal identifier for this identity. Use this to reference the identity in API calls.
Your identifier for this entity. This links the Unkey identity to your system — typically a user ID, org ID, or customer ID.If you use Clerk, Auth0, WorkOS, or similar: use their user/org ID as the externalId.
Arbitrary JSON metadata. Store anything useful: plan tier, feature flags, company name, etc.

