Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a042be8
add socks5 proxy support
inevity Dec 8, 2025
f9c2342
ccr adaptor and debug log
inevity Dec 9, 2025
0bf0962
add ccr transformer for the antigravity2api openai endpoint
inevity Dec 9, 2025
952a1b1
.env log level
inevity Dec 9, 2025
e1d3838
gemini: log callid, so that relate with anti-fix.js log
inevity Dec 9, 2025
3d4e9cc
log: remove tools field
inevity Dec 9, 2025
7e7cef5
log: anthropic debug for tools sections
inevity Dec 9, 2025
090223f
anthropic: fix tools schema
inevity Dec 9, 2025
e57eb66
toolcallid log
inevity Dec 9, 2025
967a1ba
toolcallid missing
inevity Dec 10, 2025
ba1e7e4
think signature missing fix 1
inevity Dec 10, 2025
9c92eb4
claude adaptor
inevity Dec 10, 2025
f7a985a
claude adaptor hide think signature
inevity Dec 10, 2025
26ab2dc
log: clean
inevity Dec 10, 2025
30257d6
claude working now
inevity Dec 10, 2025
df3d8c6
add id for anti-fixer
inevity Dec 10, 2025
9993f59
update README
inevity Dec 10, 2025
3a3c13a
update README
inevity Dec 10, 2025
7450b16
use structive thinking events
inevity Dec 10, 2025
bb875bb
use structive thinking events
inevity Dec 10, 2025
d0fa066
raw
inevity Dec 10, 2025
9f2c7ca
fix claude cache concrl
inevity Dec 10, 2025
fc7eed3
google ai pro config
inevity Dec 10, 2025
0294911
anti: update .env.example
inevity Dec 11, 2025
0912173
anti: sync anti-fixer.js plugin
inevity Dec 11, 2025
709fac9
anti: update README
inevity Dec 11, 2025
1494719
anti: update README
inevity Dec 11, 2025
5f79f51
model switch for antigravity between claude and gemini thinking
inevity Dec 13, 2025
e8a1f8e
log: clean
inevity Dec 13, 2025
5c132aa
log: clean1
inevity Dec 13, 2025
a14520b
support model switch between gemini-think and claude-think
inevity Dec 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ JWT_SECRET=your-jwt-secret-key-change-this-in-production

# 可选配置
# PROXY=http://127.0.0.1:7897
# PROXY=socks5://127.0.0.1:1080
SYSTEM_INSTRUCTION=你是聊天机器人,名字叫萌萌,如同名字这般,你的性格是软软糯糯萌萌哒的,专门为用户提供聊天和情绪价值,协助进行小说创作或者角色扮演
# IMAGE_BASE_URL=http://your-domain.com
#LOG_LEVEL=debug
LOG_LEVEL=warn

34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# ADD and FIX

* You should never expose http port to internet.

添加功能
* manual switch think model(gemini/claue) by CCR while keeping cladue conversation history
* socks5支持
* log level 调试
* ccr配置,支持gemini和cluade模型,只测试了思考模型。
* fix gemini-3-pro-high等模型的小bug
* src/anti-fixer.js 是ccr需要的插件.
```json
{
"name": "anti-ai",
"api_base_url": "http://xxx.com:8045/v1/chat/completions",
"api_key": "sk-xxx",
"models": ["gpt-oss-120b-medium", "gemini-2.5-flash-thinking", "claude-sonnet-4-5", "gemini-3-pro-low", "gemini-3-pro-high","gemini-2.5-flash", "chat_23310", "rev19-uic3-1p", "chat_20706", "gemini-2.5-flash-lite", "gemini-3-pro-image", "claude-sonnet-4-5-thinking", "gemini-2.5-pro", "gemini-2.5-flash-image", "claude-opus-4-5-thinking", "claude-opus-4-5"],
"transformer": { "use": ["anti-payload-fixer"] }

},
```

* now structive thinking events now show think text in the conversation history.

* fix gemini
* fix subtl bug for claude messages.1.content.0.thinking.cache_control: Extra inputs are not permitted


# Antigravity to OpenAI API 代理服务

