Usage Limits
Request Processing Limits
| Metric | Free | Pro | Enterprise |
|---|---|---|---|
| Requests/month | 100 | 5,000 | Unlimited |
| Rate Limit | 10/min | 100/min | Custom |
| Max File Size | 10 MB | 50 MB | 200 MB |
| Max Pages (PDF) | 50 | 500 | Unlimited |
| Concurrent Sessions | 1 | 3 | Unlimited |
| Context Window | 32K | 100K | 200K tokens |
Entitlement Check
// Middleware checks subscription status
function checkEntitlement(userId: string) {
- Verify Firebase JWT
- Fetch subscription from Firestore
- Check usage limits against plan
- Apply rate limiting
- Return 402 Payment Required if exceeded
}Cost Optimization
Sprout implements several strategies to optimize costs:
- Token caching for repeated queries
- Smart model routing (small model for simple tasks)
- Aggressive file size limits on free tier
- Usage-based Firebase reads/writes
- Blob storage TTL auto-cleanup