@@ -57,16 +57,26 @@ Create a configuration file (such as `api.json`, `api.yaml`, `api.jsonc`, `api.j
5757``` json
5858{
5959 "openrouter" : {
60- "url" : " xxx " ,
60+ "url" : " https://api.openrouter.ai " ,
6161 "token" : " your-auth-token" ,
6262 "model" : " claude-sonnet-4-20250514" ,
6363 "fast" : " claude-3-5-haiku-20241022" ,
64- "timeout" : 120000 ,
65- "tokens" : 20000
64+ "timeout" : 600000 ,
65+ "tokens" : 65000
6666 },
67- "multimodel" : {
68- "url" : " https://api.example.com" ,
69- "key" : " your-api-key" ,
67+ "multiconfig" : {
68+ "url" : [
69+ " https://api.example1.com" ,
70+ " https://api.example2.com"
71+ ],
72+ "key" : [
73+ " sk-key1-for-api1" ,
74+ " sk-key2-for-api2"
75+ ],
76+ "token" : [
77+ " token1-for-auth" ,
78+ " token2-for-auth"
79+ ],
7080 "model" : [
7181 " claude-sonnet-4-20250514" ,
7282 " claude-3-5-haiku-20241022" ,
@@ -88,12 +98,19 @@ openrouter:
8898 token : " your-auth-token"
8999 model : " claude-sonnet-4-20250514"
90100 fast : " claude-3-5-haiku-20241022"
91- timeout : 120000
92- tokens : 20000
93-
94- multimodel :
95- url : " https://api.example.com"
96- key : " your-api-key"
101+ timeout : 600000
102+ tokens : 65000
103+
104+ multiconfig :
105+ url :
106+ - " https://api.example1.com"
107+ - " https://api.example2.com"
108+ key :
109+ - " sk-key1-for-api1"
110+ - " sk-key2-for-api2"
111+ token :
112+ - " token1-for-auth"
113+ - " token2-for-auth"
97114 model :
98115 - " claude-sonnet-4-20250514"
99116 - " claude-3-5-haiku-20241022"
@@ -113,8 +130,8 @@ multimodel:
113130 " token " : " your-auth-token" ,
114131 " model " : " claude-sonnet-4-20250514" , // default model
115132 " fast " : " claude-3-5-haiku-20241022" , // fast model
116- " timeout " : 120000 , // request timeout
117- " tokens " : 20000 // max output tokens
133+ " timeout " : 600000 , // request timeout
134+ " tokens " : 65000 // max output tokens
118135 }
119136}
120137```
@@ -127,12 +144,22 @@ url = "https://api.openrouter.ai"
127144token = " your-auth-token"
128145model = " claude-sonnet-4-20250514"
129146fast = " claude-3-5-haiku-20241022"
130- timeout = 120000
131- tokens = 20000
147+ timeout = 600000
148+ tokens = 65000
132149
133- [multimodel ]
134- url = " https://api.example.com"
135- key = " your-api-key"
150+ [multiconfig ]
151+ url = [
152+ " https://api.example1.com" ,
153+ " https://api.example2.com"
154+ ]
155+ key = [
156+ " sk-key1-for-api1" ,
157+ " sk-key2-for-api2"
158+ ]
159+ token = [
160+ " token1-for-auth" ,
161+ " token2-for-auth"
162+ ]
136163model = [
137164 " claude-sonnet-4-20250514" ,
138165 " claude-3-5-haiku-20241022" ,
@@ -149,16 +176,22 @@ fast = [
149176[ This tool only supports Anthropic format configuration, but anything that works with Claude should be compatible]
150177
151178- ` url ` : API provider server address (required)
179+ - ** String format** : Directly specify a single URL
180+ - ** Array format** : Specify multiple URLs, supports switching via index
152181- ` key ` : API_KEY (at least one of key or token is required)
182+ - ** String format** : Directly specify a single API Key
183+ - ** Array format** : Specify multiple API Keys, supports switching via index
153184- ` token ` : AUTH_TOKEN (at least one of key or token is required)
185+ - ** String format** : Directly specify a single Auth Token
186+ - ** Array format** : Specify multiple Auth Tokens, supports switching via index
154187- ` model ` : Model name (optional, default: claude-sonnet-4-20250514)
155188 - ** String format** : Directly specify a single model
156189 - ** Array format** : Specify multiple models, supports switching via index
157190- ` fast ` : Fast model name (optional, default: claude-3-5-haiku-20241022)
158191 - ** String format** : Directly specify a single fast model
159192 - ** Array format** : Specify multiple fast models, supports switching via index
160193- ` timeout ` : Request timeout in milliseconds (optional, default: 600000ms)
161- - ` tokens ` : Maximum output tokens (optional, default: 25000 )
194+ - ` tokens ` : Maximum output tokens (optional, default: official )
162195- ` http ` : Custom HTTP Proxy Settings (optional)
163196- ` https ` : Custom HTTPS Proxy Settings (optional)
164197
@@ -177,25 +210,33 @@ Available API Configurations:
177210 URL: https://api.openrouter.ai
178211 Model: claude-sonnet-4-20250514
179212 Fast: claude-3-5-haiku-20241022
180- Key: sk-or123 ...
213+ Token: your-auth-token ...
181214
182- * 【multimodel】
183- URL: https://api.example.com
215+ * 【multiconfig】
216+ URL:
217+ * - 1: https://api.example1.com
218+ - 2: https://api.example2.com
184219 Model:
185220 * - 1: claude-sonnet-4-20250514
186221 - 2: claude-3-5-haiku-20241022
187222 - 3: claude-3-opus-20240229
188223 Fast:
189224 - 1: claude-3-5-haiku-20241022
190225 * - 2: claude-3-haiku-20240307
191- Key: sk-abc123...
226+ Key:
227+ * - 1: sk-key1-for-api1...
228+ - 2: sk-key2-for-api2...
229+ Token:
230+ - 1: token1-for-auth...
231+ * - 2: token2-for-auth...
192232```
193233
194234** Display Description:**
195235
196236- Configurations marked with ` * ` indicate currently active configuration
197- - For array format model/fast, index numbers are displayed
198- - Currently used model index is also marked with ` * `
237+ - For array format url/key/token/model/fast, index numbers are displayed
238+ - Currently used items are marked with ` * - ` and highlighted
239+ - Sensitive information (key, token) is automatically masked
199240
200241### 5. Switch Configuration (Remember to restart Claude terminal after successful switch!!!)
201242
@@ -212,22 +253,33 @@ ccapi use anyrouter
212253#### Advanced Switching (for Array Format)
213254
214255``` bash
215- # Switch to multimodel config's 2nd model and 1st fast model
216- ccapi use multimodel -m 2 -f 1
256+ # Switch to multiconfig configuration with specified field indices
257+ ccapi use multiconfig -u 1 -k 2 -t 1 -m 2 -f 2
258+
259+ # Mix different parameters
260+ ccapi use multiconfig -u 2 -m 1 -f 1
217261
218- # Only specify standard model index, fast model uses default (1st)
219- ccapi use multimodel -m 3
262+ # Switch only specific field indices
263+ ccapi use multiconfig -k 1 # Switch Key index only
264+ ccapi use multiconfig -t 2 # Switch Token index only
265+ ccapi use multiconfig -u 1 # Switch URL index only
266+ ccapi use multiconfig -m 3 # Switch Model index only
267+ ccapi use multiconfig -f 2 # Switch Fast Model index only
220268
221- # Only specify fast model index, model uses default (1st)
222- ccapi use multimodel -f 2
269+ # Combination usage examples
270+ ccapi use multiconfig -u 1 -k 1 -t 2 -m 1 -f 2
223271```
224272
225273** Parameter Description:**
226274
275+ - ` -u <index> ` : Specify URL index to use (counting from 1)
276+ - ` -k <index> ` : Specify Key index to use (counting from 1)
277+ - ` -t <index> ` : Specify Token index to use (counting from 1)
227278- ` -m <index> ` : Specify model index to use (counting from 1)
228279- ` -f <index> ` : Specify fast model index to use (counting from 1)
229280- For string format configurations, index parameters are automatically ignored
230281- When no index is specified, defaults to the first element of the array
282+ - You can combine these parameters in any way
231283
232284## System Requirements
233285
0 commit comments