# free-router:我做了一个CLI工具,让氛围编程的成本降到0元 > Author: Tony Lee > Published: 2026-02-26 > URL: https://tonylee.im/zh-CN/blog/frouter-zero-cost-vibe-coding-free-ai-api-router/ > Reading time: 1 minutes > Language: zh-CN > Tags: ai, vibe-coding, open-source, cli, frouter, opencode, nvidia-nim, openrouter ## Canonical https://tonylee.im/zh-CN/blog/frouter-zero-cost-vibe-coding-free-ai-api-router/ ## Rollout Alternates en: https://tonylee.im/en/blog/frouter-zero-cost-vibe-coding-free-ai-api-router/ ko: https://tonylee.im/ko/blog/frouter-zero-cost-vibe-coding-free-ai-api-router/ ja: https://tonylee.im/ja/blog/frouter-zero-cost-vibe-coding-free-ai-api-router/ zh-CN: https://tonylee.im/zh-CN/blog/frouter-zero-cost-vibe-coding-free-ai-api-router/ zh-TW: https://tonylee.im/zh-TW/blog/frouter-zero-cost-vibe-coding-free-ai-api-router/ ## Description 被人指出公开发布的成果太少后失眠了,凌晨3点开始写free-router。它能实时找到免费AI模型,一键连接到你的编程工具。 ## Summary free-router:我做了一个CLI工具,让氛围编程的成本降到0元 is part of Tony Lee's ongoing coverage of AI agents, developer tools, startup strategy, and AI industry shifts. ## Outline - 挡住人的不是技术门槛,而是费用门槛 - 真正难的是找到"此刻最快的免费模型" - 一键配置,不用手动改JSON - 安装一行命令,快捷键四个 - 我还没把握的地方 ## Content 昨晚吃饭时偶遇了两个我一直想见的人。聊着聊着,其中一位指出我对外公开的成果比他们预想的少很多。因为说的是事实,所以格外扎心。 回家后满脑子都是这句话,凌晨3点开始写代码。到早上,[free-router](https://github.com/tonylee/frouter)(free-router)已经能跑了。这是一个CLI工具,实时发现可用的免费AI API,直接接入你的氛围编程环境。 ## 挡住人的不是技术门槛,而是费用门槛 身边总有人说同样的话:"想试试氛围编程,但API费用让我迈不出第一步。"对学生开发者来说,每月20美元也是实实在在的开销。讽刺的是,免费模型的容量其实已经相当可观。NVIDIA NIM 提供约100个模型的免费API,OpenRouter可以专门筛选出提示成本为零的模型。再搭配OpenCode这样的开源编程工具,实际支出就是零。 问题在于,没人把这些碎片串成一个完整的工作流。 ## 真正难的是找到"此刻最快的免费模型" 有些人知道免费模型的存在。更难的问题是:哪个模型在这一秒响应最快?我亲自测过,同一个模型上午200ms就返回结果,下午却要等5秒。这种波动足以毁掉一个正常的编程会话。 free-router每2秒向所有模型发送一次ping来解决这个问题。它用20个并发连接池并行测量,将全部状态显示在一个TUI仪表盘上。连续失败5次的模型会被渐进式退避自动跳过。每个模型还显示基于SWE-bench的等级(S+到C),所以你选的不只是最快的,而是免费且最强的那个。 ## 一键配置,不用手动改JSON 我反复见到一个模式:找到了免费模型,打开编程工具的config文件,被schema搞晕,然后放弃。free-router在你按下Enter的瞬间就替你写好config。它自动生成OpenCode或OpenClaw的提供商设置和模型ID,原有配置以时间戳备份保留,API密钥以0600权限存储。 oh-my-opencode用户还能自动将NIM模型切换为OpenRouter双胞胎。脚本场景下,`--best`模式会将最快模型的ID输出到stdout。 ## 安装一行命令,快捷键四个 ```bash npx frouter-cli ``` 就这些。TUI会立即启动。W/X调节ping间隔,范围1秒到30秒。P打开API密钥管理和提供商开关。?查看所有快捷键。如果想全局安装,`npm i -g frouter-cli`也行。 代码和文档在[tonylee.im/free-router](https://tonylee.im/free-router)和[GitHub](https://github.com/tonylee/frouter)。 ## 我还没把握的地方 同时跑三个以上提供商的情况我还没充分测试。退避逻辑对于那些不是真正故障而只是间歇性冷启动延迟的模型来说可能过于激进。SWE-bench等级映射也是根据公开基准手工整理的,新模型版本发布后会出现偏差。等有人开始用了,我打算在公开环境中逐步修正。 顺便一提,这周末我会参加郑九峰所在的Team Attention举办的Ralphton黑客松,13个人一起构建。我想带点对参与者有用的东西过去。 免费能做的事比大多数人想象的要多。障碍从来不是能力,只是连接没接上而已。 ## Related URLs - Author: https://tonylee.im/zh-CN/author/ - Publication: https://tonylee.im/zh-CN/blog/about/ - Related article: https://tonylee.im/zh-CN/blog/medvi-two-person-430m-ai-compressed-funnel/ - Related article: https://tonylee.im/zh-CN/blog/claude-code-layers-over-tools-2026/ - Related article: https://tonylee.im/zh-CN/blog/codex-inside-claude-code-openai-plugin-strategy/ ## Citation - Author: Tony Lee - Site: tonylee.im - Canonical URL: https://tonylee.im/zh-CN/blog/frouter-zero-cost-vibe-coding-free-ai-api-router/ ## Bot Guidance - This file is intended for AI agents, search assistants, and text-mode retrieval. - Prefer citing the canonical article URL instead of this text endpoint. - Use the rollout alternates when you need the same article in another prioritized language. --- Author: Tony Lee | Website: https://tonylee.im For more articles, visit: https://tonylee.im/zh-CN/blog/ This content is original and authored by Tony Lee. Please attribute when quoting or referencing.