Skip to content

Releases: wang1970/API-Switch

v0.7.39

02 Jun 15:35

Choose a tag to compare

API Switch v0.7.39

Enhancements
Logging Refactor: Split IN/OUT request/response capture, restore diagnostic info
Channel Probe Optimization: Concurrent USER URL + BASE SITE detection, debuggable errors with i18n
Import/Export: Settings UI, Tauri/Web adapter, support empty API Key channels
Fixes
Classify Tauri invoke errors for better readability
Prevent Responses SSE events leaking to OpenAI protocol
Fix settings edits overwriting unrelated fields
Fix sort_index missing in import-export payload
User Experience
Add confirmation dialog for log data clearing
Protect responses output from error injection

Downloads

Portable binaries (no install needed, just run):

  • api-switch-windows-x64.exe — Windows
  • api-switch-macos-x64 — macOS Intel
  • api-switch-macos-arm64 — macOS Apple Silicon
  • api-switch-linux-x64 — Linux x64
  • api-switch-linux-arm64 — Linux ARM64
  • api-switch-linux-x64-headless — Linux x64 (无 GUI,体积更小,适合服务器/Termux)
  • api-switch-linux-arm64-headless — Linux ARM64 (无 GUI,适合服务器/Termux)

Installers (system integration):

  • *.msi / *.exe — Windows installer
  • *.dmg — macOS disk image
  • *.AppImage — Linux AppImage

Usage

  1. Download and run (or install via installer)
  2. Database is auto-created in the same directory
  3. Point your client to http://127.0.0.1:9090

v0.7.20

30 May 03:43

Choose a tag to compare

API Switch v0.7.20

🚀 New Features

  • Claude same-protocol passthrough: Claude → Claude requests pass
    through directly without protocol conversion, preserving
    mid-conversation system and other Claude-specific fields
  • Cross-protocol blacklist defaults: All exit builders (OpenAI /
    Gemini / Azure / Claude cross-protocol) use unified blacklist defaults
    to prevent field loss
  • Headless build support: GUI-free Linux builds via gui Cargo feature
    (~5MB), suitable for servers / Termux
  • Full platform bundling: Enabled bundle packaging for all platforms
    (.exe/.msi/.dmg/.AppImage)
  • Real model name on Claude passthrough: Passthrough streams now
    display the actual model name instead of a placeholder
  • Web Admin auto-write for connection apps: Headless environments can
    auto-write connection app configs via Web Admin

🐛 Bug Fixes

  • Anthropic cache token accounting: Prompt usage stats now correctly
    include cache tokens
  • Claude passthrough stream usage extraction: Usage tokens are now
    properly extracted from passthrough streams
  • Protocol field filtering fix: Anthropic-specific fields are filtered
    at exit (not entry), avoiding blocking non-Claude streams
  • Intermediate protocol conversion cleanup: Claude → OpenAI conversion
    now correctly drops Claude-specific fields
  • Web Admin login/logout fixes: Fixed logout hanging and redundant
    /admin path in access URLs
  • CI build stability: Fixed aarch64 AppImage dependency missing,
    release upload retry on transient failures

🧹 Cleanup

  • Removed non-functional CC identity spoofing diagnostics
  • Claude CLI identity headers properly forwarded in passthrough

Downloads

Portable binaries (no install needed, just run):

  • api-switch-windows-x64.exe — Windows
  • api-switch-macos-x64 — macOS Intel
  • api-switch-macos-arm64 — macOS Apple Silicon
  • api-switch-linux-x64 — Linux x64
  • api-switch-linux-arm64 — Linux ARM64
  • api-switch-linux-x64-headless — Linux x64 (无 GUI,体积更小,适合服务器/Termux)
  • api-switch-linux-arm64-headless — Linux ARM64 (无 GUI,适合服务器/Termux)

Installers (system integration):

  • *.msi / *.exe — Windows installer
  • *.dmg — macOS disk image
  • *.AppImage — Linux AppImage

Usage

  1. Download and run (or install via installer)
  2. Database is auto-created in the same directory
  3. Point your client to http://127.0.0.1:9090

v0.7.1

27 May 21:14

Choose a tag to compare

Emergency Fix

Fixes Web Admin not accessible on Linux ARM64 due to loader/proot causing database path resolution failure.

Other platforms (Windows, macOS, Linux x64) are not affected.

Changes

  • Embed Web Admin static resources into binary for single-file portable release
  • Resolve data directory from real api-switch executable path for Linux ARM64 compatibility

v0.7.0

27 May 17:34

Choose a tag to compare

API Switch v0.7.0

English Summary

New Features

  • Connection Apps: One-click config write for OpenCode/Codex/Claude Code/Zed, replacing old CLI env vars
  • Global Reasoning Toggle: Control thinking passthrough, Claude/Gemini bidirectional translation
  • Channel Editor Calibration: One-click model fetch, direct speed test, group selection
  • Model Score Sorting: Auto-calculate recommendation scores (capability/speed/latency)
  • Keyword Freeze Scope: Switch between model-level cooldown and channel-level freeze
  • Dashboard Chart Range: Support 7d/30d/all time range switching
  • Auto Database Backup: Auto-backup to backups/YYYY-MM-DD/ on startup

Improvements

  • Protocol Output Whitelist: Migrate from blacklist to whitelist, strict protocol boundary compliance
  • Dirty Flag Polling: Unify useDirtyPolling, remove duplicate event/setInterval paths
  • Model Info Injection: Unify model info injection across all protocols
  • Probe Detection: Treat 401/403 as endpoint-exists evidence

Fixes

  • Fix WebView2 black screen (block_on → spawn)
  • Fix non-stream empty response detection
  • Fix pool viewport refresh loss
  • Fix model time range selector
  • Clean up state_version duplicate calls

Downloads

Portable binaries (no install needed, just run):

  • api-switch-windows-x64.exe — Windows
  • api-switch-macos-x64 — macOS Intel
  • api-switch-macos-arm64 — macOS Apple Silicon
  • api-switch-linux-x64 — Linux

Installers (system integration):

  • *.msi / *.exe — Windows installer
  • *.dmg — macOS disk image
  • *.AppImage — Linux AppImage

Usage

  1. Download and run (or install via installer)
  2. Database is auto-created in the same directory
  3. Point your client to http://127.0.0.1:9090

v0.6.16

16 May 10:20

Choose a tag to compare

API Switch v0.6.16

✨ New Features

  • Test Chat = Model Availability Test: A successful test chat automatically enables the model and records response speed; a failed test chat automatically disables the model and marks it as unavailable (response_ms = "X").
  • Auto Update Check: Checks GitHub for the latest release on startup and notifies when an update is available.
  • Dashboard Improvements: Auto time granularity, token formatting, pie chart toggle.
  • Model Alias Matching: Router supports display_name exact match; /v1/models and all model endpoints now show aliases.
  • Gemini Streaming: Added streamGenerateContent SSE endpoint and model detail route.

🐛 Bug Fixes

  • Web settings save race conditions (version tracking, retry, password placeholder)
  • Speed test failure diagnostics and frontend error details
  • Pool reordering now works during search
  • Removed 2s auto-refresh polling from dashboard
  • Async conversion of sync Tauri commands to prevent UI freeze

Downloads

Portable binaries (no install needed, just run):

  • api-switch-windows-x64.exe — Windows
  • api-switch-macos-x64 — macOS Intel
  • api-switch-macos-arm64 — macOS Apple Silicon
  • api-switch-linux-x64 — Linux

Installers (system integration):

  • *.msi / *.exe — Windows installer
  • *.dmg — macOS disk image
  • *.AppImage — Linux AppImage

Usage

  1. Download and run (or install via installer)
  2. Database is auto-created in the same directory
  3. Point your client to http://127.0.0.1:9090

v0.6.9

14 May 06:48

Choose a tag to compare

API Switch v0.6.9 Release Notes

Personal AI API Management & Forwarding Hub


What's New

Responses API Upstream Support

  • Full streaming support via /v1/responses — upstream Responses SSE events are now correctly transformed, fixing the "upstream stream completed without valid output" error. Enables connectivity with relay stations exposing Responses API endpoints.

Smart Routing with Model Aliases

  • /v1/models endpoint now returns display_name (alias) and group_name alongside each model ID — consistent across all four endpoints (OpenAI, Claude, Gemini, Azure).
  • Router now supports exact match by alias (display_name) as a new priority tier: group match → model match → alias match → fuzzy match → AUTO fallback.

Desktop Performance & Stability

  • Eliminated UI freezes: All write-heavy Tauri commands converted from sync (pub fn) to async (pub async fn) to prevent blocking the thread pool — affects channel, pool, and token operations.
  • Batch toggle IPC: Shift+click batch toggle now uses a single batchToggle IPC call instead of N concurrent calls, preventing IPC storms.
  • Tray debounce: System tray refreshes are debounced to 1500ms to avoid redundant menu rebuilds.
  • Event debounce: entries-changed events are throttled (300ms) to prevent React re-render storms on rapid data changes.
  • Tab switch jitter fix: Window-level scrollbar now always reserved (overflow-y-scroll) to eliminate layout shift when switching pages.

Responsive Infinite Scroll

  • All management pages (Pool, Channels, Tokens, Logs) now use infinite scroll with useInfiniteQuery — no more traditional pagination.
  • Search inputs are debounced (300ms) to avoid excessive backend requests.
  • Filter changes no longer trigger aggressive scrollTo behavior.
  • placeholderData keeps previous results visible while new data loads, eliminating layout jumps.

State Machine Driven UI Refresh

  • All data mutations now bump a central state version counter.
  • A 2-second polling mechanism detects version changes and automatically refreshes all active queries — eliminating the need for explicit refresh logic in most operations.
  • PoolManager additionally calls refetch({ refetchPage: () => true }) to refresh all loaded infinite scroll pages (not just page 1) when state version changes.

Speed Test Improvements

  • Speed tests now properly clear cooldown state and bump the state version on completion.
  • Failed entries are batch-disabled after all tests finish (no more mid-test IPC storms).
  • Results are driven by the state machine refresh mechanism — no separate update logic needed.

Model Catalog & Metadata

  • display_name (alias) is now stored and propagated through the catalog metadata pipeline.
  • Model list responses include both display_name and group_name for better client integration.
  • Backfill operations update display_name alongside other catalog fields.

Other Fixes

  • Channel enable/disable toggle no longer freezes the window (sync-to-async conversion).

  • Drag-and-drop in PoolManager no longer requires all pages to be loaded.

  • Unused local reference docs excluded from git tracking.


Changes since v0.5.0

  • 130+ commits
  • 200+ files changed
  • Version: 0.5.0 → 0.6.9

Upgrade Notes

  • Settings: The show_conversation_model default is now true. Existing installations need to enable it in Settings if previously turned off.
  • API Types: Channel API type labels updated to: OpenAI-compatible, OpenAI, Claude, Gemini, Azure, OpenAI-Responses(bate). No i18n translation for these labels.
  • Backward Compatibility: All existing channels and entries remain functional. No database migration needed beyond automatic schema updates on first launch.

v0.5.0

01 May 13:35

Choose a tag to compare

API Switch v0.5.0

Portable single-file build. Download for your platform:

  • api-switch-windows-x64.exe ? Windows
  • api-switch-macos-x64 ? macOS Intel
  • api-switch-macos-arm64 ? macOS Apple Silicon
  • api-switch-linux-x64 ? Linux

Usage

  1. Download and run
  2. Database is auto-created in the same directory
  3. Point your client to http://127.0.0.1:9090

API Switch v0.4.1 ??v0.5.0 Development Summary

Development period: 2026-04-28 ~ 2026-05-01
Release target: v0.5.0


Highlights

1. Proxy routing hardening

  • Reworked explicit-model and auto routing rules so disabled entries remain visible and callable by explicit model name, while only enabled entries participate in auto routing.
  • Added failover behavior for explicit model requests: if matching entries are cooled down or fail, routing can fall back to the auto pool.
  • Centralized route sorting so /v1/models, proxy routing, tray menu, and UI sorting use the same custom/latest/fastest model priority model.

2. API pool sorting and metadata

  • Added the API pool three-way sorting bar: Specified Models / Latest Models / Fastest Models.
  • Persisted the selected default sort mode through settings and backend storage.
  • Added catalog-backed model metadata normalization and backfill for provider logo, release date, and localized model summaries.
  • Improved model matching quality by preferring authoritative provider catalog metadata over third-party aggregator metadata.

3. Latency testing and failure handling

  • Improved one-click latency testing by running channels in parallel while keeping entries within the same channel controlled.
  • Added progress display during full-pool latency tests.
  • Failed latency tests now directly disable unavailable entries where appropriate.
  • Stored response times as millisecond values and reused them for fastest-model sorting.

