Skip to content
Vincent's Notes
Go back

Use Copilot for free unlimited use of GPT-4 API

by Vincent Yang

Copilot 是 GitHub 提供的一项 AI 代码补全的工具,不久之前增加了 Chat 的功能。正是因为支持了 Chat 功能,所以可以把 Copilot Chat 的 API 转换为 OpenAI 官方的 API。重要的是,还支持 GPT-4,虽然不是最新版本的 GPT-4 模型,但是基本也够用。

准备工作

部署

在开始之前,先获取你的 Copilot Token。

bash
bash -c "$(curl -fsSL https://raw.githubusercontent.com/aaamoon/copilot-gpt4-service/master/shells/get_copilot_token.sh)"

接下来主要使用的是 aaamoon/copilot-gpt4-serviceGitHub 目前的版本还没有合并我的 PR,所以在部署之后,每次请求都应该携带在上一步获取的 Copilot Token。我改进之后的版本是当你在环境变量或者配置文件中填写了 Copilot Token,则无需在每次请求时携带,会优先使用环境变量或者配置文件提供的 Token。

bash
git clone https://github.com/aaamoon/copilot-gpt4-service && cd copilot-gpt4-service
nano compose.yaml # 修改成你自己的 COPILOT_TOKEN
docker compose up -d

部署完成后即可在任何支持 OpenAI API 的 App 中填写你的 API Endpoint,如果 API Key 不能留空的话可以随便写。

注意事项


Use Copilot for free unlimited use of GPT-4 API
Published at
January 14, 2024
ShareShare this post on WhatsappShare this post on FacebookShare this post on XShare this post on TelegramShare this post on PinterestShare this post via email

Previous Post
Traveling in Japan
Next Post
Servers I am using

Comments 0

Finished reading? Why not leave a word.