Skip to content

๐Ÿš€ AnyProxyAi - Universal AI API Gateway GUI | ้€š็”จ AI API ็ฝ‘ๅ…ณ GUI - Route, convert and manage multiple AI provider APIs (OpenAI, Claude, Gemini) through a single unified interface. ้€š่ฟ‡ๆœฌๅœฐ็ปŸไธ€ๆŽฅๅฃ่ทฏ็”ฑใ€่ฝฌๆขๅ’Œ็ฎก็†ๅคšไธช AI ๆœๅŠกๅ•† API็›ธไบ’่ฝฌๆขใ€‚Built with Wails + Vue 3.

License

Notifications You must be signed in to change notification settings

cniu6/anyproxyai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

30 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AnyProxyAi

Universal AI API Proxy Router with Multi-Format Support

Build Status License: MIT Go Version Wails

English | ็ฎ€ไฝ“ไธญๆ–‡

๐Ÿ’ฐ This tool is valued at $100 USD - developed with equivalent cost of Claude Opus 4.5 AI assistance

๐Ÿ“– Introduction

AnyProxyAi is a universal AI API proxy router that supports multiple API formats (OpenAI, Claude, Gemini) with automatic format conversion, load balancing, and intelligent routing. It provides a unified local endpoint for all your AI API needs.

Why AnyProxyAi?

  • Multi-Format Support: Seamlessly convert between OpenAI, Claude (Anthropic), and Gemini API formats
  • Unified Endpoint: Single local API endpoint for all AI services
  • Load Balancing: Automatic routing across multiple API endpoints
  • Usage Statistics: Real-time monitoring of requests, tokens, and success rates
  • Cross-Platform: Native desktop app for Windows, macOS, and Linux
  • Multi-Language: Supports Chinese and English, follows system language by default

๐Ÿ“ธ Screenshots

Home Page
Home Page - Dashboard

Model List
Model List - Route Management

Statistics
Usage Statistics - Heatmap & Charts

Add Route
Add Route Dialog

Linux
Linux Running

Claude Code to OpenAI
Claude Code Interface โ†’ OpenAI Format Conversion

OpenAI Format Conversion
OpenAI Format Conversion

โœจ Features

Core Features

Feature Description
๐Ÿ”„ API Format Conversion Automatic conversion between OpenAI, Claude, and Gemini formats
๐Ÿ”€ Smart Routing Route requests to different backends based on model name
๐Ÿ” Proxy Redirect Use proxy_auto keyword to redirect to any configured model
๐Ÿ“Š Real-time Stats Monitor requests, errors, and token usage
๐Ÿ“ˆ Historical Data SQLite-based statistics with heatmap visualization
๐ŸŽฏ Model Ranking Track most used models and their performance
๐ŸŒ Multi-Language Chinese/English support, follows system language, switchable from top-right corner (persistent)

Supported API Formats

Format Input Output Streaming Stream Conversion
OpenAI โœ… โœ… โœ… โœ…
Claude (Anthropic) โœ… โœ… โœ… โœ…
Gemini โœ… โœ… โœ… โœ…
Claude Code โœ… โœ… โœ… โœ…
Cursor IDE โœ… โœ… โœ… โœ…

UI Features

Feature Description
๐Ÿ–ฅ๏ธ Cross-platform Desktop App Windows, macOS, Linux support
๐ŸŽจ Dark/Light Theme Toggle between themes
๐ŸŒ Language Switch Switch language from top-right corner popup (persistent)
๐Ÿ“‹ System Tray Minimize to system tray
๐Ÿ“ Route Management Add, edit, delete, import/export routes
๐Ÿ“Š Usage Dashboard Heatmap, charts, and statistics

๐Ÿš€ Quick Start

Download

๐Ÿ“ฅ Download Latest Release

