|
6 | 6 |
|
7 | 7 | [](https://golang.org/) |
8 | 8 | [](LICENSE) |
9 | | -[](https://github.com/systemime/coding-plan-mask) |
| 9 | +[](https://github.com/systemime/coding-plan-mask) |
10 | 10 |
|
11 | 11 | *Use your Coding Plan subscription with ANY OpenAI-compatible coding tool* |
12 | 12 |
|
@@ -71,22 +71,22 @@ Download the binary for your platform from [GitHub Releases](https://github.com/ |
71 | 71 |
|
72 | 72 | ```bash |
73 | 73 | # Linux amd64 |
74 | | -wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.3/mask-ctl-linux-amd64 |
| 74 | +wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.4/mask-ctl-linux-amd64 |
75 | 75 | chmod +x mask-ctl-linux-amd64 |
76 | 76 | sudo mv mask-ctl-linux-amd64 /usr/local/bin/mask-ctl |
77 | 77 |
|
78 | 78 | # Linux arm64 |
79 | | -wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.3/mask-ctl-linux-arm64 |
| 79 | +wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.4/mask-ctl-linux-arm64 |
80 | 80 | chmod +x mask-ctl-linux-arm64 |
81 | 81 | sudo mv mask-ctl-linux-arm64 /usr/local/bin/mask-ctl |
82 | 82 |
|
83 | 83 | # macOS (Darwin amd64) |
84 | | -wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.3/mask-ctl-darwin-amd64 |
| 84 | +wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.4/mask-ctl-darwin-amd64 |
85 | 85 | chmod +x mask-ctl-darwin-amd64 |
86 | 86 | sudo mv mask-ctl-darwin-amd64 /usr/local/bin/mask-ctl |
87 | 87 |
|
88 | 88 | # macOS (Darwin arm64) |
89 | | -wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.3/mask-ctl-darwin-arm64 |
| 89 | +wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.4/mask-ctl-darwin-arm64 |
90 | 90 | chmod +x mask-ctl-darwin-arm64 |
91 | 91 | sudo mv mask-ctl-darwin-arm64 /usr/local/bin/mask-ctl |
92 | 92 |
|
@@ -157,6 +157,10 @@ remove_version_path = false |
157 | 157 | mock_models = false |
158 | 158 | # Mock /models response content (JSON string) |
159 | 159 | mock_models_resp = '{"object":"list","data":[{"id":"gpt-4","object":"model","owned_by":"organization"}]}' |
| 160 | +# Anthropic format compatibility mode (default: false) |
| 161 | +# When enabled, fixes null values in JSON Schema (required, enum, items, etc.) |
| 162 | +# Useful for API providers using Anthropic native protocol |
| 163 | +use_anthropic = false |
160 | 164 | ``` |
161 | 165 |
|
162 | 166 | #### 4. Start |
@@ -274,6 +278,7 @@ You can also configure via environment variables: |
274 | 278 | | `REMOVE_VERSION_PATH` | Remove version prefix (e.g., `/v1`) from request path when forwarding (true/false) | |
275 | 279 | | `MOCK_MODELS` | Enable mock /models endpoint response (true/false) | |
276 | 280 | | `MOCK_MODELS_RESP` | Mock /models response content (JSON string) | |
| 281 | +| `USE_ANTHROPIC` | Enable Anthropic format compatibility mode (true/false) | |
277 | 282 |
|
278 | 283 | ### ⚠️ Risk Warning |
279 | 284 |
|
@@ -337,22 +342,22 @@ This project is provided for **educational and research purposes only**. |
337 | 342 |
|
338 | 343 | ```bash |
339 | 344 | # Linux amd64 |
340 | | -wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.3/mask-ctl-linux-amd64 |
| 345 | +wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.4/mask-ctl-linux-amd64 |
341 | 346 | chmod +x mask-ctl-linux-amd64 |
342 | 347 | sudo mv mask-ctl-linux-amd64 /usr/local/bin/mask-ctl |
343 | 348 |
|
344 | 349 | # Linux arm64 |
345 | | -wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.3/mask-ctl-linux-arm64 |
| 350 | +wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.4/mask-ctl-linux-arm64 |
346 | 351 | chmod +x mask-ctl-linux-arm64 |
347 | 352 | sudo mv mask-ctl-linux-arm64 /usr/local/bin/mask-ctl |
348 | 353 |
|
349 | 354 | # macOS amd64 |
350 | | -wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.3/mask-ctl-darwin-amd64 |
| 355 | +wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.4/mask-ctl-darwin-amd64 |
351 | 356 | chmod +x mask-ctl-darwin-amd64 |
352 | 357 | sudo mv mask-ctl-darwin-amd64 /usr/local/bin/mask-ctl |
353 | 358 |
|
354 | 359 | # macOS arm64 |
355 | | -wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.3/mask-ctl-darwin-arm64 |
| 360 | +wget https://github.com/systemime/coding-plan-mask/releases/download/v0.8.4/mask-ctl-darwin-arm64 |
356 | 361 | chmod +x mask-ctl-darwin-arm64 |
357 | 362 | sudo mv mask-ctl-darwin-arm64 /usr/local/bin/mask-ctl |
358 | 363 | ``` |
@@ -419,6 +424,10 @@ remove_version_path = false |
419 | 424 | mock_models = false |
420 | 425 | # 模拟 /models 响应内容 (JSON 字符串) |
421 | 426 | mock_models_resp = '{"object":"list","data":[{"id":"gpt-4","object":"model","owned_by":"organization"}]}' |
| 427 | +# Anthropic 格式兼容模式 (默认: false) |
| 428 | +# 启用后会修复请求体中的 schema 字段,将 null 转为正确的默认值 |
| 429 | +# 适用于使用 Anthropic 原生协议的 API 供应商 |
| 430 | +use_anthropic = false |
422 | 431 | ``` |
423 | 432 |
|
424 | 433 | #### 4. 启动 |
@@ -518,6 +527,7 @@ curl http://127.0.0.1:8787/stats |
518 | 527 | | `REMOVE_VERSION_PATH` | 转发时移除请求路径中的版本前缀(如 `/v1`)(true/false) | |
519 | 528 | | `MOCK_MODELS` | 启用模拟 /models 端点响应 (true/false) | |
520 | 529 | | `MOCK_MODELS_RESP` | 模拟 /models 响应内容 (JSON 字符串) | |
| 530 | +| `USE_ANTHROPIC` | 启用 Anthropic 格式兼容模式 (true/false) | |
521 | 531 |
|
522 | 532 | ### ⚠️ 风险预警 |
523 | 533 |
|
|
0 commit comments