4. Circuit breaker and timeout controls

  • Added configurable upstream proxy connect timeout in Settings.
  • Stored the new proxy_connect_timeout_secs config key with database defaults and full frontend/backend type synchronization.
  • Adjusted circuit breaker defaults and labels to better match the continuous-failure disable behavior.

5. Dashboard and usage statistics

  • Fixed ??oday??statistics to use local-day boundaries instead of UTC-style rolling 24-hour windows.
  • Improved dashboard token charts with compact axis labels and full formatted tooltip values.

6. Logs and debugging

  • Enhanced upstream error logging so raw upstream error bodies, including detailed 429 responses, are preserved.
  • Changed unauthenticated/internal token display in logs from auto to NONE for clearer diagnostics.
  • Avoided treating client-side stream disconnects as upstream failures.

7. Channel and model management

  • Allowed channels to be saved without requiring a successful model fetch first.
  • When manually adding a model to the API pool, the channel model list is updated if that model was missing.
  • Improved channel table layout, model count display, and release-date normalization.

8. UI and product cleanup

  • Refined the API pool header, sticky search behavior, and three-button sorting layout alignment.
  • Removed the experimental CLI page from the main sidebar.
  • Updated bilingual labels for sort modes, circuit settings, and related UI text.
  • Added personal planning-note ignore rules and project agent instructions.

9. Version and planning updates

  • Bumped application version from 0.4.1 to 0.5.0 across npm, Tauri, Cargo, and lock metadata.
  • Updated PLAN.md to reflect version 0.5.0.

Small polish

Minor layout alignment, wording, metadata fallback, comments, and formatting fixes were applied across the UI and backend.


Technical notes

Backend

  • Added settings storage and runtime use for proxy_connect_timeout_secs.
  • Added model metadata persistence/backfill support for API pool entries.
  • Added helper logic to keep manually created API pool entries synchronized with channel model lists.
  • Added lazy tray refresh infrastructure while keeping eager refresh as the current default.

Frontend

  • Synced API pool sort mode with backend settings using full AppSettings updates.
  • Matched frontend latest/fastest sorting with backend route sorting semantics.
  • Added catalog metadata precomputation for display and normalization.
  • Improved dashboard number formatting and local-day filtering.

Database

  • Added default config key: proxy_connect_timeout_secs = 30.
  • Continued compatibility-first behavior through default config insertion and frontend/backend type updates.

v0.4.1

28 Apr 12:31

Choose a tag to compare

API Switch v0.3.0 → v0.4.1 Development Summary

Development period: 2026-04-26 ~ 2026-04-28


v0.4.1 (2026-04-28) — Bug Fixes

# Change Description
1 Channel save button unlocked New channels no longer require model fetch before saving; only name/URL/API Key needed
2 gzip decompression support Enabled reqwest gzip feature, fixing error decoding response body for gzip-compressed upstream responses
3 Add model dialog cleanup Removed model metadata info block from AddApiDialog

v0.4.0 (2026-04-28) — Latency Testing / Bilingual Guide / Smart Model Selection

# Change Description
1 API pool one-click latency test New test button to measure latency for all models; green on success, red ✗ on failure
2 API pool response time field Added response_ms column to api_entries table with auto-migration
3 Channel latency test improvement Tests all channels (not just enabled); uses local state to avoid list jumping
4 Bilingual usage guide Sidebar auto-switches GUIDE_CN.md / GUIDE.md based on i18n.language
5 Auto-open add dialog Auto-opens channel add dialog when entering channel page with no channels
6 Smart model pre-selection Auto-selects models released within 6 months + existing channel models after fetch
7 New models enabled by default sync_entries_for_channel now sets enabled = 1 for new entries
8 Selection sync fix Channel save always calls selectModels, even with empty selection
9 API pool cache refresh Channel save invalidates both entries and channels queries
10 Channel list nowrap Status, response time, model count columns prevent line wrapping

Additional Changes (accumulated during v0.3.x)

# Change Description
1 Settings page slider Recovery timeout changed from number input to slider (300-1800s, default 600s)
2 Channel batch latency test Refresh button in "Response" column header to test all channels
3 Channel response time Edit-save auto-probes URL latency and stores in response_ms
4 Tray menu restore Restored "Open Main Window" tray menu item

v0.3.0 (2026-04-27) — Smart Model Fetch / Model Catalog / Auto-Disable Fix

