Skip to main content

GET /health

Detailed health check endpoint with account status and model quotas.

Request

Response

string
Overall server status. Always "ok" if the server is running.
string
ISO 8601 timestamp of the health check.
number
Time taken to generate the health report (in milliseconds).
string
Human-readable summary of account pool status.Example: "3 accounts: 2 available, 1 rate-limited"
object
Account pool statistics:
  • total (number): Total accounts configured
  • available (number): Accounts ready to use
  • rateLimited (number): Accounts waiting for quota reset
  • invalid (number): Accounts requiring re-authentication
array
Detailed status for each account:
  • email (string): Account email address
  • status (string): "ok", "rate-limited", "invalid", or "banned"
  • lastUsed (string | null): ISO 8601 timestamp of last use
  • modelRateLimits (object): Per-model rate limit state
  • rateLimitCooldownRemaining (number): Milliseconds until next retry
  • models (object): Per-model quota information (see below)

Example Response

Model Quota Information

Each account’s models object contains quota details per model:
  • remaining (string): Human-readable percentage (e.g., "75%")
  • remainingFraction (number): Quota fraction from 0 to 1
    • 1.0 = Full quota available
    • 0.0 = Quota exhausted
    • null = Quota unavailable (error fetching)
  • resetTime (string | null): ISO 8601 timestamp when quota resets

GET /account-limits

Fetch quota and subscription data for all accounts across all models.

Request

Query Parameters

string
default:"json"
Response format:
  • json - JSON response (default)
  • table - ASCII table for terminal display
boolean
default:"false"
Include 30-day usage history in the response. Used by the Web UI dashboard.

Response (JSON)

string
Human-readable timestamp of the report.
number
Total number of accounts configured.
array
List of all model IDs across all accounts.
number
Server-wide quota threshold (0-0.99). Accounts below this threshold are deprioritized.
array
Detailed account information:
  • email (string): Account email
  • status (string): "ok", "rate-limited", "invalid", or "banned"
  • subscription (object): Subscription tier data
    • tier (string): "free", "pro", or "ultra"
    • projectId (string): Google Cloud project ID
    • detectedAt (number): Timestamp when tier was detected
  • limits (object): Per-model quota limits
  • quotaThreshold (number | undefined): Per-account quota threshold (overrides global)
  • modelQuotaThresholds (object): Per-model quota thresholds

Example Response

Response (ASCII Table)

When ?format=table is used:

Monitoring Best Practices

Health Check Frequency

  • Production: Poll /health every 30-60 seconds
  • Development: Use the Web UI for real-time monitoring

Account Limits Polling

  • Web UI: Polls /account-limits?includeHistory=true every ~30s (with jitter)
  • CLI Monitoring: Use ?format=table for terminal-friendly output

Alerting

Set up alerts based on:
  1. No available accounts: counts.available === 0
  2. High invalid account ratio: counts.invalid / counts.total > 0.3
  3. Quota exhaustion: All accounts have remainingFraction < 0.1 for a model

Quota Thresholds

The proxy supports three-tier quota protection:
  1. Global threshold: Configured via globalQuotaThreshold in config.json (0-0.99)
  2. Per-account threshold: Overrides global for specific accounts
  3. Per-model threshold: Highest priority, overrides both global and account-level
Accounts below their threshold are deprioritized by the hybrid selection strategy.