Available Builds:

  • anyproxyai-windows-amd64.exe - Windows x64
  • anyproxyai-windows-arm64.exe - Windows ARM64
  • anyproxyai-linux-amd64 - Linux x64
  • anyproxyai-linux-arm64 - Linux ARM64
  • anyproxyai-darwin-amd64.zip - macOS Intel
  • anyproxyai-darwin-arm64.zip - macOS Apple Silicon

Windows

  1. Download anyproxyai-windows-amd64.exe
  2. Run the executable
  3. Allow firewall access if prompted

macOS

  1. Download anyproxyai-darwin-arm64.zip (Apple Silicon) or anyproxyai-darwin-amd64.zip (Intel)
  2. Extract and move anyproxyai.app to Applications
  3. First run: Right-click โ†’ Open (bypass Gatekeeper)

Linux

chmod +x anyproxyai-linux-amd64
./anyproxyai-linux-amd64

Setup

1. Add API Route

Click "ๆทปๅŠ ่ทฏ็”ฑ" (Add Route) and configure:

Field Description Example
Name Friendly name GPT-4 Turbo
Model Model identifier gpt-4-turbo
API URL Backend API URL https://api.openai.com
API Key Your API key sk-xxx...
Group Optional grouping OpenAI
Format API format type openai / claude / gemini

2. Configure Your Application

Use the local proxy endpoint in your application:

OpenAI Compatible:

API Base URL: http://localhost:5642/api
API Key: (use the key shown on home page, or any value if auth is disabled)

Claude/Anthropic:

API Base URL: http://localhost:5642/api/anthropic
API Key: (use the key shown on home page, or any value if auth is disabled)

Claude Code:

API Base URL: http://localhost:5642/api/claudecode
API Key: (use the key shown on home page, or any value if auth is disabled)

Gemini:

API Base URL: http://localhost:5642/api/gemini
API Key: (use the key shown on home page, or any value if auth is disabled)

Cursor IDE:

API Base URL: http://localhost:5642/api/cursor/v1
API Key: (use the key shown on home page, or any value if auth is disabled)

Note about Cursor IDE: Cursor uses OpenAI-compatible endpoints but with Anthropic/Claude-style tool definitions and message formats. AnyProxyAi automatically detects and converts Cursor's format to standard OpenAI format, so you can use any OpenAI-compatible backend with Cursor.

Note: The API Key shown on the home page is used for authentication. If you want to disable authentication, set local_api_key to empty string in config.json.

3. Use Proxy Redirect (Optional)

Enable redirect and set proxy_auto as your model name to automatically route to your configured target model.

