feat(api,web): tier-based session limits and daily turn usage display
Backend Changes:
- Add tier-based max_sessions config (free: 1, basic: 2, premium: 3, elite: 5)
- Add DELETE /api/v1/sessions/{id} endpoint for hard session deletion
- Cascade delete chat messages when session is deleted
- Add GET /api/v1/usage endpoint for daily turn limit info
- Replace hardcoded TIER_LIMITS with config-based ai_calls_per_day
- Handle unlimited (-1) tier in rate limiter service
Frontend Changes:
- Add inline session delete buttons with HTMX on character list
- Add usage_display.html component showing remaining daily turns
- Display usage indicator on character list and game play pages
- Page refresh after session deletion to update UI state
Documentation:
- Update API_REFERENCE.md with new endpoints and tier limits
- Update API_TESTING.md with session endpoint examples
- Update SESSION_MANAGEMENT.md with tier-based limits
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -59,21 +59,25 @@ rate_limiting:
|
||||
ai_calls_per_day: 50
|
||||
custom_actions_per_day: 10
|
||||
custom_action_char_limit: 150
|
||||
max_sessions: 1
|
||||
basic:
|
||||
requests_per_minute: 60
|
||||
ai_calls_per_day: 200
|
||||
custom_actions_per_day: 50
|
||||
custom_action_char_limit: 300
|
||||
max_sessions: 2
|
||||
premium:
|
||||
requests_per_minute: 120
|
||||
ai_calls_per_day: 1000
|
||||
custom_actions_per_day: -1 # Unlimited
|
||||
custom_action_char_limit: 500
|
||||
max_sessions: 3
|
||||
elite:
|
||||
requests_per_minute: 300
|
||||
ai_calls_per_day: -1 # Unlimited
|
||||
custom_actions_per_day: -1 # Unlimited
|
||||
custom_action_char_limit: 500
|
||||
max_sessions: 5
|
||||
|
||||
session:
|
||||
timeout_minutes: 30
|
||||
|
||||
Reference in New Issue
Block a user