跳到正文
cccskills
免费在 GitHub 公开

traffic-cop

Use for API-key health checks, rotation, and monitoring.

中文简介正在准备中。当前显示原文说明。

集成工具OpenAI
查看安装方法

包含的文件(1)

  • SKILL.md2.3 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Traffic Cop — API-Key-Health-Check + Rate-Limit-Rotation

Trigger

Use this skill whenever you need to:

  • Check API key health across all providers
  • Rotate a rate-limited or failed API key
  • View usage statistics for API keys
  • Set up or debug the Traffic Cop cron job

Script

Das Skript scripts/traffic-cop.py liest alle API-Keys aus der .env (OpenAmer Home, ~/.env, oder Repo .env), führt live HTTP-Health-Checks gegen die Provider-Endpoints durch und speichert den Zustand in ~/.traffic-cop/state.json.

CLI

python scripts/traffic-cop.py --check   # Live-Health-Check aller Keys
python scripts/traffic-cop.py --status  # Zeigt gespeicherten Key-Status
python scripts/traffic-cop.py --rotate <provider>  # Manuelle Key-Rotation
python scripts/traffic-cop.py --stats   # Nutzungsstatistik

Exit-Codes

CodeBedeutung
0Alle Keys OK
1Einige Keys gedrosselt/fehlerhaft
2Alle Keys tot — keine API erreichbar

Unterstützte Provider

OpenRouter, Ollama, OpenAI, Anthropic, Groq, Fireworks, DeepSeek, Mistral, Cohere, Together, Perplexity, Replicate, Gemini/Google AI, NovitaAI, GLM (z.ai), Kimi, DeepInfra, AI21, FAL, HuggingFace, ElevenLabs

Multi-Key-Pool pro Provider wird durch NUMERIC-Suffixe unterstützt (z.B. OPENAI_API_KEY_2, OPENAI_API_KEY_3).

Cron

# Alle 15 Minuten Health-Check (automatisch via OpenAmer jobs.json)
# Job: traffic-cop, Script: traffic-cop.py

State-Datei

~/.traffic-cop/state.json — JSON mit:

  • keys: Pro Env-Var: provider, health, last_checked, last_ok, error_count, 429_count, 401_count
  • rotation: Rotation-Log je Provider (current_index, historische Rotationen)
  • stats: Aggregierte Statistiken (total_checks, total_rotations, total_errors, total_429, total_401)

Fehlerbehandlung

  • 429: Rate-Limited → Key-State auf rate_limited, Rotation initiierbar
  • 401/403: Auth-Fail → Key-State auf auth_fail
  • Timeout: DNS/Netzwerk-Problem → Key-State auf timeout
  • Unbekannt: Anderer HTTP-Fehler → Key-State auf error

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Build integrated IS/BS/CF financial workbooks in Excel.

中文简介正在准备中。当前显示原文说明。

openamer/openamer82026年10月20日 更新

a2a-swarm

免费

Run and grow the OpenAmer Agent-to-Agent swarm: identity, trust, node-to-node ask, signed skill/insight sharing, and the autonomous self-learning loop.

中文简介正在准备中。当前显示原文说明。

openamer/openamer82026年10月20日 更新

Use for A/B experiments on OpenAmer configs and skills.

中文简介正在准备中。当前显示原文说明。

openamer/openamer82026年10月20日 更新

Roleplay a hostile user to find and triage UX pain points.

中文简介正在准备中。当前显示原文说明。

openamer/openamer82026年10月20日 更新

Agent mesh: master/worker nodes, HTTP delegation, heartbeat.

中文简介正在准备中。当前显示原文说明。

openamer/openamer82026年10月20日 更新

Use for agentic commerce payments tasks. Candidate synthesized from trend radar; awaiting trial promotion.

中文简介正在准备中。当前显示原文说明。

openamer/openamer82026年10月20日 更新

查看 openamer 的全部技能

报告此技能的问题