本文へ移動
cccskills
無料GitHub で公開

traffic-cop

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

インストール方法を見る

含まれるファイル(1)

  • SKILL.md2.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

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

日本語の概要は準備中です。原文の説明を表示しています。

openamer/openamer52026年10月11日 更新

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/openamer52026年10月11日 更新

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

日本語の概要は準備中です。原文の説明を表示しています。

openamer/openamer52026年10月11日 更新

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

日本語の概要は準備中です。原文の説明を表示しています。

openamer/openamer52026年10月11日 更新

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

日本語の概要は準備中です。原文の説明を表示しています。

openamer/openamer52026年10月11日 更新

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

日本語の概要は準備中です。原文の説明を表示しています。

openamer/openamer52026年10月11日 更新

openamer のスキルをすべて見る

このスキルの問題を報告する