# Change Description
1 Single-button smart model fetch Removed two-step detection UI; backend validates API type + base URL then fallback-fetches models
2 URL / type auto-correction Falls back from wrong endpoint to correct base site; auto-fills api_type and base_url
3 Avoid Gemini misclassification Only classifies as Gemini when hitting /v1beta/openai/* path
4 Filter auto model Upstream auto entries excluded from channel model list
5 Local model catalog Added models.json + modelsCatalog.ts; cards and dialogs show release date, capabilities, context/output limits
6 Fuzzy model matching Supports provider/model, -free, -preview suffix cleaning and similarity matching
7 Auto-disable default codes Status codes changed to 401,403,410; settings page exposes input for customization
8 Proxy auto-disable Matching status codes set enabled=false directly
9 Log path fix attempt_path correctly formatted from object arrays
10 Test dialog close fix Request sequence isolation + forced cleanup on close
11 API pool text compression Title changed to Channel / Model; cooldown shown inline

Known Issues (v0.4.0 Deprecation Reasons)

Issue Severity Description
Channel fetch auto-disables entries High When network is unreachable, Step 1 validation failure auto-disables channel and all its entries with no recovery mechanism
Endpoint detection request explosion Medium 3 base_urls × 6 types × 6 URLs = up to 108 serial requests; worst case ~6 min wait
gzip response decoding failure High (fixed) reqwest lacked gzip feature; some upstreams return compressed responses causing parse failure

Technical Changes Summary

Backend (Rust)

  • Enabled reqwest gzip feature
  • fetch_models split into Step 1 endpoint detection + Step 2 model fetch
  • detect_endpoint_guess refactored to phased detection (Phase 1 user type → Phase 2 cross-type correction)
  • canonical_base_url_for_success case-insensitive matching
  • join_url case-insensitive /v1, /v1beta suffix stripping

Frontend (React/TypeScript)

  • fetchModels return type changed from ModelInfo[] to FetchModelsResult
  • Channel editor dialog: removed API type lock, supports re-validation on edit
  • AddApiDialog removed model metadata info block
  • Local model catalog modelsCatalog.ts integration

Database

  • api_entries added response_ms TEXT DEFAULT ''
  • circuit_recovery_secs default changed from 300 to 600

Generated: 2026-04-28

v0.3.0

26 Apr 09:22

Choose a tag to compare

API Switch v0.3.0

Personal Model Cooldown Mechanism

Replaced the complex NEW-API style status code/keyword routing strategy with a simpler "model cooldown" mechanism designed for personal use: if it's not working, cool it down and try the next one.

Core Changes

  • Model Cooldown: Any upstream failure triggers a 300-second cooldown. Cooled models are skipped in routing, and the request fails over to the next available model.
  • Auto-Recovery on Success: A successful request automatically clears the cooldown state.
  • User Controls Are Sacred: The enabled toggle is only controlled by the user. The system never automatically disables an entry �� it only sets cooldown timers.
  • Simplified Strategy: Removed auto-disable status codes, auto-retry status codes, auto-disable keywords, and the 504/524 no-retry hardcode.

New Features

  • API pool status indicators: ?? Normal / ?? Cooling down / ? Disabled
  • "Usage Guide" sidebar menu linking to GitHub documentation
  • Toast notifications replacing alert() dialogs

Improvements

  • Test chat now sends requests directly to the upstream via Tauri command, bypassing the proxy port �� no fallback, no interference
  • Log page: click any row to expand details, removed chevron icons
  • Tray menu auto-refresh on cooldown/recovery/reorder/toggle
  • Database startup compatibility check: auto-add new columns, missing config keys, and migrate old defaults

Upgrade Notes

  • Fully backward compatible �� existing databases are automatically migrated on startup
  • Default cooldown parameters: 1 failure �� 300s cooldown (old default of 4 failures/60s is auto-migrated)
  • Settings page circuit breaker card now only shows "Failure Threshold" and "Recovery Wait Time"

v0.2.0

25 Apr 12:03

Choose a tag to compare

API Switch v0.2.0

Portable single-file build. Download for your platform:

  • api-switch-windows-x64.exe — Windows
  • api-switch-macos-x64 — macOS Intel
  • api-switch-macos-arm64 — macOS Apple Silicon
  • api-switch-linux-x64 — Linux

Usage

  1. Download and run
  2. Database is auto-created in the same directory
  3. Point your client to http://127.0.0.1:9090