2026 · 持续更新

免费 AI API 终极白嫖指南

聚合全网最稳定的免费额度渠道,每月最高可获 16 亿 Token,零成本实现大模型自由

13+ 主流平台
16亿 月均免费 Token
¥0 使用成本

FreeLLMAPI — 白嫖党的终极武器

想要自己动手搭建 AI 应用、测试大模型,却总是被高昂的 API 账单或 429 限流错误劝退?


这个项目能把从各家平台申请到的免费 API 额度,全部聚合成一个「无限 Token 池」(完美兼容 OpenAI 格式),支持自动切换和负载均衡,整合下来每月免费 Token 总量高达 16 亿

tashfeenahmed/freellmapi

全网最全免费 API 盘点

建议全部注册拿下,叠加使用效果最佳。

🤖 Google AI Studio 必选
Gemini 系列,免费额度天花板。支持超长上下文,调用频率极高,综合性价比第一。
↗ aistudio.google.com
⚡ Groq 极速
自研 LPU 芯片,全网推理速度最快,延迟极低,对速度敏感的场景首选。
↗ console.groq.com
💻 GitHub Models 程序员
程序员专属羊毛,有 GitHub 账号即可免费调用 GPT-4o 等顶级模型,无需信用卡。
↗ github.com/marketplace/models
🔀 OpenRouter
最强聚合平台,「Free Models」专区常有限免惊喜,一个接口访问数十家模型。
↗ openrouter.ai
🇪🇺 Mistral AI
欧洲之光,提供优质的免费 Experiment 试用计划,开源模型中质量拔尖。
↗ console.mistral.ai
🤝 Together AI
最强开源云算力,注册赠送额度,部分小参数模型完全免费,支持微调。
↗ api.together.ai
🟢 NVIDIA NIM
英伟达官方免费算力,跑分极高,适合高强度逻辑推理测试。
↗ build.nvidia.com
📝 Cohere
RAG 与文本处理专家,开发者永久免费试用 Key,企业级 Embed 能力。
↗ dashboard.cohere.com
🤗 Hugging Face
开源社区大本营,海量模型免部署直接调用,最全的开源模型库。
↗ huggingface.co
🔥 Cerebras 最快
全网推理速度天花板,每秒可输出上千 Token,专攻 Llama 3 系列极速推理。
↗ cloud.cerebras.ai
🦙 SambaNova 大模型
堆算力的狂魔,提供极高配的开源大模型免费调用,Llama 系列表现出色。
↗ cloud.sambanova.ai
☁️ Cloudflare Workers AI
白嫖 CF 遍布全球的边缘计算节点,每天有免费额度,有 CF 账号即可开启。
↗ dash.cloudflare.com
🇨🇳 智谱 AI (Zhipu) 国产首选
国产大模型第一梯队(GLM 系列)。新用户注册豪送 Token,GLM-4-Flash 完全免费。
↗ open.bigmodel.cn
🦙 Ollama Cloud
在线版 Ollama,无需本地显卡即可访问开源模型,适合轻量级应用场景。
↗ ollama.com

Linux 服务器一键部署

以 Ubuntu / Debian 为例。准备好各平台 Key 后,按以下步骤操作。

01

安装 Node.js 与 Git 环境

系统默认 Node.js 版本通常过低,需通过 NodeSource 安装 v20+。

bash
# 更新系统并安装 Git
sudo apt update
sudo apt install git curl -y

# 配置 Node.js v20 官方源
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -

# 安装 Node.js
sudo apt install -y nodejs

# 验证安装(应输出 v20.x.x)
node -v
npm -v
02

克隆项目并初始化

bash
# 克隆到 /opt 目录
cd /opt
git clone https://github.com/tashfeenahmed/freellmapi.git

# 安装依赖
cd freellmapi
npm install

