When to use this
Monthly subscription quotas
“Pro plan: 50,000 requests/month”, credits reset on the 1st of each month.
Daily allowances
Free tier users get 100 requests per day, resets at midnight UTC.
Rolling credits
Automatically restore credits without manual intervention.
How it works
- You create a key with
credits.remainingandcredits.refillconfigured - Unkey automatically refills the credits on your chosen schedule
- Daily refills trigger at midnight UTC
- Monthly refills trigger on a specific day of the month (default: 1st)
Refill replaces the current credit balance, it doesn’t add to it. A key
with 50 remaining credits will have exactly 1000 after a refill of 1000, not
1050.
Create a key with auto-refill
Monthly refill (most common)
Key gets 10,000 credits that reset on the 1st of each month:Monthly refill on a specific day
If your billing cycle is mid-month, setrefillDay:
For months with fewer days (e.g., February), refills on the last day of the
month if
refillDay exceeds the month’s length.Daily refill
Key gets 100 credits that reset every night at midnight UTC:Update refill settings
Change an existing key’s refill configuration:Disable refill
To stop auto-refill but keep the current credits:Common patterns
Tiered subscription plans
Upgrade a user’s plan
When a user upgrades, update their key:Refill vs manual credit management
You can use both: set a base refill for the subscription, and manually increment when users purchase additional credits.
Next steps
Usage limits
Learn more about credits and custom costs
Analytics
Track usage patterns per key