Skip to main content

Module proxy

Module proxy 

Source

Functions§

create_app
create_app_with_state
openai_token_refresh_loop
Keeps OpenAI id_tokens perpetually fresh.
prefetch_rate_limits
For any account with no rate-limit data yet, make a cheap request directly to the upstream API so we populate metrics without waiting for a real user request. Runs as a background task after startup.
recovery_watcher
Runs as a background task. Every 2 minutes, tries to refresh tokens for any auth_failed account. If refresh succeeds the account is brought back online without a process restart. If all accounts remain unrecoverable, fires a macOS notification (at most once per hour).

Type Aliases§

LiveCredentials
Shared live credentials map — can be written to without restarting the proxy.