FreeAITokens
简体中文

文档

这里是 FreeAITokens 背后的细节,写给开发者和好奇的人。如果你只想让它跑起来,请下载应用并按设置操作。

命令行

装有 Node.js 20 或更新版本的话,你不需要应用:

npx freeaitokens               # start the local endpoint
npx freeaitokens add           # add a free provider key (guided)
npx freeaitokens list          # providers, key status, what is left today
npx freeaitokens remove <id>   # delete a stored key

或者一次性安装:npm install -g freeaitokens。本地接口只监听 127.0.0.1:4949,并且需要启动横幅里显示的本地令牌。应用和命令行共用同样的密钥和设置。

配合你的工具使用

工具方法
Claude Codenpx freeaitokens claude(后面可以跟任何 Claude Code 的参数)
Codexnpx freeaitokens codex
Gemini CLInpx freeaitokens gemini
OpenCodenpx freeaitokens setup opencode,然后选择模型 freeaitokens/free
Kilo Code CLI、Qwen Code、Goose、Aidernpx freeaitokens kilo / qwen / goose / aider
Zed、JetBrains AI、VS Codenpx freeaitokens setup zed / jetbrains / vscode 会打印出该粘贴的内容
Continue、Cline、Crush、Roo Codenpx freeaitokens setup cline(或该工具的名字)会打印出要填的值
任何兼容 OpenAI 的工具Base URL http://127.0.0.1:4949/v1,模型 free,密钥取自启动横幅
Anthropic、Gemini 或 Ollama 客户端Base URL http://127.0.0.1:4949,密钥相同

启动器只影响那一次会话,不会往你工具的配置里写任何东西。setup opencode 会在你已有的服务商旁边添加一个,并保留备份;用 --undo 可以恢复。

它做了什么

不止对话

同一个接口还支持 OpenAI 的这些路径:向量嵌入(/v1/embeddings)、普通文本补全(/v1/completions)、图片(/v1/images/generations)、文字转语音(/v1/audio/speech)、语音转文字(/v1/audio/transcriptions)和视频(/v1/videos)。每种请求都会发给提供该功能的免费服务商,同样有自动切换和额度限制。

付费密钥可以排在免费密钥之后,作为最后的备选:只有在没有免费模型能处理请求时才会用,每次付费请求都会打印出来,并且有每日上限。

选项作用
--port <n>本地接口的端口(默认 4949)
--free-only从不使用付费密钥
--paid-cap <n>每天最多的付费请求数(默认 200)

全部 27 家服务商

它们加起来每月最多公布 约 75.2亿 个免费 token。这个数字是把各家公布的免费额度加总得到的,只公布了请求次数限制的,按每次请求 2,000 个 token 计算;其中大部分来自少数几份大额度,而且你只有为每家服务商都添加密钥才能用上。没有公布额度的服务商按零计算。

服务商是否需要密钥免费额度须知
Kilo Gateway否未公布No account needed. About 200 requests an hour per IP address. Free prompts and answers may be used for training.
Groq免费密钥每个模型每天最多 500,000 个 token
Cerebras免费密钥每个模型每天最多 216,000,000 个 token
OpenRouter免费密钥每个模型每天最多 50 次请求Free models allow about 50 requests a day on an account with no credit.
Google Gemini免费密钥每个模型每天最多 1,000 次请求Google's terms limit the API to professional or business use. Free-tier prompts may be used to improve Google's products.
SEA-LION免费密钥每分钟 10 次请求Google sign-in, one trial key per user, and the terms allow AI Singapore to use content to improve its services.
Typhoon免费密钥每分钟 200 次请求A free research showcase API: SCB 10X collects usage data to improve its models and API.
NVIDIA NIM免费密钥未公布Free access is a trial for prototyping and testing only; production use needs an NVIDIA AI Enterprise license, and rate limits vary by model and load.
Z.ai (GLM)免费密钥未公布Only the Flash models are free. Their rate limits are not published and show only in the Z.ai console.
Nabh Cloud免费密钥每个模型每天最多 500 次请求Reseller. Only GPT OSS 20B is free, at 5 requests a minute and 500 a day.
KiosAPI免费密钥未公布Reseller (Indonesia). A small daily free quota on its free-tier models; the amounts are not published. One account per person.
Kenari免费密钥每个模型每天最多 50 次请求Reseller (Indonesia), no company named. Free models are capped at 5 a minute and 50 a day; upstream providers' policies apply.
Plugsky免费密钥每个模型每天最多 50,000 个 tokenReseller. 100 free requests and 50K tokens a day. The free model does not say what runs underneath, and failover may switch models.
ZRO (MoonMath)免费密钥未公布Reseller. The $0 plan gives some DeepSeek V4.1 Flash use each day; the amount is not stated.
Requesty免费密钥每个模型每天最多 200 次请求Reseller. Free models at 200 a day and 20 a minute. Logs are kept 30 days and Requesty may train on free-plan content.
BazaarLink免费密钥每分钟 10 次请求Reseller (Taiwan). 10 a minute and a small daily allowance. Failed, flagged and sampled requests are kept in full.
Logfare免费密钥每个模型每天最多 5,000 次请求Reseller. 5,000 free requests a day, but you must link Discord and stay in its server. Everything is logged and used for evals unless you opt out.
CheapLLM免费密钥未公布Small reseller on its own GPUs. Free during its beta; afterwards only about 5K tokens in and 1K out per hour. One request at a time.
OVHcloud AI Endpoints否每分钟 2 次请求No account needed. About 2 requests a minute per IP address for each model.
LLM7.io免费密钥未公布Small operator with no published free-tier terms or limits; data handling is unclear.
AI Horde免费密钥未公布Volunteer workers run the models and can see your prompts; it is queued, slow, has no tool calls, and the model list changes often.
BlockRun免费密钥每分钟 30 次请求
Electron Hub免费密钥每个模型每天最多 10 次请求Providers behind :free models may train on your prompts. A Neutrino is spent even when a request fails, and going over 5 rpm triggers a 3-minute cooldown.
Septor Labs免费密钥每个模型每天最多 250,000 个 tokenFree requests go to third-party aggregators (some hosted in China) that may keep prompts; not for personal or sensitive data.
Api.Airforce免费密钥每个模型每天最多 1,000 次请求Small reseller with unclear upstream sources; logs IPs and usage, and the free plan allows only 1 request per minute.
Routeway免费密钥每个模型每天最多 200 次请求Operator is not named in its terms, and requests are scanned before routing to upstream providers.
Cloudflare Workers AI免费密钥未公布10,000 free Neurons a day, shared by every Cloudflare model you use (chat, embeddings, images, speech, transcription); resets at 00:00 UTC. The key is your Account ID plus an API token.

暂不支持

源代码、问题反馈和完整的 README:GitHub。