Skip to content

修复 Grok app-chat 请求兼容性Fix Grok app-chat anti-bot compatibility#565

Closed
whucalrence wants to merge 1 commit into
chenyme:mainfrom
whucalrence:fix-grok-antibot-headers
Closed

修复 Grok app-chat 请求兼容性Fix Grok app-chat anti-bot compatibility#565
whucalrence wants to merge 1 commit into
chenyme:mainfrom
whucalrence:fix-grok-antibot-headers

Conversation

@whucalrence
Copy link
Copy Markdown

说明

本次更新主要修复 Grok app-chat 网页端接口在部分环境下返回 upstream 403 的问题:

Chat upstream returned 403
Request rejected by anti-bot rules.

## 主要改动

- 新增可选配置 proxy.statsig_id,允许用户在本地配置浏览器请求中的 x-statsig-id。
- 调整 app-chat 请求 headers,使其更接近当前 Grok 网页端请求格式。
- 修正 sec-ch-ua 和 Chrome 版本号解析逻辑。
- 调整 app-chat payload,匹配当前 Grok 网页端请求结构。
- 用户消息不再额外添加 [user]: 前缀,避免和网页端真实输入格式不一致。
- README 增加 x-statsig-id 配置说明、FlareSolverr clearance 说明和隐私提醒。

## 隐私说明

本次提交不包含任何私人凭据或真实会话值,包括:

- SSO / sso-rw
- cf_clearance
- __cf_bm
- 真实 x-statsig-id
- API Key
- 管理后台密码

proxy.statsig_id 默认值为空,用户需要时可自行从自己的浏览器请求中复制并配置。

Alpenl added a commit to Alpenl/grok2api that referenced this pull request Jun 2, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@whucalrence whucalrence closed this Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant