本项目可能导致你的 copilt 账号被封,请谨慎使用。
点击链接:cocopilot,根据提示拿到 ghu_xxxx 格式的 token。务必保存好,不要泄露给其他人。
点击右侧的 release 下载跟你运行环境一致的可执行文件
./copilot2gpt
默认监听端口为 8081,可以在 .env 中修改
可以在任意第三方客户端使用
API 域名:http://127.0.0.1:8081
API token:ghu_xxx
curl 测试
curl --location 'http://127.0.0.1:8081/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ghu_xxx' \
--data '{
"stream": "true",
"model": "gpt-4",
"messages": [{"role": "user", "content": "hi"}]
}'