AI Skill Hub 推荐使用:Pi反重力轮转代理 是一款优质的Agent工作流。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的Agent工作流解决方案,这是一个值得深入了解的选择。
Pi反重力轮转代理 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
Pi反重力轮转代理 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:npm 全局安装 npm install -g pi-antigravity-rotator # 方式二:npx 直接运行(无需安装) npx pi-antigravity-rotator --help # 方式三:项目依赖安装 npm install pi-antigravity-rotator # 方式四:从源码运行 git clone https://github.com/tuxevil/pi-antigravity-rotator cd pi-antigravity-rotator npm install npm start
# 命令行使用
pi-antigravity-rotator --help
# 基本用法
pi-antigravity-rotator [options] <input>
# Node.js 代码中使用
const pi_antigravity_rotator = require('pi-antigravity-rotator');
const result = await pi_antigravity_rotator.run(options);
console.log(result);
# pi-antigravity-rotator 配置说明 # 查看配置选项 pi-antigravity-rotator --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export PI_ANTIGRAVITY_ROTATOR_CONFIG="/path/to/config.yml"
Multi-account rotation proxy for Google Antigravity. Distributes API usage across multiple Google accounts with per-model routing, real-time quota tracking, automatic token management, and infringement detection.
⚠️ WARNING: Using this proxy may put connected Google accounts at risk of Terms of Service enforcement, including restriction, suspension, or permanent bans. Use at your own risk.
<details> <summary><strong>⚠️ Terms of Service Warning — Read Before Installing</strong></summary>
[!CAUTION] This is an unofficial tool and is not endorsed by Google. Routing traffic through this proxy may violate Google's Terms of Service or trigger automated abuse or policy enforcement systems. By using this proxy, you acknowledge: - Your account may be restricted, suspended, shadow-banned, or permanently banned - Multi-account rotation and proxying can increase account risk compared to normal interactive usage - You assume all responsibility for the accounts and traffic routed through this tool Recommendation: Do not use your primary Google account. Prefer disposable or lower-risk accounts, and keep account exposure conservative.
</details>
pi-antigravity-rotator doctor for config/state validation.tier metadata and runtime healthScore.PI_ROTATOR_ADMIN_TOKEN./v1/chat/completions and Anthropic-compatible /v1/messages APIs. Features comprehensive OpenAI Responses API compatibility (/v1/responses), enabling seamless integration with advanced agentic systems like Codex.fresh/7d/5h) is evaluated per model using each model's actual resetTime from the quota API, not a per-account estimate429, stops the current request and avoids cascade-burning sibling accountsfresh window starts globally, then selectively allow specific accounts to override that policygemini-3.5-flash-high), interleaved reasoning/thinking blocks are streamed back in real-time as OpenAI reasoning_content chunks. This lets Codex inspect the model's inner thoughts before it acts.functionCalls and returned back to Codex safely, enabling full agentic capabilities. Multi-turn tool conversations work correctly for all models including Claude (claude-sonnet-4-6, claude-opus-4-6-thinking) — parallel tool calls are batched into a single turn and tool results are properly grouped to satisfy Claude's strict tool_use/tool_result ordering requirements.web_search) proactively to ensure Codex doesn't hit unexpected runtime exceptions.export PI_ROTATOR_ADMIN_TOKEN="change-me"
```bash npm install -g pi-antigravity-rotator
docker compose up -d
The included compose file persists runtime data under ./docker-data and sets PI_ROTATOR_DIR=/data.
```bash git clone https://github.com/tuxevil/pi-antigravity-rotator.git cd pi-antigravity-rotator npm install
Config files (accounts.json, state.json) are stored in ~/.pi-antigravity-rotator/ by default. Override with:
```bash
export PI_ROTATOR_DIR=/path/to/config export PI_ROTATOR_QUOTA_USER_AGENT="antigravity/1.107.0 darwin/arm64"
export PI_ROTATOR_BIND_HOST="127.0.0.1"
export PI_ROTATOR_MAX_BODY_BYTES=26214400
export PI_ROTATOR_LOG_LEVEL=info
export PI_AI_ANTIGRAVITY_VERSION=1.107.0
| Field | Default | Description |
|---|---|---|
proxyPort | 51200 | Port the proxy listens on |
requestsPerRotation | 5 | Max per-model requests before attempting request-count rotation |
rotateOnQuotaDrop | 20 | Rotate when a model's quota drops this many %. Set to 0 to disable |
quotaPollIntervalMs | 300000 | Quota poll interval in ms (5 minutes) |
maxConcurrentRequestsPerAccount | 1 | Max simultaneous requests allowed per account |
maxConcurrentRequestsPerProjectModel | 1 | Max simultaneous requests allowed across accounts sharing the same projectId for the same quota model |
projectCircuitBreaker429Threshold | 3 | Unique accounts from the same projectId that must hit provider 429 before pausing that project/model |
projectCircuitBreakerWindowMs | 600000 | Rolling window for the project/model 429 circuit breaker |
projectCircuitBreakerCooldownMs | 3600000 | Minimum project/model pause after the circuit breaker trips |
modelCircuitBreaker429Threshold | 3 | Unique accounts across all projects that must hit provider 429 for the same quota model before pausing that model globally |
modelCircuitBreakerCooldownMs | 21600000 | Minimum model-wide pause after the global model circuit breaker trips |
dailyAccountSlowRequests | 250 | Daily upstream attempts per account before slow-mode jitter starts |
dailyAccountStopRequests | 350 | Daily upstream attempts per account before routing stops for that account until the next UTC day |
dailyProjectSlowRequests | 900 | Daily upstream attempts per projectId before slow-mode jitter starts |
dailyProjectStopRequests | 1200 | Daily upstream attempts per projectId before routing stops for that project until the next UTC day |
slowModeJitterMinMs | 8000 | Minimum slow-mode delay before upstream request |
slowModeJitterMaxMs | 25000 | Maximum slow-mode delay before upstream request |
protectivePauseMs | 21600000 | Global routing pause after a serious provider enforcement signal |
useRequestCountRotationWhenQuotaUnknownOnly | true | Use request-count rotation only until quota telemetry exists for the request's model. Set to false to keep rotating by request count even with known quotas |
To connect Codex to your local rotator:
1. Configure the API Base URL: In Codex settings (e.g. in your .codex config or VS Code configuration), set the OpenAI API base URL to point to your rotator's compatibility adapter:
"codex.openai.apiBase": "http://localhost:51200/v1"
(Or set the environment variable OPENAI_BASE_URL=http://localhost:51200/v1 in the workspace shell).
2. Set the API Key / Admin Token: If you have set a PI_ROTATOR_ADMIN_TOKEN for your rotator, configure that token as the API key. Otherwise, any non-empty placeholder string (e.g., sk-antigravity) works:
"codex.openai.apiKey": "your-rotator-admin-token-here"
(Or set the environment variable OPENAI_API_KEY=... in the shell).
3. Select a Supported Model: Configure Codex to target one of the following models supported by the rotator (which will be mapped to the best available Google Antigravity account/model under the hood): - gemini-3.5-flash or gemini-3.5-flash-high / gemini-3.5-flash-low / gemini-3.5-flash-medium (Recommended for fast general reasoning) - gemini-3.1-pro or gemini-pro-agent / gemini-3.1-pro-high / gemini-3.1-pro-low (For deep reasoning) - claude-sonnet-4-6 or claude-opus-4-6-thinking (Claude models via Vertex AI) - gpt-oss-120b or gpt-oss-120b-medium (Open-source GPT model)
Example Codex configuration entry:
"codex.model": "gemini-3.5-flash-high"
pi-antigravity-rotator start --config-dir /path/to/config ```
New v2.0 config fields:
bindHost: interface to bind on. Default: 0.0.0.0.routingPolicy: current default is timer-first. Optional values now include tier-first, quota-first, and hybrid.tokenBucketEnabled: enables the local per-account request bucket used by hybrid. Default: false.tokenBucketMaxTokens: bucket capacity when enabled. Default: 50.tokenBucketRefillPerMinute: refill speed when enabled. Default: 6.tokenBucketInitialTokens: startup fill level when enabled. Default: 50.accounts[].tier: optional ultra, pro, free, or unknown.| Method | Path | Description |
|---|---|---|
GET | /dashboard | Web dashboard |
GET | /login | Hosted account-link landing page |
GET | /api/status | JSON status: accounts, quotas, model routing, flags |
POST | /api/enable/<email> | Re-enable a disabled account after its underlying issue is fixed |
POST | /api/settings/fresh-window-starts/on | Allow opening new idle/fresh windows globally |
POST | /api/settings/fresh-window-starts/off | Block opening new idle/fresh windows globally |
POST | /api/account-fresh-window-starts/<email>/on | Allow one account to override the global fresh-window block |
POST | /api/account-fresh-window-starts/<email>/off | Return one account to the global fresh-window policy |
POST | /api/self-update | Trigger npm self-update to latest version (admin-only) |
POST | /v1internal:streamGenerateContent | Native Antigravity proxy endpoint (used by pi) |
GET | /v1/models | OpenAI-compatible model list |
POST | /v1/responses | OpenAI Responses-compatible create endpoint |
GET | /v1/responses/<id> | Retrieve stored Responses result |
DELETE | /v1/responses/<id> | Delete stored Responses result |
POST | /v1/responses/<id>/cancel | Cancel an in-progress stored Responses result |
GET | /v1/responses/<id>/input_items | List stored input items for a Responses result |
POST | /v1/chat/completions | OpenAI-compatible non-streaming chat adapter |
POST | /v1/messages | Anthropic-compatible non-streaming messages adapter |
If PI_ROTATOR_ADMIN_TOKEN is set, dashboard/API requests must include either Authorization: Bearer <token>, X-Rotator-Admin-Token: <token>, or ?token=<token> for browser dashboard access. The native pi proxy endpoint and compatibility adapters remain unauthenticated so existing clients keep working. Put this service behind a trusted local boundary if exposing beyond localhost/LAN.
Telemetry posts to:
http://telemetry.dragont.ec:3800/v1/events
pi-antigravity-rotator can act as the multi-account rotation backend for agentic frameworks, including Codex executing in VS Code or in the terminal.
Since Codex uses the standard OpenAI Responses API, it can seamlessly route its developer-agent workflows through the rotator.
Account shows flagged status Google detected potential abuse or enforcement. Review the error message on the dashboard and resolve the provider-side block first. Flagged accounts are quarantined and are not re-enabled through /api/enable/<email> until the underlying provider issue is cleared by replacing or restoring the account.
Account keeps getting disabled after 5 errors Check the error message. Common causes: revoked OAuth consent, expired refresh token (re-run npm run login), or Google account suspension.
Quota bars not showing Quota data appears after the first poll cycle (up to 5 minutes). Ensure accounts have valid tokens.
All accounts exhausted If the outage is temporary (cooldown, model breaker, or protective pause), the proxy returns 429 with Retry-After and retryAfterMs; clients must back off. The proxy returns terminal 503 only when there is no known retry time, for example all accounts are disabled/flagged.
Multiple agents on different models This is fully supported. Each model routes independently. Agent 1 using Gemini Pro and Agent 2 using Claude will each have their own active account and won't interfere with each other's rotation.
Pi Antigravity Rotator 是专为 Google Antigravity 设计的多账号轮询代理工具。它能够将 API 请求智能分发至多个 Google 账号,支持按模型路由、实时配额追踪、自动 Token 管理以及违规检测功能。通过该工具,开发者可以实现高效的资源调度,但需注意,使用此类代理可能会面临 Google 服务条款(Terms of Service)的限制或封禁风险。
v2.0 版本带来了重大升级,包含支持导入/导出的全功能 Dashboard 配置编辑器,并提供官方 Docker 和 Docker Compose 部署支持。系统内置 `pi-antigravity-rotator doctor` 命令用于校验配置与状态。在兼容性方面,它不仅支持 OpenAI 兼容的 `/v1/chat/completions` 和 Anthropic 兼容的 `/v1/messages` API,还通过 OpenAI Responses API 兼容性实现了对 Codex 等高级 Agent 系统的无缝集成。此外,针对具备推理能力的模型,系统支持将推理过程以 `reasoning_content` 形式实时流式传输。
在使用前,建议配置 `PI_ROTATOR_ADMIN_TOKEN` 环境变量以确保 Dashboard 和 API 访问的安全。若未设置该 Token,管理路由可能会处于开放状态,存在安全风险。
项目支持多种安装方式:1. 通过 npm 全局安装:`npm install -g pi-antigravity-rotator`;2. 通过源码安装:克隆仓库后执行 `npm install`;3. 使用 Docker 部署(推荐):通过 `docker compose up -d` 快速启动,系统会自动将运行时数据持久化至 `./docker-data` 目录,并将 `PI_ROTATOR_DIR` 设置为 `/data`。
项目提供了 Quick Start 快速入门指南,帮助开发者快速完成从安装到运行的流程。对于高级用户,可以通过 CLI 参数 `--config-dir` 指定特定的配置目录来启动服务。
配置文件(如 `accounts.json` 和 `state.json`)默认存储在 `~/.pi-antigravity-rotator/`。开发者可以通过环境变量 `PI_ROTATOR_DIR` 自定义配置路径,或使用 `PI_ROTATOR_QUOTA_USER_AGENT` 修改 User-Agent。v2.0 版本新增了 `routingPolicy` 参数,支持 `timer-first`、`tier-first`、`quota-first` 及 `hybrid` 等多种路由策略,并可通过 `tokenBucketEnabled` 启用令牌桶限流机制。
系统提供了一系列 API 端点用于管理和监控:`/dashboard` 用于访问 Web 管理面板;`/login` 提供账号绑定落地页;`/api/status` 返回包含账号、配额及模型路由状态的 JSON 数据;`/api/enable/<email>` 用于重新启用被禁用的账号。此外,系统支持将遥测数据(Telemetry)发送至指定的远程端点。
针对常见问题,若账号显示为 `flagged` 状态,通常意味着 Google 检测到了潜在的滥用行为。此类账号会被隔离(Quarantine),在解决供应商端的底层问题之前,无法通过 `/api/enable/<email>` 接口直接重新启用。建议开发者定期通过 Dashboard 查看具体的错误信息并进行排查。
创新的多账户轮转方案,解决AI应用的扩展性问题。代码质量良好,但生态还需完善,维护频率有待提升。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,Pi反重力轮转代理 是一款质量良好的Agent工作流,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | pi-antigravity-rotator |
| 原始描述 | 开源AI工作流:Intelligent multi-account rotation proxy for Google Antigravity with per-model r。⭐11 · TypeScript |
| Topics | 多账户轮转代理管理AI工作流负载均衡 |
| GitHub | https://github.com/tuxevil/pi-antigravity-rotator |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-05-27 · 更新时间:2026-05-30 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端