feat: tiered API plans (Free/Bronze/Gold/Platinum)
- Free: $0, 30 req/min, market data only - Bronze: $29/mo, 100 req/min, + companies & search - Gold: $99/mo, 500 req/min, + filings & historical - Platinum: $299/mo, 2000 req/min, all features + priority - Plan-aware rate limiting per API key (or per IP for free) - Usage tracking with daily aggregation - GET /api/v1/plans — plan listing - POST /api/v1/plans/register — instant free API key - GET /api/v1/plans/usage — usage stats - /pricing — dark-themed HTML pricing page - X-RateLimit-* and X-Plan headers on every response - Restricted endpoints return upgrade prompt - Updated OpenAPI spec with security scheme - 53 handlers, compiles clean
This commit is contained in:
@@ -48,6 +48,11 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
// Seed test API key
|
||||
if _, err := database.CreateAPIKeyWithValue("sentinela-test-key-2026", "Test User", "test@sentinela.dev", "platinum"); err != nil {
|
||||
slog.Warn("failed to seed test API key", "error", err)
|
||||
}
|
||||
|
||||
// Start scheduler
|
||||
syncInterval, err := time.ParseDuration(cfg.SyncInterval)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user