Free Gemma 4 26B API on Cloudflare
通过 Cloudflare Workers AI 的免费 Gemma 4 26B API — 谷歌高效的多语言开放模型,每天 10,000 个免费神经元。
更新于 2026/6/92 个代码示例
关于该模型
为什么选 Gemma 4 26B?
Gemma 4 26B 是 Google 最新一代开源模型,采用高效的混合专家架构(约 4B 激活/26B 总量),以更低算力成本提供强质量。
语言与能力
多语言覆盖广,推理与指令遵循扎实——做助手、摘要、内容生成的优秀默认。
免费依据
经 /ai/run 端点在 Cloudflare Workers AI 每天 10,000 Neurons 免费额度内运行。
如何免费接入 (通过 Cloudflare Workers AI)
在 Cloudflare 工作人员 AI 上免费访问
呼叫Gemma 4 26B通过使用统一的 Cloudflare 的全局边缘/ai/run休息终点。 每个 Cloudflare 帐户包括每天免费10,000个神经元,因此多语言助手和内容工具免费运行。
认证(BYOK)
使用您自己的 CloudflareAccount ID和一个API 令牌通过工人 AI 访问Authorization: Bearer <token>.
在浏览器里试用
选个模型、粘贴你自己的免费 Key,即可运行。你的 Key 只用于调用一次该提供商,绝不存储在我们的服务器上。
选个模型、粘贴你自己的免费 Key,即可运行。你的 Key 只用于调用一次该提供商,绝不存储在我们的服务器上。
调用代码示例
curl
curl https://api.cloudflare.com/client/v4/accounts/$CF_ACCOUNT_ID/ai/run/@cf/google/gemma-4-26b-a4b-it \
-H "Authorization: Bearer $CF_API_TOKEN" \
-d '{"messages":[{"role":"user","content":"Translate \"good morning\" into Japanese, French, and Swahili."}]}'python
import os, requests
account = os.environ["CF_ACCOUNT_ID"]
token = os.environ["CF_API_TOKEN"]
resp = requests.post(
f"https://api.cloudflare.com/client/v4/accounts/{account}/ai/run/@cf/google/gemma-4-26b-a4b-it",
headers={"Authorization": f"Bearer {token}"},
json={"messages": [{"role": "user", "content": "Translate 'good morning' into Japanese, French, and Swahili."}]},
)
print(resp.json()["result"]["response"])
社区反馈
评论与你的 GitHub 账号绑定,登录后即可参与讨论。