Skip to main content

Overview

Scira uses session-based authentication powered by better-auth, a flexible authentication library for Next.js applications. Authentication is required for most API operations and determines your rate limits and feature access.

Authentication Methods

Session Authentication

Scira primarily uses cookie-based session authentication. When you sign in through the web interface, a secure session cookie is created that authenticates subsequent API requests.

Supported OAuth Providers

Scira supports authentication through multiple OAuth providers:
  • GitHub - Sign in with your GitHub account
  • Google - Sign in with your Google account
  • Twitter - Sign in with your Twitter/X account
  • Microsoft - Sign in with your Microsoft account

Session Configuration

The authentication system is configured with:

Making Authenticated Requests

Using Session Cookies

When making requests from a browser or client that supports cookies:

cURL Example

For cURL requests, you need to first obtain and save the session cookie:

Authentication Levels

Different features require different authentication levels:

Unauthenticated Access

Limits:
  • 3 searches per 7 days
  • Basic models only
  • No access to Extreme Search mode
  • No access to Lookout (scheduled searches)
Rate Limited by: IP address

Authenticated (Free)

Limits:
  • 100 searches per day
  • Access to most models
  • Limited Extreme Search usage
  • Basic features
Requirements:
  • Valid session cookie
  • Verified email address

Pro Subscription

Features:
  • Unlimited searches
  • All premium models
  • Unlimited Extreme Search
  • Lookout (scheduled research agents)
  • Priority processing
  • No rate limits
Requirements:
  • Active subscription through Polar or Dodo Payments
  • Valid session cookie

Authentication Headers

Required Headers

All API requests should include:

Optional Headers

Session Management

Getting Session Information

To check your current session:

Session Validation

Scira validates sessions on every request:
  1. Extracts session cookie from request
  2. Verifies session token with database
  3. Checks subscription status (for Pro features)
  4. Validates chat ownership (for chat-specific operations)

Subscription Status

Pro features require an active subscription. The system checks both Polar and Dodo Payments subscriptions:

Error Responses

Authentication Errors

401 Unauthorized - Authentication Required
401 Unauthorized - Model Requires Authentication
402 Payment Required - Pro Subscription Required
403 Forbidden - Chat Access Denied

Best Practices

Session cookies contain sensitive authentication tokens. Always use HTTPS to prevent token interception.
Sessions can expire. Implement proper error handling to redirect users to re-authenticate when receiving 401 errors.
If building a mobile or desktop app, ensure session cookies are stored in secure storage (Keychain, Android KeyStore, etc.).
Check subscription status before attempting to use Pro-only features to provide better UX.

Next Steps

Search API

Start making search requests

Rate Limits

Understand your usage limits