# 配置环境变量(使用单引号包裹外层,避免双引号嵌套报错)
cp .env.example .env
sed -i "s/^ENCRYPTION_KEY=.*/ENCRYPTION_KEY=$(node -e 'console.log(require("crypto").randomBytes(32).toString("hex"))')/" .env

# 构建项目
npm run build

# 启动(验证是否正常)
npm start
💡 启动成功后访问 http://你的服务器IP:3001 进入管理后台,填入各平台 Key,系统自动生成聚合令牌。

Systemctl 守护进程配置

防止关闭 SSH 后服务中断,实现 24 小时稳定运行与开机自启。

01

创建服务文件

bash
sudo nano /etc/systemd/system/freellmapi.service
02

填入服务配置

直接复制以下内容,每行指令独立,无行尾注释,systemd 可正确解析。

[Unit]
Description=FreeLLMAPI Proxy Service
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=root
WorkingDirectory=/opt/freellmapi
# 生产环境直接调用 node 运行构建产物,避免 npm 包装进程导致管理失控
ExecStart=/usr/bin/node /opt/freellmapi/dist/index.js
Restart=always
RestartSec=5
# 默认面板端口
Environment="PORT=3001"
Environment="NODE_ENV=production"

[Install]
WantedBy=multi-user.target
03

启动并设为开机自启

bash
sudo systemctl daemon-reload
sudo systemctl start freellmapi
sudo systemctl enable freellmapi

# 查看状态(绿色 active 即成功)
sudo systemctl status freellmapi

🎉 大功告成

访问 http://你的服务器IP:3001 进入管理后台。
在后台填入所有平台 Key,系统自动开启负载均衡与降级路由。
一旦某渠道限流,自动无缝切换到下一节点,业务永不中断。


生产环境必做:非 root 运行 + HTTPS

服务直接跑在 root 下且暴露 HTTP,一旦出问题就是整台服务器被黑。以下两步是个人用户最低安全基线。

01

创建专用用户(权限隔离)

Node 服务以 root 运行,被入侵即整台服务器沦陷。专用用户把权限锁死在项目目录里。

bash
# 创建无登录权限的专用用户
sudo useradd -r -s /bin/false freellmapi

# 把项目目录所有权交给他
sudo chown -R freellmapi:freellmapi /opt/freellmapi

# 修改 systemd 配置中的 User 和 Group
sudo sed -i 's/^User=root/User=freellmapi/' /etc/systemd/system/freellmapi.service
sudo sed -i 's/^Group=.*/Group=freellmapi/' /etc/systemd/system/freellmapi.service

# 重载并重启
sudo systemctl daemon-reload
sudo systemctl restart freellmapi
sudo systemctl status freellmapi
02

Nginx 反向代理 + SSL(HTTPS 加密)

直接暴露 http://IP:3001 会导致 API Key 和对话内容明文传输,且很多客户端拒绝纯 HTTP 连接。

bash
# 安装 Nginx 和 Certbot
sudo apt update
sudo apt install nginx certbot python3-certbot-nginx -y

# 申请免费 SSL 证书(把 api.yourdomain.com 换成你的域名)
sudo certbot --nginx -d api.yourdomain.com
nginx
server {
    listen 80;
    server_name api.yourdomain.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    server_name api.yourdomain.com;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers on;

    location / {
        proxy_pass http://127.0.0.1:3001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_cache_bypass $http_upgrade;
    }
}
bash
# 启用配置并测试
sudo ln -s /etc/nginx/sites-available/freellmapi /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx

# 防火墙只开放必要端口
sudo ufw default deny incoming
sudo ufw allow 22/tcp    # SSH
sudo ufw allow 80/tcp    # HTTP
sudo ufw allow 443/tcp   # HTTPS
sudo ufw enable

后续更新只需三步

bash
# 停止服务
sudo systemctl stop freellmapi

# 拉取最新代码并更新依赖
cd /opt/freellmapi
git pull origin main && npm install

# 重启服务
sudo systemctl start freellmapi