Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

VPSDance/ai-proxy-rules

Open more actions menu

Repository files navigation

AI Proxy Rules

daily sync providers last update

AI 服务分流规则聚合,每日自动更新。整合 v2fly、blackmatrix7 等多源合并去重,按 provider 拆分订阅;针对 OpenAI / Anthropic 等热门服务汇集多个上游,补全遗漏并修复部分规则。覆盖 Clash / Mihomo / sing-box / Surge / Shadowrocket / Loon / Stash / Quantumult X / Egern。

范围说明:本仓库面向"国内用户访问海外 AI 服务"场景,因此不收录已可直连的国内服务(DeepSeek / 豆包 / Kimi / 通义 / 智谱等)。

规则覆盖范围:

  • OpenAI / ChatGPT (openai)
  • Anthropic / Claude (anthropic)
  • Google AI / Gemini / AI Studio / NotebookLM / Antigravity (google-ai)
  • xAI / Grok (x-ai)
  • Meta AI / Llama (meta-ai)
  • Mistral AI / Le Chat (mistral-ai)
  • Cohere (cohere)
  • LMArena (lmarena)
  • GitHub Copilot (copilot)
  • Cursor (cursor)
  • Zed (zed)
  • Windsurf / Codeium (windsurf)
  • JetBrains AI / Grazie (jetbrains-ai)
  • Augment Code (augment-code)
  • Factory (factory)
  • Sourcegraph / Amp / Cody (sourcegraph)
  • Tabnine (tabnine)
  • Replit (replit)
  • Amazon Q Developer (amazon-q)
  • Kiro (kiro)
  • ByteDance AI / Trae / Coze / MarsCode / Cici (bytedance-ai)
  • Devin (devin)
  • v0 (v0)
  • Bolt.new (bolt)
  • Lovable (lovable)
  • Continue (continue)
  • CodeRabbit (coderabbit)
  • Phind (phind)
  • Midjourney (midjourney)
  • Stability AI (stability-ai)
  • Black Forest Labs / FLUX (black-forest-labs)
  • Ideogram (ideogram)
  • Adobe Firefly (adobe-firefly)
  • Leonardo AI (leonardo-ai)
  • Recraft (recraft)
  • Lovart (lovart)
  • OpenArt (openart)
  • ClipDrop (clipdrop)
  • ComfyUI (comfyui)
  • Civitai (civitai)
  • Suno (suno)
  • Udio (udio)
  • Runway (runway)
  • Pika (pika)
  • Luma AI (luma-ai)
  • HeyGen (heygen)
  • Synthesia (synthesia)
  • Descript (descript)
  • Gamma (gamma)
  • Hugging Face (huggingface)
  • Groq (groq)
  • OpenRouter (openrouter)
  • Together AI (together-ai)
  • Fireworks AI (fireworks-ai)
  • Replicate (replicate)
  • DeepInfra (deepinfra)
  • Cerebras (cerebras)
  • Chutes (chutes)
  • Cloudflare AI (cloudflare-ai)
  • Perplexity (perplexity)
  • You.com (you)
  • Genspark (genspark)
  • Poe (poe)
  • Character.AI (character-ai)
  • Inflection / Pi (inflection)
  • DuckDuckGo AI (duck-ai)
  • Dia Browser (dia-browser)
  • ElevenLabs (elevenlabs)
  • Otter.ai (otter-ai)
  • Grammarly (grammarly)
  • Jasper (jasper)
  • YouMind (youmind)
  • OpenClaw (openclaw)
  • Hermes Agent (hermes-agent)
  • Eigent (eigent)
  • Manus (manus)
  • Dify (dify)
  • LangChain (langchain)
  • CrewAI (crewai)
  • H2O.ai (h2o-ai)
  • Ollama (ollama)
  • LM Studio (lmstudio)

支持的客户端格式:

  • Clash / Mihomo
  • sing-box
  • Surge
  • Shadowrocket
  • Loon
  • Stash
  • Quantumult X
  • Egern

规则文件

把下面地址填到客户端的规则订阅、rule-set 或 rule-providers 配置里。

需要同时覆盖所有 AI 服务时,使用 all

https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/clash/all.yaml
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/sing-box/all.json
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/surge/all.list
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/shadowrocket/all.list
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/loon/all.list
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/stash/all.list
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/quantumult-x/all.list
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/egern/all.yaml

只需要某一个 AI 服务时,把 <provider> 换成上面括号里的 id,例如 anthropicopenaicopilotcursorhuggingface

https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/clash/<provider>.yaml
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/sing-box/<provider>.json
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/surge/<provider>.list
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/shadowrocket/<provider>.list
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/loon/<provider>.list
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/stash/<provider>.list
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/quantumult-x/<provider>.list
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/egern/<provider>.yaml
# 例如 Anthropic / Claude 的 Clash 规则:
https://cdn.jsdelivr.net/gh/VPSDance/ai-proxy-rules@main/rules/clash/anthropic.yaml

也可以订阅场景规则,把 <provider> 换成:

  • coding:编程 / IDE / CLI,例如 Codex、Copilot、Cursor、Claude Code
  • model:模型 API 平台,例如 OpenAI、Anthropic、OpenRouter、Groq
  • media:图 / 视频 / 音频生成,例如 Midjourney、Runway、Suno、ElevenLabs

未列出的场景,直接用具体 provider 或 all

多代理分流组合

多数客户端会按规则顺序从上到下匹配。需要让少数服务走专用代理、其余 AI 服务走另一个代理时,把具体 provider 放在前面,把 all 放在后面即可:

openai    -> AI-US
anthropic -> AI-US
all       -> AI-SG

all 只会处理前面未命中的 AI 流量。

国内 jsDelivr 偶尔不稳定时,可把 cdn.jsdelivr.net 替换为 testingcf.jsdelivr.netfastly.jsdelivr.netcdn.jsdmirror.com 等镜像。

目录结构

data/sources/   人工维护的来源配置
data/providers/ 由 data/sources/ 生成的 Provider 数据
data/cache/     上游响应缓存,上游故障时作为兜底
scripts/        同步与生成脚本
rules/          自动生成的规则文件

维护

安装依赖:

pnpm install

生成规则:

pnpm sync
pnpm generate

验证:

pnpm check
pnpm test

GitHub Actions 会在影响规则生成的文件变化时自动运行同步、检查和生成,并在 data/rules/ 有变化时提交生成结果。

References

About

AI 服务分流规则聚合: 多源合并 | 按 provider 精修 | 每日自动同步. 覆盖 OpenAI / Anthropic / Gemini / Cursor / Copilot 等主流 AI 服务, 适配 Clash / Mihomo / sing-box / Surge 等主流客户端.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.