How rate limiting works in unkey
autoApply: true
) are checked automatically during every key verification without needing explicit specification. These work well for general usage limits that should always be enforced.
autoApply: false
) must be explicitly specified in verification requests. Use these for operation-specific limits that only apply to certain endpoints.
ratelimit
field is deprecated. Use the ratelimits
array instead.ratelimit
field are automatically migrated to use a special “default” ratelimit with autoApply: true
. This maintains backward compatibility without requiring code changes.
The legacy format converts automatically: