autoteam-f-chatgpt-team-rotation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAutoTeam-F ChatGPT Team Rotation & Free Account Generation
AutoTeam-F ChatGPT团队账号轮换与免费账号生成
Skill by ara.so — Daily 2026 Skills collection.
AutoTeam-F is a Python-based tool for automating ChatGPT Team account rotation, batch free Personal account generation, and Codex OAuth authentication sync to CLIProxyAPI (CPA). It uses Playwright for browser automation, FastAPI for the web backend, and Vue 3 for the dashboard.
F = Fix + Free: it fixes blocking bugs from the upstream cnitlrt/AutoTeam and adds batch free-account production.
来自ara.so的技能工具 — 2026每日技能合集。
AutoTeam-F 是一款基于Python的工具,可实现ChatGPT团队账号轮换自动化、批量免费个人账号生成,以及将Codex OAuth认证同步至CLIProxyAPI(CPA)。它使用Playwright进行浏览器自动化,FastAPI作为Web后端,Vue 3构建控制面板。
F = Fix + Free:它修复了上游项目cnitlrt/AutoTeam中的阻塞性Bug,并新增了批量免费账号生成功能。
Installation
安装
Prerequisites
前置要求
- Python 3.10+
- package manager
uv - A deployed cloudflare_temp_email instance (recommended mail backend)
- Python 3.10+
- 包管理器
uv - 已部署的cloudflare_temp_email实例(推荐邮件后端)
Linux
Linux
bash
git clone https://github.com/ZRainbow1275/AutoTeam-F.git
cd AutoTeam-F
bash setup.shbash
git clone https://github.com/ZRainbow1275/AutoTeam-F.git
cd AutoTeam-F
bash setup.shsetup.sh runs: uv sync && uv run playwright install chromium
setup.sh 执行:uv sync && uv run playwright install chromium
undefinedundefinedWindows / macOS
Windows / macOS
bash
git clone https://github.com/ZRainbow1275/AutoTeam-F.git
cd AutoTeam-F
uv sync
uv run playwright install chromiumbash
git clone https://github.com/ZRainbow1275/AutoTeam-F.git
cd AutoTeam-F
uv sync
uv run playwright install chromiumDocker (recommended for production)
Docker(生产环境推荐)
bash
git clone https://github.com/ZRainbow1275/AutoTeam-F.git
cd AutoTeam-F
mkdir -p data && cp .env.example data/.envbash
git clone https://github.com/ZRainbow1275/AutoTeam-F.git
cd AutoTeam-F
mkdir -p data && cp .env.example data/.envEdit data/.env with your configuration
编辑data/.env配置文件
docker compose up -d
---docker compose up -d
---Configuration
配置
Create a file (or for Docker). First-run wizard auto-generates it:
.envdata/.envbash
uv run autoteam api # triggers guided setup on first run创建文件(Docker环境使用)。首次运行向导会自动生成该文件:
.envdata/.envbash
uv run autoteam api # 首次运行时触发引导式设置Key .env
Variables
.env核心.env变量
dotenv
undefineddotenv
undefinedMail provider: cf_temp_email (default/recommended) or maillab
邮件提供商:cf_temp_email(默认/推荐)或 maillab
MAIL_PROVIDER=cf_temp_email
MAIL_BASE_URL=https://your-cf-temp-email.workers.dev
MAIL_PROVIDER=cf_temp_email
MAIL_BASE_URL=https://your-cf-temp-email.workers.dev
If using maillab (upstream-compatible legacy)
如果使用maillab(兼容上游的旧版本)
MAIL_PROVIDER=maillab
MAIL_PROVIDER=maillab
MAIL_BASE_URL=https://your-cloudmail-instance.com
MAIL_BASE_URL=https://your-cloudmail-instance.com
OpenAI admin/master account
OpenAI管理员/主账号
OPENAI_EMAIL=admin@example.com
OPENAI_PASSWORD=your_password
OPENAI_EMAIL=admin@example.com
OPENAI_PASSWORD=your_password
CLIProxyAPI (CPA) sync target
CLIProxyAPI(CPA)同步目标
CPA_BASE_URL=https://your-cpa-instance.com
CPA_API_KEY=$CPA_API_KEY
CPA_BASE_URL=https://your-cpa-instance.com
CPA_API_KEY=$CPA_API_KEY
AutoTeam-F API protection
AutoTeam-F API保护
API_KEY=$AUTOTEAM_API_KEY
API_KEY=$AUTOTEAM_API_KEY
Team workspace settings
团队工作区设置
TEAM_WORKSPACE_ID=your_workspace_id
TARGET_MEMBER_COUNT=5
TEAM_WORKSPACE_ID=your_workspace_id
TARGET_MEMBER_COUNT=5
Reconcile behavior
对账行为
RECONCILE_KICK_ORPHAN=false
RECONCILE_KICK_GHOST=false
undefinedRECONCILE_KICK_ORPHAN=false
RECONCILE_KICK_GHOST=false
undefinedMail Provider Notes
邮件提供商说明
- (default): Cloudflare Workers-based, widely tested, good OpenAI domain allowlist compatibility
cf_temp_email - : Legacy
maillabbackend; must be set explicitly — no longer the defaultmaillab/cloud-mail - On startup, AutoTeam-F fingerprint-sniffs the base URL and warns if provider/URL mismatch is detected (prevents silent "login success → create mailbox 401" failures)
- (默认):基于Cloudflare Workers,经过广泛测试,与OpenAI域名白名单兼容性良好
cf_temp_email - :旧版
maillab后端;需显式设置——不再是默认选项maillab/cloud-mail - 启动时,AutoTeam-F会对基础URL进行指纹识别,如果检测到提供商与URL不匹配会发出警告(避免静默出现“登录成功→创建邮箱401”的失败情况)
CLI Commands
CLI命令
bash
undefinedbash
undefinedStart Web dashboard + API (port 8787)
启动Web控制面板 + API(端口8787)
uv run autoteam api
uv run autoteam api
Smart rotation — fill to N active accounts (default: 5)
智能轮换 — 填充至N个活跃账号(默认:5)
uv run autoteam rotate [N]
uv run autoteam rotate [N]
View account status
查看账号状态
uv run autoteam status
uv run autoteam status
Check quotas (active accounts)
检查配额(活跃账号)
uv run autoteam check
uv run autoteam check
Check quotas including standby pool (rate-limited, 24h dedup)
检查配额,包括备用池(受速率限制,24小时去重)
uv run autoteam check --include-standby
uv run autoteam check --include-standby
Add a new account via automated registration
通过自动注册添加新账号
uv run autoteam add
uv run autoteam add
Add account via manual OAuth paste
通过手动粘贴OAuth信息添加账号
uv run autoteam manual-add
uv run autoteam manual-add
Fill Team seats to target count
将团队席位填充至目标数量
uv run autoteam fill [N]
uv run autoteam fill [N]
Clean up excess Team members
清理多余的团队成员
uv run autoteam cleanup [N]
uv run autoteam cleanup [N]
Sync local auth to CPA
将本地认证信息同步至CPA
uv run autoteam sync
uv run autoteam sync
Pull auth from CPA to local
从CPA拉取认证信息至本地
uv run autoteam pull-cpa
uv run autoteam pull-cpa
Admin login (master account)
管理员登录(主账号)
uv run autoteam admin-login
uv run autoteam admin-login
Reconcile workspace vs local — find ghost/orphan/mismatched accounts
对账工作区与本地数据 — 查找幽灵/孤立/不匹配的账号
uv run autoteam reconcile
uv run autoteam reconcile --dry-run
---uv run autoteam reconcile
uv run autoteam reconcile --dry-run
---Web Dashboard
Web控制面板
Access at after starting with .
http://localhost:8787uv run autoteam api| Page | Key Features |
|---|---|
| 📊 Dashboard | Account stats, status table, login/kick/delete/bulk-delete |
| 👥 Team Members | All workspace members including external |
| 🔁 Pool Operations | Rotate / Check / Fill / Add / Generate Free Accounts / Cleanup |
| 🔄 Sync Center | Sync accounts, push to CPA, pull from CPA |
| 🔐 OAuth Login | Generate auth links; auto localhost callback + manual paste fallback |
| 📜 Task History | Background task status + real-time stop button |
| 📋 Logs | Live log viewer |
| ⚙️ Settings | Admin login, master Codex sync, patrol config |
执行启动后,访问。
uv run autoteam apihttp://localhost:8787| 页面 | 核心功能 |
|---|---|
| 📊 仪表盘 | 账号统计、状态表格、登录/踢出/删除/批量删除 |
| 👥 团队成员 | 包含外部成员在内的所有工作区成员 |
| 🔁 账号池操作 | 轮换 / 检查 / 填充 / 添加 / 生成免费账号 / 清理 |
| 🔄 同步中心 | 账号同步、推送至CPA、从CPA拉取 |
| 🔐 OAuth登录 | 生成认证链接;自动本地回调 + 手动粘贴备用方案 |
| 📜 任务历史 | 后台任务状态 + 实时停止按钮 |
| 📋 日志 | 实时日志查看器 |
| ⚙️ 设置 | 管理员登录、主Codex同步、巡检配置 |
REST API
REST API
All endpoints require header.
Authorization: Bearer $API_KEY所有端点均需携带请求头。
Authorization: Bearer $API_KEYAccount Management
账号管理
bash
undefinedbash
undefinedList all accounts
列出所有账号
curl -H "Authorization: Bearer $API_KEY" http://localhost:8787/api/accounts
curl -H "Authorization: Bearer $API_KEY" http://localhost:8787/api/accounts
Trigger rotation (fill to 5 active)
触发轮换(填充至5个活跃账号)
curl -X POST -H "Authorization: Bearer $API_KEY"
-H "Content-Type: application/json"
-d '{"target": 5}'
http://localhost:8787/api/tasks/rotate
-H "Content-Type: application/json"
-d '{"target": 5}'
http://localhost:8787/api/tasks/rotate
curl -X POST -H "Authorization: Bearer $API_KEY"
-H "Content-Type: application/json"
-d '{"target": 5}'
http://localhost:8787/api/tasks/rotate
-H "Content-Type: application/json"
-d '{"target": 5}'
http://localhost:8787/api/tasks/rotate
Generate free Personal accounts (leave_workspace=true)
生成免费个人账号(leave_workspace=true)
curl -X POST -H "Authorization: Bearer $API_KEY"
-H "Content-Type: application/json"
-d '{"target": 3, "leave_workspace": true}'
http://localhost:8787/api/tasks/fill
-H "Content-Type: application/json"
-d '{"target": 3, "leave_workspace": true}'
http://localhost:8787/api/tasks/fill
curl -X POST -H "Authorization: Bearer $API_KEY"
-H "Content-Type: application/json"
-d '{"target": 3, "leave_workspace": true}'
http://localhost:8787/api/tasks/fill
-H "Content-Type: application/json"
-d '{"target": 3, "leave_workspace": true}'
http://localhost:8787/api/tasks/fill
Check quotas including standby
检查配额,包括备用池
curl -X POST -H "Authorization: Bearer $API_KEY"
-H "Content-Type: application/json"
-d '{"include_standby": true}'
http://localhost:8787/api/tasks/check
-H "Content-Type: application/json"
-d '{"include_standby": true}'
http://localhost:8787/api/tasks/check
curl -X POST -H "Authorization: Bearer $API_KEY"
-H "Content-Type: application/json"
-d '{"include_standby": true}'
http://localhost:8787/api/tasks/check
-H "Content-Type: application/json"
-d '{"include_standby": true}'
http://localhost:8787/api/tasks/check
Sync to CPA
同步至CPA
curl -X POST -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/tasks/sync
http://localhost:8787/api/tasks/sync
curl -X POST -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/tasks/sync
http://localhost:8787/api/tasks/sync
Pull from CPA
从CPA拉取
curl -X POST -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/tasks/pull-cpa
http://localhost:8787/api/tasks/pull-cpa
undefinedcurl -X POST -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/tasks/pull-cpa
http://localhost:8787/api/tasks/pull-cpa
undefinedDiagnostics & Repair
诊断与修复
bash
undefinedbash
undefinedDiagnose 401 issues (checks 4 API endpoints)
诊断401问题(检查4个API端点)
curl -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/admin/diagnose | jq
http://localhost:8787/api/admin/diagnose | jq
curl -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/admin/diagnose | jq
http://localhost:8787/api/admin/diagnose | jq
Hot-fix mismatched account_id without re-login
热修复不匹配的account_id(无需重新登录)
curl -X POST -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/admin/fix-account-id | jq
http://localhost:8787/api/admin/fix-account-id | jq
curl -X POST -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/admin/fix-account-id | jq
http://localhost:8787/api/admin/fix-account-id | jq
Reconcile workspace vs local accounts (dry run)
对账工作区与本地账号(试运行)
curl -X POST -H "Authorization: Bearer $API_KEY"
"http://localhost:8787/api/admin/reconcile?dry_run=1" | jq
"http://localhost:8787/api/admin/reconcile?dry_run=1" | jq
curl -X POST -H "Authorization: Bearer $API_KEY"
"http://localhost:8787/api/admin/reconcile?dry_run=1" | jq
"http://localhost:8787/api/admin/reconcile?dry_run=1" | jq
Stop a running task
停止正在运行的任务
curl -X POST -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/tasks/{task_id}/stop
http://localhost:8787/api/tasks/{task_id}/stop
undefinedcurl -X POST -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/tasks/{task_id}/stop
http://localhost:8787/api/tasks/{task_id}/stop
undefinedOAuth Flow
OAuth流程
bash
undefinedbash
undefinedGet OAuth URL for an account
获取账号的OAuth链接
curl -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/oauth/url
http://localhost:8787/api/oauth/url
curl -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/oauth/url
http://localhost:8787/api/oauth/url
Submit manually-obtained OAuth callback URL
提交手动获取的OAuth回调链接
curl -X POST -H "Authorization: Bearer $API_KEY"
-H "Content-Type: application/json"
-d '{"callback_url": "http://localhost:..."}'
http://localhost:8787/api/oauth/manual
-H "Content-Type: application/json"
-d '{"callback_url": "http://localhost:..."}'
http://localhost:8787/api/oauth/manual
---curl -X POST -H "Authorization: Bearer $API_KEY"
-H "Content-Type: application/json"
-d '{"callback_url": "http://localhost:..."}'
http://localhost:8787/api/oauth/manual
-H "Content-Type: application/json"
-d '{"callback_url": "http://localhost:..."}'
http://localhost:8787/api/oauth/manual
---Key Workflows
核心工作流
1. Batch Generate Free Personal Accounts
1. 批量生成免费个人账号
The "F" in AutoTeam-F's key feature: register accounts → master invites to Team → accounts leave workspace → Personal OAuth stored.
Via Web: Dashboard → "账号池操作" → "生成免费号" → set count → start.
Via API:
bash
curl -X POST -H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"target": 5, "leave_workspace": true}' \
http://localhost:8787/api/tasks/fillConstraints: (Team seat limit). AutoTeam-F auto-shrinks the batch if exceeded.
baseline + new_batch ≤ 4AutoTeam-F的核心功能“F”:注册账号 → 主账号邀请至团队 → 账号退出工作区 → 保存个人OAuth信息。
通过Web操作:仪表盘 → "账号池操作" → "生成免费号" → 设置数量 → 启动。
通过API:
bash
curl -X POST -H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"target": 5, "leave_workspace": true}' \
http://localhost:8787/api/tasks/fill限制:(团队席位限制)。如果超出,AutoTeam-F会自动缩减批量大小。
基准数量 + 新批量数量 ≤ 42. Smart Rotation
2. 智能轮换
Accounts with exhausted Codex quota are moved to . When standby accounts recover quota, they're promoted back to before registering new ones.
standbyactivebash
uv run autoteam rotate 5Codex配额耗尽的账号会被移至状态。当备用账号配额恢复后,会在注册新账号前重新晋升为状态。
standbyactivebash
uv run autoteam rotate 5Equivalent API:
等效API:
curl -X POST -H "Authorization: Bearer $API_KEY"
-H "Content-Type: application/json"
-d '{"target": 5}'
http://localhost:8787/api/tasks/rotate
-H "Content-Type: application/json"
-d '{"target": 5}'
http://localhost:8787/api/tasks/rotate
undefinedcurl -X POST -H "Authorization: Bearer $API_KEY"
-H "Content-Type: application/json"
-d '{"target": 5}'
http://localhost:8787/api/tasks/rotate
-H "Content-Type: application/json"
-d '{"target": 5}'
http://localhost:8787/api/tasks/rotate
undefined3. Fix 401 "Must be part of this workspace"
3. 修复401错误“必须属于此工作区”
bash
API_KEY="$(grep '^API_KEY' .env | cut -d= -f2)"bash
API_KEY="$(grep '^API_KEY' .env | cut -d= -f2)"Step 1: Diagnose
步骤1:诊断
curl -s -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/admin/diagnose | jq
http://localhost:8787/api/admin/diagnose | jq
curl -s -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/admin/diagnose | jq
http://localhost:8787/api/admin/diagnose | jq
Step 2: Hot-fix account_id (no re-login needed)
步骤2:热修复account_id(无需重新登录)
curl -s -X POST -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/admin/fix-account-id | jq
http://localhost:8787/api/admin/fix-account-id | jq
undefinedcurl -s -X POST -H "Authorization: Bearer $API_KEY"
http://localhost:8787/api/admin/fix-account-id | jq
http://localhost:8787/api/admin/fix-account-id | jq
undefined4. Reconcile Ghost/Orphan Accounts
4. 对账幽灵/孤立账号
Identifies: orphaned seats (workspace has seat, no local auth), mismatched accounts, exhausted-but-not-abandoned, ghost accounts.
bash
undefined识别以下情况:孤立席位(工作区有席位,但无本地认证信息)、不匹配账号、已耗尽但未弃用的账号、幽灵账号。
bash
undefinedSafe dry run first
先执行安全的试运行
uv run autoteam reconcile --dry-run
uv run autoteam reconcile --dry-run
Apply fixes (behavior controlled by RECONCILE_KICK_ORPHAN / RECONCILE_KICK_GHOST in .env)
应用修复(行为由.env中的RECONCILE_KICK_ORPHAN / RECONCILE_KICK_GHOST控制)
uv run autoteam reconcile
undefineduv run autoteam reconcile
undefined5. CPA Bidirectional Sync
5. CPA双向同步
bash
undefinedbash
undefinedPush local active accounts → CPA
将本地活跃账号推送至CPA
uv run autoteam sync
uv run autoteam sync
Pull CPA accounts → local (import external auth)
从CPA拉取账号至本地(导入外部认证信息)
uv run autoteam pull-cpa
---uv run autoteam pull-cpa
---Account State Machine
账号状态机
registered → active → standby → (recover) → active
↘ (exhausted, no recovery) → abandoned
standby: quota exhausted, waiting for recovery
active: has valid Codex quota
auth_invalid: 401/403 on check → needs re-OAuth
network_error: transient DNS/timeout/5xx → retried next cycle (not marked invalid)Failure log: Registration failures are persisted to with categories: , , , .
register_failures.jsonphone_requiredduplicatekick_failedoauth_failedregistered → active → standby → (恢复) → active
↘ (已耗尽,无法恢复) → abandoned
standby: 配额耗尽,等待恢复
active: 拥有有效Codex配额
auth_invalid: 检查时出现401/403错误 → 需要重新OAuth
network_error: 临时DNS/超时/5xx错误 → 下一轮重试(不会标记为无效)失败日志:注册失败信息会被持久化到,分类包括:, , , 。
register_failures.jsonphone_requiredduplicatekick_failedoauth_failedPython Integration Examples
Python集成示例
Check Account Status Programmatically
程序化检查账号状态
python
import httpx
import os
API_KEY = os.environ["AUTOTEAM_API_KEY"]
BASE_URL = "http://localhost:8787"
headers = {"Authorization": f"Bearer {API_KEY}"}
with httpx.Client() as client:
# Get all accounts
accounts = client.get(f"{BASE_URL}/api/accounts", headers=headers).json()
active = [a for a in accounts if a["status"] == "active"]
standby = [a for a in accounts if a["status"] == "standby"]
print(f"Active: {len(active)}, Standby: {len(standby)}")
# Trigger rotation if below threshold
if len(active) < 3:
resp = client.post(
f"{BASE_URL}/api/tasks/rotate",
headers=headers,
json={"target": 5}
)
task = resp.json()
print(f"Rotation task started: {task['task_id']}")python
import httpx
import os
API_KEY = os.environ["AUTOTEAM_API_KEY"]
BASE_URL = "http://localhost:8787"
headers = {"Authorization": f"Bearer {API_KEY}"}
with httpx.Client() as client:
# 获取所有账号
accounts = client.get(f"{BASE_URL}/api/accounts", headers=headers).json()
active = [a for a in accounts if a["status"] == "active"]
standby = [a for a in accounts if a["status"] == "standby"]
print(f"活跃账号: {len(active)}, 备用账号: {len(standby)}")
# 如果低于阈值则触发轮换
if len(active) < 3:
resp = client.post(
f"{BASE_URL}/api/tasks/rotate",
headers=headers,
json={"target": 5}
)
task = resp.json()
print(f"轮换任务已启动: {task['task_id']}")Poll Task Until Complete
轮询任务直至完成
python
import httpx
import time
import os
API_KEY = os.environ["AUTOTEAM_API_KEY"]
BASE_URL = "http://localhost:8787"
headers = {"Authorization": f"Bearer {API_KEY}"}
def run_task_and_wait(endpoint: str, payload: dict, timeout: int = 600) -> dict:
with httpx.Client(timeout=30) as client:
resp = client.post(
f"{BASE_URL}/api/tasks/{endpoint}",
headers=headers,
json=payload
)
resp.raise_for_status()
task_id = resp.json()["task_id"]
deadline = time.time() + timeout
while time.time() < deadline:
status = client.get(
f"{BASE_URL}/api/tasks/{task_id}",
headers=headers
).json()
if status["state"] in ("completed", "failed", "stopped"):
return status
time.sleep(5)
raise TimeoutError(f"Task {task_id} did not complete in {timeout}s")python
import httpx
import time
import os
API_KEY = os.environ["AUTOTEAM_API_KEY"]
BASE_URL = "http://localhost:8787"
headers = {"Authorization": f"Bearer {API_KEY}"}
def run_task_and_wait(endpoint: str, payload: dict, timeout: int = 600) -> dict:
with httpx.Client(timeout=30) as client:
resp = client.post(
f"{BASE_URL}/api/tasks/{endpoint}",
headers=headers,
json=payload
)
resp.raise_for_status()
task_id = resp.json()["task_id"]
deadline = time.time() + timeout
while time.time() < deadline:
status = client.get(
f"{BASE_URL}/api/tasks/{task_id}",
headers=headers
).json()
if status["state"] in ("completed", "failed", "stopped"):
return status
time.sleep(5)
raise TimeoutError(f"任务 {task_id} 未在 {timeout}秒内完成")Generate 3 free personal accounts
生成3个免费个人账号
result = run_task_and_wait("fill", {"target": 3, "leave_workspace": True})
print(f"Task result: {result['state']}, accounts: {result.get('result')}")
undefinedresult = run_task_and_wait("fill", {"target": 3, "leave_workspace": True})
print(f"任务结果: {result['state']}, 账号数量: {result.get('result')}")
undefinedExport Codex CLI Auth
导出Codex CLI认证信息
python
import httpx
import json
import os
API_KEY = os.environ["AUTOTEAM_API_KEY"]
BASE_URL = "http://localhost:8787"
headers = {"Authorization": f"Bearer {API_KEY}"}
with httpx.Client() as client:
resp = client.get(f"{BASE_URL}/api/auth/export", headers=headers)
auth_data = resp.json()python
import httpx
import json
import os
API_KEY = os.environ["AUTOTEAM_API_KEY"]
BASE_URL = "http://localhost:8787"
headers = {"Authorization": f"Bearer {API_KEY}"}
with httpx.Client() as client:
resp = client.get(f"{BASE_URL}/api/auth/export", headers=headers)
auth_data = resp.json()Write Codex CLI format
写入Codex CLI格式
with open(os.path.expanduser("~/.codex/auth.json"), "w") as f:
json.dump(auth_data, f, indent=2)
print("Auth exported to ~/.codex/auth.json")
---with open(os.path.expanduser("~/.codex/auth.json"), "w") as f:
json.dump(auth_data, f, indent=2)
print("认证信息已导出至 ~/.codex/auth.json")
---Docker Compose Reference
Docker Compose参考
yaml
undefinedyaml
undefineddocker-compose.yml (from repo)
docker-compose.yml(来自仓库)
services:
autoteam:
build: .
ports:
- "8787:8787"
volumes:
- ./data:/app/data
environment:
- DATA_DIR=/app/data
restart: unless-stopped
```bashservices:
autoteam:
build: .
ports:
- "8787:8787"
volumes:
- ./data:/app/data
environment:
- DATA_DIR=/app/data
restart: unless-stopped
```bashStart
启动
docker compose up -d
docker compose up -d
View logs
查看日志
docker compose logs -f autoteam
docker compose logs -f autoteam
Run CLI commands inside container
在容器内执行CLI命令
docker compose exec autoteam uv run autoteam status
docker compose exec autoteam uv run autoteam reconcile --dry-run
docker compose exec autoteam uv run autoteam status
docker compose exec autoteam uv run autoteam reconcile --dry-run
Restart after config change
修改配置后重启
docker compose restart autoteam
**Linux host access**: If CPA or mail service runs on the host, use `host.docker.internal` (Docker Desktop) or the host's bridge IP (`172.17.0.1` typically) instead of `localhost` in `.env`.
---docker compose restart autoteam
**Linux主机访问**:如果CPA或邮件服务运行在主机上,在`.env`中使用`host.docker.internal`(Docker Desktop)或主机桥接IP(通常为`172.17.0.1`)代替`localhost`。
---Troubleshooting
故障排查
401 "Must be part of this workspace"
401错误“必须属于此工作区”
Most common cause: stored locally doesn't match OpenAI's records.
account_idbash
API_KEY="$(grep '^API_KEY' data/.env | cut -d= -f2)"
curl -s -H "Authorization: Bearer $API_KEY" http://localhost:8787/api/admin/diagnose | jq
curl -s -X POST -H "Authorization: Bearer $API_KEY" http://localhost:8787/api/admin/fix-account-id | jq最常见原因:本地存储的与OpenAI记录不匹配。
account_idbash
API_KEY="$(grep '^API_KEY' data/.env | cut -d= -f2)"
curl -s -H "Authorization: Bearer $API_KEY" http://localhost:8787/api/admin/diagnose | jq
curl -s -X POST -H "Authorization: Bearer $API_KEY" http://localhost:8787/api/admin/fix-account-id | jqMail provider mismatch warning on startup
启动时出现邮件提供商不匹配警告
WARNING: MAIL_PROVIDER=cf_temp_email but base_url fingerprint suggests maillab protocolFix: ensure in matches your actual deployed mail service. uses Cloudflare Workers API; uses the cloud-mail REST API.
MAIL_PROVIDER.envcf_temp_emailmaillabWARNING: MAIL_PROVIDER=cf_temp_email but base_url fingerprint suggests maillab protocol修复方法:确保中的与实际部署的邮件服务匹配。使用Cloudflare Workers API;使用cloud-mail REST API。
.envMAIL_PROVIDERcf_temp_emailmaillabRegistration fails with phone_required
phone_required注册失败并提示phone_required
phone_requiredOpenAI began requiring phone verification for some IPs. Use a residential proxy. Check for categorized failure counts.
register_failures.jsonOpenAI开始对部分IP要求手机号验证。使用住宅代理。查看获取分类后的失败统计。
register_failures.jsonPlaywright times out during registration
Playwright在注册时超时
bash
undefinedbash
undefinedIncrease timeout — edit .env
增加超时时间 — 编辑.env
PLAYWRIGHT_TIMEOUT=120000 # ms, default 60000
Common on high-latency VPS. Consider residential proxy.PLAYWRIGHT_TIMEOUT=120000 # 毫秒,默认60000
在高延迟VPS上常见。建议使用住宅代理。Standby accounts never recover
备用账号从未恢复配额
AutoTeam-F uses 24h dedup for standby quota checks to avoid rate-limits. Force a check:
bash
curl -X POST -H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"include_standby": true}' \
http://localhost:8787/api/tasks/checkAutoTeam-F对备用配额检查使用24小时去重机制以避免速率限制。强制检查:
bash
curl -X POST -H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"include_standby": true}' \
http://localhost:8787/api/tasks/checkPersonal accounts invalidated after master account ban
主账号被封禁后个人账号失效
This is a known limitation — personal accounts derived from a banned master account (via Team invite → leave → personal OAuth) will also become invalid. The accounts must be regenerated from a new master account.
这是已知限制——通过主账号邀请→退出→个人OAuth生成的个人账号也会失效。必须使用新的主账号重新生成账号。
Task stop is soft, not immediate
任务停止为软停止,并非立即生效
Clicking "Stop Task" completes the current account registration (~2 min) before exiting. This is by design to avoid half-registered accounts. The task will show then .
stoppingstopped点击“停止任务”后,会完成当前账号注册(约2分钟)再退出。这是设计使然,避免出现半注册状态的账号。任务会显示然后变为。
stoppingstoppedautoteam fill
batch auto-shrinks
autoteam fillautoteam fill
批量自动缩减
autoteam fillTeam seats are capped: . AutoTeam-F auto-reduces batch size. To generate more, run multiple fill cycles after previous accounts have left the workspace.
baseline + new_batch ≤ 4团队席位上限:。AutoTeam-F会自动缩减批量大小。如需生成更多账号,需在上一批账号退出工作区后运行多次填充周期。
基准数量 + 新批量数量 ≤ 4Project Structure
项目结构
AutoTeam-F/
├── autoteam/ # Core Python package
│ ├── api/ # FastAPI routes
│ ├── core/ # Account manager, rotation logic
│ ├── playwright_/ # Browser automation (register, OAuth, Codex)
│ ├── mail/ # cf_temp_email + maillab backends
│ └── cli.py # CLI entry points
├── frontend/ # Vue 3 dashboard source
├── data/ # Runtime data (gitignored)
│ ├── accounts.json # Account pool state
│ ├── register_failures.json # Failure analytics
│ └── .env # Configuration
├── docs/ # Extended documentation
├── docker-compose.yml
└── setup.shAutoTeam-F/
├── autoteam/ # 核心Python包
│ ├── api/ # FastAPI路由
│ ├── core/ # 账号管理器、轮换逻辑
│ ├── playwright_/ # 浏览器自动化(注册、OAuth、Codex)
│ ├── mail/ # cf_temp_email + maillab后端
│ └── cli.py # CLI入口
├── frontend/ # Vue 3控制面板源码
├── data/ # 运行时数据(已加入git忽略)
│ ├── accounts.json # 账号池状态
│ ├── register_failures.json # 失败统计
│ └── .env # 配置文件
├── docs/ # 扩展文档
├── docker-compose.yml
└── setup.shLinks
相关链接
- From-Zero Deploy Guide
- Configuration Reference
- Docker Deployment
- API Reference
- Architecture & State Machine
- Troubleshooting
- Upstream: cnitlrt/AutoTeam
- CLIProxyAPI
- cloudflare_temp_email
- 从零开始部署指南
- 配置参考
- Docker部署
- API参考
- 架构与状态机
- 故障排查
- 上游项目: cnitlrt/AutoTeam
- CLIProxyAPI
- cloudflare_temp_email