将 Google Antigravity API 转换为 OpenAI 兼容格式的代理服务,支持流式响应、工具调用和多账号管理。
Expand Down Expand Up @@ -46,6 +74,7 @@ JWT_SECRET=your-jwt-secret-key-change-this-in-production

# 可选配置
# PROXY=http://127.0.0.1:7897
# PROXY=socks5://127.0.0.1:1080
# SYSTEM_INSTRUCTION=你是聊天机器人
# IMAGE_BASE_URL=http://your-domain.com
```
Expand Down Expand Up @@ -303,7 +332,7 @@ curl http://localhost:8045/v1/chat/completions \
| `ADMIN_USERNAME` | 管理员用户名 | ✅ |
| `ADMIN_PASSWORD` | 管理员密码 | ✅ |
| `JWT_SECRET` | JWT 密钥 | ✅ |
| `PROXY` | 代理地址(如:http://127.0.0.1:7897 | ❌ |
| `PROXY` | 代理地址,支持 `http`/`https`/`socks5`(如:`http://127.0.0.1:7897` 或 `socks5://127.0.0.1:1080`)<br>若使用 SOCKS 代理会自动切换到 axios 模式 | ❌ |
| `SYSTEM_INSTRUCTION` | 系统提示词 | ❌ |
| `IMAGE_BASE_URL` | 图片服务基础 URL | ❌ |

Expand Down Expand Up @@ -356,8 +385,7 @@ npm run login
│ │ ├── logger.js # 日志模块
│ │ └── utils.js # 工具函数
│ └── AntigravityRequester.js # TLS 指纹请求器封装
├── test/
│ ├── test-request.js # 请求测试
├── test/│ ├── test-request.js # 请求测试
│ └── test-transform.js # 转换测试
├── .env # 环境变量配置(敏感信息)
├── .env.example # 环境变量配置示例
Expand Down
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
},
"other": {
"timeout": 180000,
"skipProjectIdFetch": false
"skipProjectIdFetch": true
}
}
}
59 changes: 58 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"axios": "^1.13.2",
"dotenv": "^17.2.3",
"express": "^5.1.0",
"jsonwebtoken": "^9.0.2"
"jsonwebtoken": "^9.0.2",
"socks-proxy-agent": "^8.0.5"
},
"engines": {
"node": ">=18.0.0"
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h4>安全配置</h4>
<div class="config-section">
<h4>其他配置</h4>
<div class="form-group"><label>超时时间(ms)</label><input type="number" name="TIMEOUT"></div>
<div class="form-group"><label>代理地址</label><input type="text" name="PROXY" placeholder="http://127.0.0.1:7897"></div>
<div class="form-group"><label>代理地址</label><input type="text" name="PROXY" placeholder="http://127.0.0.1:7897 或 socks5://127.0.0.1:1080"></div>
<div class="form-group"><label>跳过ProjectId验证</label><select name="SKIP_PROJECT_ID_FETCH"><option value="false">否</option><option value="true">是</option></select></div>
<div class="form-group"><label>系统提示词</label><textarea name="SYSTEM_INSTRUCTION" rows="3"></textarea></div>
</div>
Expand Down
12 changes: 2 additions & 10 deletions scripts/oauth-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import log from '../src/utils/logger.js';
import axios from 'axios';
import config from '../src/config/config.js';
import { generateProjectId } from '../src/utils/idGenerator.js';
import { buildAxiosProxyOptions } from '../src/utils/proxy.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down Expand Up @@ -39,16 +40,7 @@ function generateAuthUrl(port) {
}

function getAxiosConfig() {
const axiosConfig = { timeout: config.timeout };
if (config.proxy) {
const proxyUrl = new URL(config.proxy);
axiosConfig.proxy = {
protocol: proxyUrl.protocol.replace(':', ''),
host: proxyUrl.hostname,
port: parseInt(proxyUrl.port)
};
}
return axiosConfig;
return { timeout: config.timeout, ...buildAxiosProxyOptions(config.proxy) };
}

async function exchangeCodeForToken(code, port) {
Expand Down
Loading