Claude CLI Integration Guide for Agnes Models
1. Overview
This document explains how to connect Claude CLI to Agnes models through CC-Switch. After the configuration is complete, Claude CLI can route requests through CC-Switch to the Agnes AI API Gateway and use Agnes text models for local Agent tasks or coding tasks.2. Prerequisites
Before you start, make sure you have the following:- Claude CLI installed.
- CC-Switch installed.
- A valid Agnes AI API Key.
- A network environment that can access the Agnes AI API Gateway.
- The target model name you want to use.
3. Get an Agnes API Key
Visit the Agnes AI Platform: https://platform.agnes-ai.com/ After logging in, go to the API Key page, create an API Key, and copy it.4. Open CC-Switch
Launch CC-Switch. In the top toolbar, select:text
5. Add a New Provider
Click the plus button in the upper-right corner to add a new provider. For the provider type, select:text
text
6. Enter the API Key
Enter the API Key obtained from the Agnes AI Platform in the API Key field. Example:text
Bearer prefix unless the tool explicitly requires the full Authorization Header.
7. Configure the Request URL
Enter the following request URL:text
8. Select the API Format
For the API format, select:text
9. Configure the Authentication Field
Use the default authentication field. If manual configuration is required, you can use:text
10. Fetch the Model List and Configure Model Mapping
Click Fetch Model List to check whether CC-Switch can successfully connect to the Agnes AI API Gateway. After the model list is fetched successfully, map the Claude CLI models to Agnes text models. Recommended mapping:text
11. Add Custom Parameters
To avoid incompatible parameters in model requests, it is recommended to add the following configuration to the custom parameters:- Allow the specified OpenAI parameters to pass through.
- Automatically drop unknown parameters that are incompatible with the model.
- Improve compatibility when Claude CLI calls an OpenAI-compatible API through the 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. After the configuration is saved successfully, the Agnes configuration item will appear in the provider list.13. Enable CC-Switch Routing
Click the settings button in the upper-left corner of CC-Switch and go to the routing configuration. Select:text
text
14. Enable the Agnes Provider
Return to the provider list. Find the Agnes Provider and click Enable. After it is enabled, Claude CLI requests will be forwarded through CC-Switch to the Agnes AI API Gateway.15. Verify the Configuration
Open Claude CLI and run a test conversation or coding task. If the configuration is correct, Claude CLI should return responses from the Agnes model normally.16. Troubleshooting
1. Unable to fetch the model list
Check whether the API Base URL is correct:text
2. Authentication failed
Check whether the API Key is entered correctly. In most cases, you only need to enter the key itself. You do not need to manually add theBearer prefix.
3. Request error or incompatible parameters
Confirm that the following compatibility configuration has been added:4. Claude CLI is not using the Agnes model
Check whether CC-Switch local routing is enabled and confirm that the Claude route switch has been turned on.5. Abnormal model responses
Check whether the model mapping is correct. It is recommended to use the following model first:text