{
  "_comment": "Rate limit configuration per provider (t1330). Copy to ~/.config/aidevops/rate-limits.json and adjust for your plan.",
  "_note": "Values are per-minute limits. Set to 0 to disable tracking for that metric.",
  "_threshold": "warn_pct controls when a provider is flagged as throttle-risk (default 80%).",
  "_cooldown_semantics": "Persisted provider rate-limit and retry/reset evidence is authoritative. A structured rate limit without a valid reset uses one bounded local safety cooldown while quotas remain unknown; repeated responses pause work instead of triggering retries or notification storms.",
  "warn_pct": 80,
  "window_minutes": 1,
  "providers": {
    "anthropic": {
      "_comment": "Anthropic Claude API - limits vary by plan tier. These are conservative defaults for Pro/Team plans.",
      "_docs": "https://docs.anthropic.com/en/api/rate-limits",
      "requests_per_min": 50,
      "tokens_per_min": 40000,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "subscription"
    },
    "openai": {
      "_comment": "OpenAI API - limits vary by usage tier. Tier 1 defaults shown.",
      "_docs": "https://platform.openai.com/docs/guides/rate-limits",
      "requests_per_min": 500,
      "tokens_per_min": 200000,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "token"
    },
    "google": {
      "_comment": "Google Gemini API - limits vary by model and plan.",
      "_docs": "https://ai.google.dev/gemini-api/docs/rate-limits",
      "requests_per_min": 60,
      "tokens_per_min": 1000000,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "token"
    },
    "deepseek": {
      "_comment": "DeepSeek API - limits vary by plan.",
      "_docs": "https://platform.deepseek.com/docs",
      "requests_per_min": 60,
      "tokens_per_min": 100000,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "token"
    },
    "openrouter": {
      "_comment": "OpenRouter - limits depend on credits and plan.",
      "_docs": "https://openrouter.ai/docs/limits",
      "requests_per_min": 200,
      "tokens_per_min": 500000,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "token"
    },
    "groq": {
      "_comment": "Groq API - free tier limits shown. Paid plans are higher.",
      "_docs": "https://console.groq.com/docs/rate-limits",
      "requests_per_min": 30,
      "tokens_per_min": 6000,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "token"
    },
    "opencode": {
      "_comment": "OpenCode Zen proxy - inherits limits from underlying provider.",
      "requests_per_min": 50,
      "tokens_per_min": 40000,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "subscription"
    },
    "xai": {
      "_comment": "xAI Grok API - limits vary by plan.",
      "_docs": "https://docs.x.ai/docs/rate-limits",
      "requests_per_min": 60,
      "tokens_per_min": 100000,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "token"
    },
    "xapi": {
      "_comment": "X API limits vary by endpoint, app, account, and product tier; retain provider reset evidence and do not infer a universal request budget.",
      "requests_per_min": 0,
      "tokens_per_min": 0,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "provider-window"
    },
    "reddit": {
      "_comment": "Reddit API limits are runtime and identity specific; retain provider retry/reset evidence and do not infer a universal request budget.",
      "requests_per_min": 0,
      "tokens_per_min": 0,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "provider-window"
    },
    "meta_facebook": {
      "_comment": "Facebook Graph limits depend on the selected app, product, Page, and account; only persisted provider reset evidence activates cooldown.",
      "requests_per_min": 0,
      "tokens_per_min": 0,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "provider-gated"
    },
    "meta_instagram": {
      "_comment": "Instagram Graph limits depend on the selected app, product, and Professional account; only persisted provider reset evidence activates cooldown.",
      "requests_per_min": 0,
      "tokens_per_min": 0,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "provider-gated"
    },
    "meta_threads": {
      "_comment": "Threads limits depend on the selected app, product, and account; only persisted provider reset evidence activates cooldown.",
      "requests_per_min": 0,
      "tokens_per_min": 0,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "provider-gated"
    },
    "tiktok": {
      "_comment": "TikTok publishing limits and review gates depend on the selected app and account; only persisted provider reset evidence activates cooldown.",
      "requests_per_min": 0,
      "tokens_per_min": 0,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "provider-gated"
    },
    "linkedin": {
      "_comment": "LinkedIn API capacity is product and application gated; do not infer a quota from read access.",
      "_docs": "https://learn.microsoft.com/en-us/linkedin/shared/api-guide/concepts/rate-limits",
      "requests_per_min": 0,
      "tokens_per_min": 0,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "provider-gated"
    },
    "youtube": {
      "_comment": "YouTube Data API v3 default daily quota is project-specific; uploads are quota-expensive and must retain provider 403/quota responses.",
      "_docs": "https://developers.google.com/youtube/v3/determine_quota_cost",
      "requests_per_min": 0,
      "tokens_per_min": 0,
      "input_tokens_per_min": 0,
      "output_tokens_per_min": 0,
      "billing_type": "provider-quota"
    }
  }
}
