docs/user-manual/en/4-proxy/4.1-service.md
The proxy service starts a local HTTP proxy through which all API requests are forwarded.
Primary uses:
Click the Proxy Toggle button at the top of the main interface.
Toggle states:
| Setting | Description | Default |
|---|---|---|
| Listen Address | IP address the proxy binds to | 127.0.0.1 |
| Listen Port | Port the proxy listens on | 15721 |
| Enable Logging | Whether to record request logs | Enabled |
Modifying address/port requires stopping the proxy service first
| Address | Description |
|---|---|
127.0.0.1 | Only accessible from local machine (recommended) |
0.0.0.0 | Allow LAN access |
When the proxy is running, the panel displays the following information:
http://127.0.0.1:15721
Click the "Copy" button to copy the address.
Displays the currently used provider for each app:
Claude: PackyCode
Codex: AIGoCode
Gemini: Google Official
| Metric | Description |
|---|---|
| Active Connections | Number of requests currently being processed |
| Total Requests | Total number of requests since startup |
| Success Rate | Percentage of successful requests (>90% green, <=90% yellow) |
| Uptime | How long the proxy has been running |
The proxy panel displays the failover queue by app type:
Claude
├── 1. PackyCode [Currently Using] ●
├── 2. AIGoCode ●
└── 3. Backup Provider ○
Codex
├── 1. AIGoCode [Currently Using] ●
└── 2. Backup Provider ●
Queue details:
sequenceDiagram
participant CLI as CLI Tool (Claude)
participant Proxy as Local Proxy (CC Switch)
participant API as API Provider (Anthropic)
participant DB as Data Store (Logger)
CLI->>Proxy: Send API request
Proxy->>DB: Record request log / track usage
Proxy->>API: Forward request
API-->>Proxy: Return response
Proxy-->>CLI: Return response
After starting the proxy and enabling app takeover, CC Switch modifies app configurations:
Claude:
{
"env": {
"ANTHROPIC_BASE_URL": "http://127.0.0.1:15721"
}
}
Codex:
base_url = "http://127.0.0.1:15721/v1"
Gemini:
GOOGLE_GEMINI_BASE_URL=http://127.0.0.1:15721
The proxy supports automatic API format conversion for providers configured with non-Anthropic formats. This allows you to use providers that only support OpenAI-compatible APIs with Claude Code.
| Provider API Format | Proxy Behavior |
|---|---|
| Anthropic Messages | Pass-through (no conversion) |
| OpenAI Chat Completions | Converts Anthropic requests to OpenAI Chat format and responses back |
| OpenAI Responses API | Converts Anthropic requests to OpenAI Responses format and responses back |
The API format is configured per-provider in the Advanced Options when adding or editing a Claude provider.
Note: Format conversion requires the proxy to be running with app takeover enabled. The conversion handles both streaming and non-streaming requests.
Click the proxy toggle button to turn it off.
Turn off the toggle in the proxy service panel.
When stopping the proxy, CC Switch will:
Enable the "Enable Logging" toggle in the proxy panel.
Each request record includes:
| Field | Description |
|---|---|
| Time | Request time |
| App | Claude / Codex / Gemini |
| Provider | Provider used |
| Model | Requested model |
| Tokens | Input/output token count |
| Latency | Request duration |
| Status | Success/failure |
View request logs in the "Settings > Usage" tab.
Error message: Address already in use
Solution:
Check:
Possible causes:
Solutions: