tavily-key-generator-proxy by aradotso/trending-skills
npx skills add https://github.com/aradotso/trending-skills --skill tavily-key-generator-proxy技能来自 ara.so — Daily 2026 技能集合
使用 Playwright + CapSolver (Cloudflare Turnstile) 自动批量注册 Tavily 账户,然后将生成的 API 密钥汇集到一个统一的代理网关后面,该网关提供轮询调度、使用量跟踪、令牌管理和 Web 控制台。
| 组件 | 位置 | 用途 |
|---|---|---|
| 密钥生成器 | 根目录 / | 使用 Playwright 驱动的无头 Firefox 注册 Tavily 账户,解决 Turnstile CAPTCHA 验证码,验证电子邮件,提取 API 密钥 |
| API 代理 | proxy/ | FastAPI 服务,在汇集的所有密钥间轮询分发请求,暴露 /api/search 和 /api/extract 端点,在 提供 Web 控制台 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
/console每个免费的 Tavily 账户每月提供 1,000 次 API 调用。代理聚合配额:10 个密钥 = 通过一个端点每月 10,000 次调用。
git clone https://github.com/skernelx/tavily-key-generator.git
cd tavily-key-generator
pip install -r requirements.txt
playwright install firefox
cp config.example.py config.py
# 使用你的 CapSolver 密钥和电子邮件后端编辑 config.py
python main.py
cd proxy/
cp .env.example .env
# 在 .env 中设置 ADMIN_PASSWORD
docker compose up -d
# 控制台位于 http://localhost:9874/console
config.py)# CapSolver — 推荐 (~$0.001/次解决,高成功率)
CAPTCHA_SOLVER = "capsolver"
CAPSOLVER_API_KEY = "CAP-..." # 来自 capsolver.com
# 浏览器点击回退方案 — 免费但成功率低
CAPTCHA_SOLVER = "browser"
选项 A: Cloudflare Email Worker (自托管,免费)
EMAIL_BACKEND = "cloudflare"
EMAIL_DOMAIN = "mail.yourdomain.com"
EMAIL_API_URL = "https://mail.yourdomain.com"
EMAIL_API_TOKEN = "your-worker-token"
选项 B: DuckMail (第三方临时邮箱)
EMAIL_BACKEND = "duckmail"
DUCKMAIL_API_BASE = "https://api.duckmail.sbs"
DUCKMAIL_BEARER = "dk_..."
DUCKMAIL_DOMAIN = "duckmail.sbs"
如果同时配置了两个后端,CLI 会在运行时提示你选择。
THREADS = 2 # 最大 3 — 数量越多,封禁风险越高
COOLDOWN_BASE = 45 # 注册之间的间隔秒数
COOLDOWN_JITTER = 15 # 随机增加的秒数
BATCH_LIMIT = 20 # 注册这么多账户后暂停
PROXY_AUTO_UPLOAD = True
PROXY_URL = "http://localhost:9874"
PROXY_ADMIN_PASSWORD = "your-admin-password"
python main.py
# 提示:生成多少个密钥,使用哪个电子邮件后端
# 输出:包含所有生成密钥的 api_keys.md
# 如果 PROXY_AUTO_UPLOAD=True,密钥会自动推送到代理
生成的 api_keys.md 格式 (用于批量导入到代理):
tvly-abc123...
tvly-def456...
tvly-ghi789...
# 搜索 — 仅替换基础 URL
curl -X POST http://your-server:9874/api/search \
-H "Authorization: Bearer tvly-YOUR_PROXY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "latest AI news", "search_depth": "basic"}'
# 提取
curl -X POST http://your-server:9874/api/extract \
-H "Authorization: Bearer tvly-YOUR_PROXY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"urls": ["https://example.com/article"]}'
令牌也可以在请求体中作为 api_key 传递 (兼容 Tavily SDK):
import requests
response = requests.post(
"http://your-server:9874/api/search",
json={
"query": "Python web scraping",
"api_key": "tvly-YOUR_PROXY_TOKEN"
}
)
print(response.json())
from tavily import TavilyClient
# 将 SDK 指向你的代理 — 无需其他更改
client = TavilyClient(
api_key="tvly-YOUR_PROXY_TOKEN",
base_url="http://your-server:9874"
)
results = client.search("machine learning trends 2025")
所有管理端点都需要请求头:X-Admin-Password: your-password
# 列出所有密钥
curl http://localhost:9874/api/keys \
-H "X-Admin-Password: secret"
# 添加单个密钥
curl -X POST http://localhost:9874/api/keys \
-H "X-Admin-Password: secret" \
-H "Content-Type: application/json" \
-d '{"key": "tvly-abc123..."}'
# 从 api_keys.md 文本批量导入
curl -X POST http://localhost:9874/api/keys \
-H "X-Admin-Password: secret" \
-H "Content-Type: application/json" \
-d '{"bulk": "tvly-abc...\ntvly-def...\ntvly-ghi..."}'
# 切换密钥启用/禁用状态
curl -X PUT http://localhost:9874/api/keys/{id}/toggle \
-H "X-Admin-Password: secret"
# 删除密钥
curl -X DELETE http://localhost:9874/api/keys/{id} \
-H "X-Admin-Password: secret"
# 创建访问令牌
curl -X POST http://localhost:9874/api/tokens \
-H "X-Admin-Password: secret" \
-H "Content-Type: application/json" \
-d '{"label": "my-app"}'
# 返回:{"token": "tvly-...", "id": "..."}
# 列出令牌
curl http://localhost:9874/api/tokens \
-H "X-Admin-Password: secret"
# 删除令牌
curl -X DELETE http://localhost:9874/api/tokens/{id} \
-H "X-Admin-Password: secret"
curl http://localhost:9874/api/stats \
-H "X-Admin-Password: secret"
# 返回:total_quota, used, remaining, active_keys, disabled_keys
curl -X PUT http://localhost:9874/api/password \
-H "X-Admin-Password: current-password" \
-H "Content-Type: application/json" \
-d '{"new_password": "new-secure-password"}'
tvly- 前缀,对客户端来说与真实的 Tavily 密钥无法区分.env 配置ADMIN_PASSWORD=change-this-immediately
PORT=9874
# 可选:限制 CORS 来源
CORS_ORIGINS=https://myapp.com,https://app2.com
server {
listen 443 ssl;
server_name tavily-proxy.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:9874;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
# replenish.py — 当配额不足时通过 cron 运行
import requests
PROXY_URL = "http://localhost:9874"
ADMIN_PASSWORD = "your-password"
MIN_ACTIVE_KEYS = 10
def get_stats():
r = requests.get(f"{PROXY_URL}/api/stats",
headers={"X-Admin-Password": ADMIN_PASSWORD})
return r.json()
def trigger_registration(count: int):
"""调用你的密钥生成器作为子进程或直接导入"""
import subprocess
subprocess.run(["python", "main.py", "--count", str(count)], check=True)
stats = get_stats()
active = stats["active_keys"]
if active < MIN_ACTIVE_KEYS:
needed = MIN_ACTIVE_KEYS - active
print(f"密钥池不足 ({active} 个密钥),正在注册 {needed} 个新密钥...")
trigger_registration(needed)
| 问题 | 原因 | 解决方法 |
|---|---|---|
| CAPTCHA 解决失败 | Tavily 提高了机器人检测 | 暂停数小时,将 THREADS 减少到 1 |
| 电子邮件验证超时 | 邮件投递缓慢 | 在配置中增加轮询超时时间 |
| 密钥在代理中立即被禁用 | Tavily 账户被标记/暂停 | 从不同的 IP 注册 |
playwright install firefox 失败 | 缺少系统依赖 | 先运行 playwright install-deps firefox |
| Docker compose 端口冲突 | 9874 端口被占用 | 更改 .env 和 docker-compose.yml 中的 PORT |
X-Admin-Password 返回 401 | 密码错误 | 检查 .env,更改后重启容器 |
| 注册期间 IP 被封禁 | 注册次数过多 | 使用 BATCH_LIMIT=10,批次之间等待数小时 |
# 保守设置 — 最小化封禁风险
THREADS = 1
COOLDOWN_BASE = 60
COOLDOWN_JITTER = 30
BATCH_LIMIT = 10
ADMIN_PASSWORD 从默认值更改config.py 添加到 .gitignore (已包含,推送前请确认)api_keys.md 提交到公共仓库每周安装量
349
仓库
GitHub 星标数
10
首次出现
8 天前
安全审计
已安装于
gemini-cli345
github-copilot345
codex345
amp345
cline345
kimi-cli345
Skill by ara.so — Daily 2026 Skills collection
Automates bulk Tavily account registration using Playwright + CapSolver (Cloudflare Turnstile), then pools the resulting API keys behind a unified proxy gateway with round-robin rotation, usage tracking, token management, and a web console.
| Component | Location | Purpose |
|---|---|---|
| Key Generator | root / | Playwright-driven headless Firefox registers Tavily accounts, solves Turnstile CAPTCHAs, verifies email, extracts API key |
| API Proxy | proxy/ | FastAPI service that round-robins requests across pooled keys, exposes /api/search and /api/extract, serves web console at /console |
Each free Tavily account yields 1,000 API calls/month. The proxy aggregates quota: 10 keys = 10,000 calls/month via one endpoint.
git clone https://github.com/skernelx/tavily-key-generator.git
cd tavily-key-generator
pip install -r requirements.txt
playwright install firefox
cp config.example.py config.py
# Edit config.py with your CapSolver key and email backend
python main.py
cd proxy/
cp .env.example .env
# Set ADMIN_PASSWORD in .env
docker compose up -d
# Console at http://localhost:9874/console
config.py)# CapSolver — recommended (~$0.001/solve, high success rate)
CAPTCHA_SOLVER = "capsolver"
CAPSOLVER_API_KEY = "CAP-..." # from capsolver.com
# Browser click fallback — free but low success rate
CAPTCHA_SOLVER = "browser"
Option A: Cloudflare Email Worker (self-hosted, free)
EMAIL_BACKEND = "cloudflare"
EMAIL_DOMAIN = "mail.yourdomain.com"
EMAIL_API_URL = "https://mail.yourdomain.com"
EMAIL_API_TOKEN = "your-worker-token"
Option B: DuckMail (third-party temporary email)
EMAIL_BACKEND = "duckmail"
DUCKMAIL_API_BASE = "https://api.duckmail.sbs"
DUCKMAIL_BEARER = "dk_..."
DUCKMAIL_DOMAIN = "duckmail.sbs"
If both backends are configured, the CLI prompts you to choose at runtime.
THREADS = 2 # Max 3 — more = higher ban risk
COOLDOWN_BASE = 45 # Seconds between registrations
COOLDOWN_JITTER = 15 # Random additional seconds
BATCH_LIMIT = 20 # Pause after this many registrations
PROXY_AUTO_UPLOAD = True
PROXY_URL = "http://localhost:9874"
PROXY_ADMIN_PASSWORD = "your-admin-password"
python main.py
# Prompts: how many keys to generate, which email backend
# Output: api_keys.md with all generated keys
# If PROXY_AUTO_UPLOAD=True, keys are pushed to proxy automatically
Generated api_keys.md format (used for bulk import into proxy):
tvly-abc123...
tvly-def456...
tvly-ghi789...
# Search — replace base URL only
curl -X POST http://your-server:9874/api/search \
-H "Authorization: Bearer tvly-YOUR_PROXY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "latest AI news", "search_depth": "basic"}'
# Extract
curl -X POST http://your-server:9874/api/extract \
-H "Authorization: Bearer tvly-YOUR_PROXY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"urls": ["https://example.com/article"]}'
Token can also be passed in the request body as api_key (Tavily SDK compatible):
import requests
response = requests.post(
"http://your-server:9874/api/search",
json={
"query": "Python web scraping",
"api_key": "tvly-YOUR_PROXY_TOKEN"
}
)
print(response.json())
from tavily import TavilyClient
# Point SDK at your proxy — no other changes needed
client = TavilyClient(
api_key="tvly-YOUR_PROXY_TOKEN",
base_url="http://your-server:9874"
)
results = client.search("machine learning trends 2025")
All admin endpoints require header: X-Admin-Password: your-password
# List all keys
curl http://localhost:9874/api/keys \
-H "X-Admin-Password: secret"
# Add a single key
curl -X POST http://localhost:9874/api/keys \
-H "X-Admin-Password: secret" \
-H "Content-Type: application/json" \
-d '{"key": "tvly-abc123..."}'
# Bulk import from api_keys.md text
curl -X POST http://localhost:9874/api/keys \
-H "X-Admin-Password: secret" \
-H "Content-Type: application/json" \
-d '{"bulk": "tvly-abc...\ntvly-def...\ntvly-ghi..."}'
# Toggle key enabled/disabled
curl -X PUT http://localhost:9874/api/keys/{id}/toggle \
-H "X-Admin-Password: secret"
# Delete key
curl -X DELETE http://localhost:9874/api/keys/{id} \
-H "X-Admin-Password: secret"
# Create access token
curl -X POST http://localhost:9874/api/tokens \
-H "X-Admin-Password: secret" \
-H "Content-Type: application/json" \
-d '{"label": "my-app"}'
# Returns: {"token": "tvly-...", "id": "..."}
# List tokens
curl http://localhost:9874/api/tokens \
-H "X-Admin-Password: secret"
# Delete token
curl -X DELETE http://localhost:9874/api/tokens/{id} \
-H "X-Admin-Password: secret"
curl http://localhost:9874/api/stats \
-H "X-Admin-Password: secret"
# Returns: total_quota, used, remaining, active_keys, disabled_keys
curl -X PUT http://localhost:9874/api/password \
-H "X-Admin-Password: current-password" \
-H "Content-Type: application/json" \
-d '{"new_password": "new-secure-password"}'
tvly- prefix, indistinguishable from real Tavily keys to clients.env ConfigurationADMIN_PASSWORD=change-this-immediately
PORT=9874
# Optional: restrict CORS origins
CORS_ORIGINS=https://myapp.com,https://app2.com
server {
listen 443 ssl;
server_name tavily-proxy.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:9874;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
# replenish.py — run on cron when quota runs low
import requests
PROXY_URL = "http://localhost:9874"
ADMIN_PASSWORD = "your-password"
MIN_ACTIVE_KEYS = 10
def get_stats():
r = requests.get(f"{PROXY_URL}/api/stats",
headers={"X-Admin-Password": ADMIN_PASSWORD})
return r.json()
def trigger_registration(count: int):
"""Call your key generator as subprocess or import directly"""
import subprocess
subprocess.run(["python", "main.py", "--count", str(count)], check=True)
stats = get_stats()
active = stats["active_keys"]
if active < MIN_ACTIVE_KEYS:
needed = MIN_ACTIVE_KEYS - active
print(f"Pool low ({active} keys), registering {needed} more...")
trigger_registration(needed)
| Problem | Cause | Fix |
|---|---|---|
| CAPTCHA solve failures | Tavily elevated bot detection | Pause several hours, reduce THREADS to 1 |
| Email verification timeout | Slow email delivery | Increase poll timeout in config |
| Keys immediately disabled in proxy | Tavily account flagged/suspended | Register from different IP |
playwright install firefox fails | Missing system deps | Run playwright install-deps firefox first |
| Docker compose port conflict | 9874 in use | Change PORT in and |
# Conservative — minimizes ban risk
THREADS = 1
COOLDOWN_BASE = 60
COOLDOWN_JITTER = 30
BATCH_LIMIT = 10
ADMIN_PASSWORD from default immediately after deployconfig.py to .gitignore (already included, verify before push)api_keys.md to public repositoriesWeekly Installs
349
Repository
GitHub Stars
10
First Seen
8 days ago
Security Audits
Gen Agent Trust HubFailSocketPassSnykFail
Installed on
gemini-cli345
github-copilot345
codex345
amp345
cline345
kimi-cli345
AI Elements:基于shadcn/ui的AI原生应用组件库,快速构建对话界面
54,900 周安装
品牌声音准则生成工具 - 从文档、对话和报告自动创建LLM就绪的品牌指南
311 周安装
Axiom 仪表板构建指南:设计决策优先的监控仪表板与数据可视化
311 周安装
Google Ads Manager 技能:广告系列管理、关键词研究、出价优化与效果分析
311 周安装
Telegram机器人开发教程:构建AI助手、通知系统与群组自动化工具
311 周安装
AI图像生成提示词优化指南:DALL-E、Midjourney、Stable Diffusion提示工程技巧
311 周安装
AI协作头脑风暴工具 - 将想法转化为完整设计规范,支持代码模板与项目管理
311 周安装
.envdocker-compose.ymlX-Admin-Password 401 | Wrong password | Check .env, restart container after changes |
| IP ban during registration | Too many registrations | Use BATCH_LIMIT=10, wait hours between batches |