Overview
Scira implements rate limiting to ensure fair usage and system stability. Rate limits vary based on authentication status and subscription tier.Rate Limit Tiers
Unauthenticated Users
Limits:- 3 searches per 7 days
- Basic models only
- No access to premium features
x-forwarded-for(first IP if multiple)x-real-ip- Falls back to
"unknown"if neither present
Authenticated Users (Free)
Limits:- 100 searches per day
- Access to most models
- Limited extreme search usage
- No access to code interpreter
- No access to memory features
Pro Users
Limits:- Unlimited searches
- Unlimited extreme search
- All premium models
- No rate limits
- Priority processing
Rate Limit Headers
Scira does not currently expose rate limit information in response headers, but this may be added in future versions. Potential headers (not yet implemented):Rate Limit Implementation
Upstash Rate Limiting
Scira uses Upstash Rate Limiting with Redis for distributed rate limiting: Features:- Sliding window algorithm
- Sub-millisecond latency
- Distributed across edge locations
- Analytics support
- Custom prefixes for different limit types
Authentication Rate Limiting
The authentication system itself also has rate limiting:Extreme Search Quotas
Extreme Search has separate usage tracking: Free Users:- Limited extreme search calls
- Tracked separately from regular searches
- Counter increments per extreme_search tool use
- Unlimited extreme search
- Usage still tracked for analytics
Handling Rate Limit Errors
Error Response Format
JavaScript Example
Python Example
Best Practices
Implement exponential backoff
Implement exponential backoff
When you hit rate limits, implement exponential backoff:
Cache results when possible
Cache results when possible
Reduce API calls by caching search results:
- Cache common queries
- Use time-based cache invalidation
- Store responses in localStorage or IndexedDB
- Share cache across tabs/sessions when appropriate
Monitor your usage
Monitor your usage
Track your API usage to avoid hitting limits:
- Count requests client-side
- Display usage to users
- Warn before approaching limits
- Prompt for upgrade when limit reached
Batch requests when possible
Batch requests when possible
Instead of multiple individual searches:
- Combine related queries
- Use conversation context effectively
- Leverage multi-turn conversations
Handle errors gracefully
Handle errors gracefully
Provide good UX when rate limits are hit:
- Show clear error messages
- Display time until reset
- Offer upgrade options
- Allow users to queue requests
Authenticate when possible
Authenticate when possible
For the best experience:
- Encourage users to sign in
- Highlight benefits of authentication (100 vs 3 searches)
- Make signup/signin easy
- Consider SSO options
Quota Management
Daily Reset
Authenticated user quotas reset daily at midnight UTC:Usage Tracking
Usage is tracked in the database: Message Usage:Bypass Mechanisms
Certain conditions bypass rate limits:- Pro Subscription: All limits bypassed
- Specific Models: Some low-cost models bypass free tier limits
- Internal Tools: System-generated requests may bypass limits
Upgrade Path
When users hit rate limits: Unauthenticated → Authenticated:- From 3/7 days to 100/day (33x increase)
- Sign up with email, GitHub, Google, Twitter, or Microsoft
- From 100/day to unlimited
- Access to premium models
- Extreme search unlimited
- Code interpreter
- Memory features
- Lookout (scheduled searches)
- Priority support
Monitoring and Analytics
Upstash Rate Limit includes analytics:- Request patterns
- Limit hit frequency
- Geographic distribution
- User behavior insights
Next Steps
Authentication
Learn how to authenticate for higher limits
Search API
Start making search requests