๐Ÿ“– Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Your App       โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚                 AnyProxyAi                          โ”‚
โ”‚  (Any SDK)      โ”‚     โ”‚  localhost:5642                                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚                                                     โ”‚
                        โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
                        โ”‚  โ”‚              API Router                      โ”‚   โ”‚
                        โ”‚  โ”‚  /api/v1/*        โ†’ OpenAI format           โ”‚   โ”‚
                        โ”‚  โ”‚  /api/cursor/*    โ†’ Cursor IDE format       โ”‚   โ”‚
                        โ”‚  โ”‚  /api/anthropic/* โ†’ Claude format           โ”‚   โ”‚
                        โ”‚  โ”‚  /api/claudecode/*โ†’ Claude Code format      โ”‚   โ”‚
                        โ”‚  โ”‚  /api/gemini/*    โ†’ Gemini format           โ”‚   โ”‚
                        โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
                        โ”‚                        โ”‚                            โ”‚
                        โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
                        โ”‚  โ”‚           Format Adapters                      โ”‚ โ”‚
                        โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”‚ โ”‚
                        โ”‚  โ”‚  โ”‚ OpenAI   โ”‚ โ”‚ Claude   โ”‚ โ”‚ Gemini   โ”‚       โ”‚ โ”‚
                        โ”‚  โ”‚  โ”‚ Adapter  โ”‚ โ”‚ Adapter  โ”‚ โ”‚ Adapter  โ”‚       โ”‚ โ”‚
                        โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ”‚ โ”‚
                        โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                 โ”‚ โ”‚
                        โ”‚  โ”‚  โ”‚ Cursor   โ”‚ (Auto-detect & convert)         โ”‚ โ”‚
                        โ”‚  โ”‚  โ”‚ Adapter  โ”‚                                 โ”‚ โ”‚
                        โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                 โ”‚ โ”‚
                        โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
                        โ”‚                        โ”‚                            โ”‚
                        โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
                        โ”‚  โ”‚           Backend Routes (Cloud)               โ”‚ โ”‚
                        โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”‚ โ”‚
                        โ”‚  โ”‚  โ”‚ OpenAI   โ”‚ โ”‚ Claude   โ”‚ โ”‚ Gemini   โ”‚       โ”‚ โ”‚
                        โ”‚  โ”‚  โ”‚ Cloud    โ”‚ โ”‚ Cloud    โ”‚ โ”‚ Cloud    โ”‚       โ”‚ โ”‚
                        โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ”‚ โ”‚
                        โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Request Flow

  1. Receive Request: Local proxy receives API request
  2. Route Matching: Find matching route by model name
  3. Format Detection: Detect source format from request path
  4. Adapter Selection: Choose appropriate adapter based on route format
  5. Request Transformation: Convert request to target format
  6. Backend Call: Forward to actual API endpoint
  7. Response Transformation: Convert response back to source format
  8. Statistics: Log request metrics

Adapter Matrix

Source โ†’ Target OpenAI Claude Gemini
OpenAI Pass-through claude-to-openai gemini-to-openai
Claude openai-to-claude Pass-through gemini-to-claude
Gemini openai-to-gemini claude-to-gemini Pass-through

๐Ÿ”ง Configuration

config.json

{
  "host": "localhost",
  "port": 5642,
  "database_path": "routes.db",
  "local_api_key": "sk-local-default-key",
  "redirect_enabled": true,
  "redirect_keyword": "proxy_auto",
  "redirect_target_model": "gpt-4-turbo",
  "minimize_to_tray": true,
  "auto_start": false
}

Route Configuration

Routes are stored in SQLite database (routes.db) with the following schema:

Field Type Description
name TEXT Display name
model TEXT Model identifier (used for routing)
api_url TEXT Backend API base URL
api_key TEXT API authentication key
group TEXT Optional grouping
format TEXT API format: openai, claude, gemini
enabled INTEGER 1=enabled, 0=disabled

๐Ÿ› ๏ธ Development

Requirements

  • Go 1.22+
  • Node.js 18+

Development Mode

# Install frontend dependencies
cd frontend && npm install && cd ..

# Run directly with Go
go run .

Build

# Build for current platform
go build -o anyproxyai .

# Or use the build script
./build.sh        # Linux/macOS
build.bat         # Windows

Project Structure

anyproxyai/
โ”œโ”€โ”€ main.go                    # Application entry, Wails bindings
โ”œโ”€โ”€ wails.json                 # Wails configuration
โ”œโ”€โ”€ config.json                # Runtime configuration
โ”‚
โ”œโ”€โ”€ internal/                  # Go backend modules
โ”‚   โ”œโ”€โ”€ adapters/              # API format converters
โ”‚   โ”‚   โ”œโ”€โ”€ adapter.go         # Adapter interface
โ”‚   โ”‚   โ”œโ”€โ”€ anthropic.go       # Claude adapter
โ”‚   โ”‚   โ”œโ”€โ”€ gemini.go          # Gemini adapter
โ”‚   โ”‚   โ”œโ”€โ”€ openai_to_claude.go
โ”‚   โ”‚   โ”œโ”€โ”€ claude_to_openai.go
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ config/                # Configuration management
โ”‚   โ”œโ”€โ”€ database/              # SQLite database
โ”‚   โ”œโ”€โ”€ router/                # HTTP router (Gin)
โ”‚   โ”œโ”€โ”€ service/               # Business logic
โ”‚   โ”‚   โ”œโ”€โ”€ proxy_service.go   # Proxy & streaming
โ”‚   โ”‚   โ””โ”€โ”€ route_service.go   # Route management
โ”‚   โ””โ”€โ”€ system/                # System tray, autostart
โ”‚
โ””โ”€โ”€ frontend/                  # Vue 3 frontend
    โ”œโ”€โ”€ src/
    โ”‚   โ”œโ”€โ”€ App.vue            # Main application
    โ”‚   โ”œโ”€โ”€ i18n/              # Internationalization
    โ”‚   โ””โ”€โ”€ components/        # UI components
    โ””โ”€โ”€ wailsjs/               # Wails bindings

๐Ÿ”จ GitHub Actions Build

This project uses GitHub Actions for automated multi-platform builds.

Trigger Build

Builds are triggered in the following ways:

Trigger Build Release Example
package(...) commit โœ… โŒ git commit -m "package(build): fix issue"
tag(vX.X.X): message commit โœ… โœ… git commit -m "tag(v1.0.0): Initial release"
Push tag v* โœ… โœ… git tag v1.0.0 && git push origin v1.0.0
Pull Request โœ… โŒ PR to main/master
Manual trigger โœ… โŒ workflow_dispatch

Quick Release (Recommended)

Use tag(version): description format in your commit message to automatically build, create tag, and publish release:

# This will: build all platforms โ†’ create tag v1.0.0 โ†’ publish release with description
git commit -m "tag(v1.0.0): Initial release with multi-format API support"
git push origin main

The release description will be automatically filled with the text after the colon.

Build Only (No Release)

Use package(...) prefix for build-only commits:

git commit -m "package(build): fix linux arm64 build"
git push origin main

Download Artifacts

  1. Go to Actions tab in GitHub repository
  2. Click on the completed workflow run
  3. Download individual artifacts:
    • anyproxyai-windows-amd64
    • anyproxyai-windows-arm64
    • anyproxyai-linux-amd64
    • anyproxyai-linux-arm64
    • anyproxyai-darwin-amd64
    • anyproxyai-darwin-arm64

โ“ FAQ

Installation

Q: Windows shows security warning? A: Click "More info" โ†’ "Run anyway". The app is not code-signed.

Q: macOS shows "cannot be opened" error? A: Right-click โ†’ Open โ†’ Open. Or allow in System Preferences โ†’ Security & Privacy.

Q: Port 5642 is already in use? A: Edit config.json and change the port value, or change it in Settings page.

Usage

Q: How does format conversion work? A: The proxy detects the incoming request format from the URL path and converts it to the target format based on the route's format setting.

Q: What is proxy_auto? A: A special keyword that redirects to your configured target model, allowing you to use a single model name across different applications.

Q: Are token counts accurate? A: Token counts are estimates based on response data. Actual billing may differ.

Q: How to switch language? A: Click the language icon in the top-right corner to open the language switch popup. The setting is persistent.

Development

Q: How to add a new adapter? A: Implement the Adapter interface in internal/adapters/ and register it in adapter.go.

๐Ÿ™ References

This project was inspired by and references the following projects:

๐Ÿ“„ License

This project is open source under the MIT License.


Made with โค๏ธ and Claude AI From China

About

๐Ÿš€ AnyProxyAi - Universal AI API Gateway GUI | ้€š็”จ AI API ็ฝ‘ๅ…ณ GUI - Route, convert and manage multiple AI provider APIs (OpenAI, Claude, Gemini) through a single unified interface. ้€š่ฟ‡ๆœฌๅœฐ็ปŸไธ€ๆŽฅๅฃ่ทฏ็”ฑใ€่ฝฌๆขๅ’Œ็ฎก็†ๅคšไธช AI ๆœๅŠกๅ•† API็›ธไบ’่ฝฌๆขใ€‚Built with Wails + Vue 3.

Topics

Resources

License

Stars

Watchers

Forks