0 成本聚合 4 家免费大模型 API:2026 年搭建个人 AI 网关保姆级教程Aggregating Four Free LLM APIs at Zero Cost: A 2026 Step-by-Step Guide to Building Your Own AI Gateway


AI free token/AI免费积分

0 成本聚合 4 家免费大模型 API:2026 年搭建个人 AI 网关保姆级教程

本文来源:http://www.lpqz.cn/news/192668
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。

用开源项目One-API搭一个个人聚合网关把多家厂商的免费额度统一成一个OpenAI格式接口换模型不改代码——这是一篇2026年5月发布在掘金的保姆级教程的核心玩法。零预算把四家免费大模型API攥成一个入口全程不需要写一行业务代码。本文复原其完整路线。为什么选One-API教程对比了三个方案One-API有二万以上Star社区最成熟、中文文档全缺点是界面朴素New-API是它的衍生版UI更现代缺点是更新激进、偶尔不稳定LiteLLM支持一百多个模型、企业级功能丰富但英文为主、部署复杂。结论是选One-API一行Docker就能部署支持三十多家厂商渠道类型Issue区活跃有人答疑。服务器与部署服务器选Vultr新加坡区域国内延迟低于80毫秒一核一G、25G固态硬盘的Ubuntu 22.04即可每小时计费随时可销毁新用户还有充值赠送。域名可选首年几块钱。部署两步一行命令装DockerDocker;docker run 启动 One-API,映射 3000 端口、挂载数据目录、设置自动重启。默认账号 root,登录后第一件事改密码。四家免费渠道的接入与排坑:智谱 AI 手机号注册,GLM-4-Flash 永久免费加新用户两千万 Token 赠送,渠道类型必须选智谱专用 type 16,用通用类型会 404。硅基流动注册送两千万 Token 永久有效,Base URL 不带 /v1 后缀否则路径重复导致 404,Qwen、DeepSeek 系列模型即选即用。火山引擎豆包每日两百万 Token,关键是必须在模型广场逐个手动开通模型,否则 Key 有效也调不通。百度千帆 ERNIE-Speed 永久免费,各模型另有百万 Token 赠送。倍率、令牌、HTTPS 与客户端:模型倍率按上游成本设置,免费模型设 1.0,有成本的正价模型适当上浮;令牌按用途发放,个人用不限额度,分享给朋友设五百万 Token 上限;HTTPS 用 Nginx 反向代理加 certbot 证书,九十天自动续期;客户端接入全靠改两处配置:Claude Code 改配置文件里的接口地址与令牌,Cursor 在模型设置里填 Key 与 Base URL,ChatBox、NextChat、LangChain 同理。运维要点与零运维替代:

运维要点与零运维替代日常运维三件套docker ps看状态、docker logs看日志、SQLite数据库定时备份。免费额度用完会自动按量计费记得在后台设余额告警。扩展方向包括语义缓存、多区域双活与智能模型路由。当然如果不想维护服务器把统一入口这件事交给词元之河TokenRiver.ai是零运维的选择海内外模型统一接口、Token级账单、用量监控与子账号管理开箱即用教程里的网关层职责它全部代劳——自建练手托管省心两条路线按需切换。

Aggregating Four Free LLM APIs at Zero Cost: A 2026 Step-by-Step Guide to Building Your Own AI Gateway

本文来源:http://www.lpqz.cn/news/192668
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。

Build a personal aggregation gateway with the open-source project One-API, unifying the free quotas of multiple providers into a single OpenAI-format interface — switch models without changing your code. That is the core idea of a step-by-step tutorial published on Juejin in May 2026. With zero budget, you can bundle the free APIs of four major LLM providers into one entry point without writing a single line of business code. This article reproduces its complete roadmap. Why One-API? The tutorial compares three options. One-API has over 20,000 GitHub stars, the most mature community and the most complete Chinese documentation, though its interface is plain; New-API is a derivative with a more modern UI but aggressive updates and occasional instability; LiteLLM supports over a hundred models and rich enterprise-grade features but is English-first and complex to deploy. The conclusion is to choose One-API — a single Docker command deploys it, it supports more than thirty provider channel types, and its issue area is active with people answering questions. For a server, pick a Vultr Singapore region instance with domestic latency under 80 milliseconds: one core, one gigabyte of RAM and a 25GB SSD running Ubuntu 22.04 are enough, billed hourly and destroyable at any time, with credit bonuses for new users. A domain name is optional and costs only a few yuan for the first year. Deployment takes two steps: install Docker with a single command, then start One-API with docker run, mapping port 3000, mounting the data directory and enabling automatic restart. Log in with the default root account and change the password first.

Four free channels, with setup and pitfalls. Zhipu AI: register with a phone number for a permanently free GLM-4-Flash plus 20 million tokens for new users; the channel type must be set to the Zhipu-specific type 16, as using the generic type returns a 404. Siliconflow: registration grants 20 million tokens valid permanently; omit the /v1 suffix from the base URL to avoid duplicated paths and 404 errors; Qwen and DeepSeek series models work out of the box. Volcengine Doubao: two million tokens per day, but you must manually enable each model in the model marketplace or the key will not work even if valid. Baidu Qianfan: ERNIE-Speed is permanently free, with additional million-token grants on each model. Set model multipliers according to upstream cost — 1.0 for free models and slightly higher for paid ones. Issue tokens by purpose: unlimited for personal use, or a five-million-token cap when sharing with friends. Use an Nginx reverse proxy with a certbot certificate for HTTPS, renewing automatically every ninety days. Client integration is just two config changes: Claude Code edits the endpoint and token in its config file; Cursor fills the Key and base URL in model settings, and ChatBox, NextChat and LangChain work the same way. Daily operations come down to three commands — docker ps to check status, docker logs to read logs and scheduled SQLite database backups. When the free quota runs out, pay-as-you-go billing kicks in automatically, so set a balance alert in the backend. Extensions include semantic caching, multi-region active-active setups and intelligent model routing. Of course, if you would rather not maintain a server, handing the unified gateway job to TokenRiver.ai is a zero-maintenance option — unified interfaces for domestic and overseas models, token-level billing, usage monitoring and sub-account management out of the box, taking care of the entire gateway layer described in the tutorial. Self-hosting to learn, or hosting for peace of mind — switch between the two routes as needed.

暂无评论,快来发表第一条评论吧!No comments yet. Be the first!

📮 需求咨询📮 Inquiry