GitHub 免费大模型 API 申请教程

github提供免费的大模型api,具体的型号可以选择Select a Model查看,主流的GPT-4,deepseek-v3有

GitHub 免费大模型 API 申请教程
地址:https://github.com/marketplace/models

GitHub 免费大模型 API 申请教程
不足的是,模型更新不及时,GPT-5.2,deepseek-3.2都没发现有,同时我的账号没有调用GPT-5的权限会400报错

GitHub 免费大模型 API 申请教程
也提供网页对话,网页对话同样没有GPT-5

GitHub 免费大模型 API 申请教程
获取 API(GitHub PAT)教程

GitHub Models 使用的是 GitHub Personal Access Token(PAT),不是单独再发一个新 Key

1.GitHub 头像打开Settings

GitHub 免费大模型 API 申请教程
2.找到Developer settings中的personal access tokens

GitHub 免费大模型 API 申请教程
3.点击 Generate new token(推荐选择Fine-grained, repo-scoped)

GitHub 免费大模型 API 申请教程
Token name:随便填,比如 github-models
Expiration:建议选 30 天和90 天
Permissions(权限):勾选与 Models,AI ,API 调用 相关权限;不需要给仓库写权限也能用(最小权限原则)
GitHub 免费大模型 API 申请教程
生成的token要尽快复制,刷新界面就会消失了
测试gpt-4o-mini,问法国的首都是哪里
GitHub 免费大模型 API 申请教程
回答
GitHub 免费大模型 API 申请教程
接口地址是:https://models.github.ai/inference/chat/completions
GitHub Models 提供免费大模型 API 每分钟请求数、每日请求数、每次请求 token 和并发请求数都有速率限制
GitHub 免费大模型 API 申请教程

转自:https://mp.weixin.qq.com/s/Omyyt_MYK8hAmANbDBL70g