Claude CLI Integration Guide
Connect Claude CLI to WOX models
Claude CLI Integration Guide
Connect Claude CLI to WOX models
Connecting Claude CLI to WOX Models
1. Overview
This guide explains how to connect Claude CLI to WOX models through CC-Switch.
Once configured, Claude CLI can route requests through CC-Switch to the WOX API gateway and use WOX text models for local agent or coding tasks.
2. Prerequisites
Before you begin, make sure you have:
- Claude CLI installed.
- CC-Switch installed.
- A valid WOX API key.
- A network connection that can access the WOX API gateway.
- The name of the model you want to use.
This guide is based on CC-Switch v3.16.1.
Download CC-Switch:
https://github.com/farion1231/cc-switch/releases
3. Get a WOX API Key
Open the WOX platform:
After signing in, open the API Keys page, create an API key, and copy it.
4. Open CC-Switch
Launch CC-Switch.
In the top toolbar, select:
Claude CLIThis option configures the model proxy for Claude CLI.
5. Add a New Provider
Click the plus button in the upper-right corner to add a new provider.
For the provider type, select:
Claude ProviderThen select:
Custom Provider
This indicates that you want to use a custom model provider.
6. Enter the API Key
In the API Key field, enter the API key you obtained from the WOX platform.
Example:
YOUR_API_KEY
In most cases, you do not need to add the Bearer prefix manually unless the tool explicitly asks for the complete Authorization header.
7. Configure the Request URL
Enter the following request URL:
https://api.wox.lol/v1
This URL forwards Claude CLI model requests to the WOX API gateway.
8. Select the API Format
For the API format, select:
OpenAI Chat CompletionsThis format is intended for OpenAI-compatible API integrations.
9. Configure the Authentication Field
Use the default authentication field.
If you need to configure it manually, use:
ANTHROPIC_AUTH_TOKEN10. Fetch the Model List and Configure Model Mapping
Click Fetch Model List to verify that CC-Switch can connect to the WOX API gateway.
After the model list loads, map the Claude CLI models to WOX text models.
Recommended mapping:
Sonnet -> YOUR_MODEL_ID
Opus -> YOUR_MODEL_ID
Haiku -> YOUR_MODEL_IDYou can also select other available models based on your needs.
11. Add Custom Parameters
To prevent incompatible parameters from causing model requests to fail, add the following custom parameter configuration:
{
"allowed_openai_params": ["thinking", "context_management"],
"litellm_settings": {
"drop_params": true
}
}This configuration:
- Allows the specified OpenAI parameters to pass through.
- Automatically drops unknown parameters that the model does not support.
- Improves compatibility when Claude CLI calls an OpenAI-compatible API through a proxy.
12. Save the Provider Configuration
After confirming that the API key, request URL, API format, model mapping, and custom parameters are correct, click Save or Add.
Once saved, the WOX configuration will appear in the provider list.
13. Enable CC-Switch Routing
Click the settings button in the upper-left corner of CC-Switch to open the routing settings.
Select:
RouteThen enable:
Local RouteIn the local routing settings, enable the Claude routing switch.
14. Enable the WOX Provider
Return to the provider list.
Find the WOX Provider and click Enable.
Once enabled, Claude CLI requests will be forwarded through CC-Switch to the WOX API gateway.
15. Verify the Configuration
Open Claude CLI and run a test conversation or coding task.
If everything is configured correctly, Claude CLI should return responses from the WOX model normally.
16. Troubleshooting
1. Unable to Fetch the Model List
Check that the API Base URL is correct:
https://api.wox.lol/v1
Also confirm that your API key is valid.
2. Authentication Fails
Check that you entered the API key correctly.
In most cases, enter only the key itself; you do not need to add the Bearer prefix manually.
3. Request Errors or Incompatible Parameters
Confirm that you added the following compatibility configuration:
{
"allowed_openai_params": ["thinking", "context_management"],
"litellm_settings": {
"drop_params": true
}
}4. Claude CLI Is Not Using the WOX Model
Check that CC-Switch local routing is enabled and that the Claude routing switch is on.
5. Unexpected Model Responses
Check that the model mapping is correct.
Start by testing with the following model:
YOUR_MODEL_ID