> ## Content Index
> Fetch the complete content index at: https://brotherhong.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Grok2API 相关
- URL: https://brotherhong.com/grok2api/
- Published: 2025-11-20T01:00:00.000Z
- Updated: 2026-12-03T10:35:24.000Z
- Description: 汇总 Grok2API 的原理、部署思路和常见问题处理方式。
- Author: 洪哥
- Tags: 平台接入, Grok, API, 反代

如果你在关注 Grok2API 的部署方式和常见问题，这篇可以作为总入口。

## 403 错误的解决方法

> 来源：群友孤貍

![SSH 隧道建立示意](https://brotherhong.com/content/images/2026/12/grok2api-image-01.png)

![Chrome 代理配置示意](https://brotherhong.com/content/images/2026/12/grok2api-image-02.png)

由于 Grok2API 是逆向的网页端对话服务，需要用你服务器的流量通过 Cloudflare 的浏览器验证。具体步骤：

1. **建立 SSH 隧道**：用 SSH 在本机和服务器之间建立 SOCKS 代理，指定一个本地端口。
2. **通过代理启动 Chrome**：用命令行启动 Chrome，设置它走该代理端口，这样所有流量都会经过服务器。
3. **访问 Grok**：在此 Chrome 中打开 [grok.com](http://grok.com)，完成 Cloudflare 人机验证。
4. **提取 Cookie**：按 F12 打开开发者工具 → Application 面板 → 左侧 Cookies → 找到 `cf` 开头的条目 → 复制其 value 值。
5. **填入 Cookie**：将复制的值粘贴到指定位置（红框处）。
6. **完成**：关闭 Chrome 和 SSH 隧道。