You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a configuration file (such as `api.json`, `api.yaml`, `api.json5` or `api.toml`) with the following format:
67
70
68
-
**JSON Format Example:**
71
+
**JSON5 Format Example:**
69
72
70
73
```json5
71
74
{
@@ -287,29 +290,43 @@ ccapi ping openrouter
287
290
Test whether gateway API configurations are available in Claude Code, which can truly reflect whether configurations are effective
288
291
289
292
```bash
290
-
# Test all configurations
293
+
# Test all configurations (default uses API mock method, fast)
291
294
ccapi test
292
295
293
-
# Test specific configuration
296
+
# Test specific configuration (default uses API mock method)
294
297
ccapi test openrouter
298
+
299
+
# Use Claude Code CLI method for testing (more accurate but slower)
300
+
ccapi test -c
301
+
ccapi test -c openrouter
302
+
303
+
# Test using specific Key or Token index
304
+
ccapi test openrouter -k 1 # Use 1st Key
305
+
ccapi test openrouter -t 2 # Use 2nd Token
295
306
```
296
307
297
-
**Test Description:**
308
+
**Test Method Description:**
309
+
310
+
- **Default Method**: Uses API mock method, directly simulates Claude CLI request headers, fast (2-3 seconds), supports retry mechanism
311
+
- **CLI Method** (`-c` option): Uses real Claude Code CLI environment, highest accuracy but slower (40-50 seconds)
312
+
313
+
**Configuration Description:**
298
314
299
315
- **ping test timeout**: Defaults to 5 seconds, can be controlled by adding timeout variable in ~/.ccapi-config.json file, e.g.: pingTimeout: 5000
300
-
- **test timeout**: Defaults to 60 seconds, can be controlled by adding timeout variable in ~/.ccapi-config.json file, e.g.: testTimeout: 60000 (This test requires waiting for Claude Code response, may take longer, recommended to set timeout higher)
301
-
- **Test result response**: Not displayed by default. Since different providers return different results, response results are for reference only. Can enable result display by adding variable in ~/.ccapi-config.json file, e.g.: testResponse: true
316
+
- **test timeout**: Defaults to 30 seconds (API mock method) or 60 seconds (CLI method), can be controlled by adding timeout variable in ~/.ccapi-config.json file, e.g.: testTimeout: 30000
317
+
- **Test result response**: Displayed by default. Since different providers return different results, response results are for reference only. Can enable result display by adding variable in ~/.ccapi-config.json file, e.g.: testResponse: true
318
+
- **Test concurrency in cli mode**: The default value is 3. Due to the high performance consumption of cli mode testing, batch testing is adopted. If all test results are timed out, it is recommended to set a smaller value and extend the timeout period.
- For array format URLs, all URL addresses will be tested, array configuration URLs will not be sorted by latency internally, maintaining original URL order
314
331
- Configurations sorted by best latency, lowest latency configurations appear first
315
332
- Shows optimal route (fastest URL address) for each configuration
@@ -442,10 +459,10 @@ This file is the configuration file used by ccapi, where you can configure optio
0 commit comments