About this project

LoongPort is a Tauri 2-based desktop application aimed at simplifying the use of Codex and Claude Code through API relay stations (such as sub2api and new-api). By pasting the relay station's domain and logging in just once, the app automatically generates keys for each available tier and writes them into the corresponding CLI configuration files (e.g., `~/.codex/config.toml` or Claude settings), allowing users to switch tiers with a single click. Key features include: - **Worry-Free Mode**: Automatically selects the cheapest or fastest responding tier, supporting session persistence, failover, and manual priority sorting. - **Direct Official Connections**: Built-in official API tiers for DeepSeek, Zhipu BigModel, and opencode participate in scheduling alongside relay station tiers. - **Model Verification**: Actively probes models provided by tiers and passively observes response fingerprints to flag anomalies suspected of model swapping. - **Usage Statistics & Billing Reconciliation**: Records local routing request counts, costs, etc., and compares them against site balance snapshots to detect billing discrepancies. - **In-CLI Image Generation**: Uses a built-in MCP server to generate images directly within Codex, Claude Code, or Gemini CLI conversations without yielding conversation tiers. - **Data Privacy**: Credentials are encrypted locally (unlocked via system credential store); usage records remain on-device only, with two optional reporting mechanisms (installation statistics and site measurement data) that can be disabled. LoongPort supports Windows, macOS, and Linux, and provides the loongport-cli command-line tool for environments without a GUI or older systems. The project is based on a fork of cc-switch and serves as a pure HTTP client for sub2api, not bound to any specific site.