Turn GitHub Copilot into OpenAI API
1.3K
🔥 Turn GitHub Copilot into OpenAI API | 将 GitHub Copilot 转换为 OpenAI API
# Pull and run the image | 拉取并运行镜像
docker run -d -p 8000:8000 liuzhuogood/github-copilot-openai-api:latest
# With API key authentication | 使用 API 密钥认证
docker run -d -p 8000:8000 -e API_KEY=your_secret_key liuzhuogood/github-copilot-openai-api:latest
First time setup | 首次使用:
For detailed documentation, please visit our GitHub Repository. 更多详细文档,请访问我们的 GitHub 仓库。
This project provides an OpenAI API-compatible interface by reverse engineering the GitHub Copilot API. It allows you to use GitHub Copilot's capabilities through a standard OpenAI API interface, supporting streaming output and multiple models.
docker run -d -p 8000:8000 liuzhuogood/github-copilot-openai-api:latest
With API key authentication:
docker run -d -p 8000:8000 -e API_KEY=your_secret_key liuzhuogood/github-copilot-openai-api:latest
# Clone the repository
git clone https://github.com/liuzhuogood/github-copilot-openai-api.git
cd github-copilot-openai-api
# Build Docker image
docker build -t github-copilot-openai-api .
# Run container
docker run -d -p 8000:8000 github-copilot-openai-api
Environment variables:
HOST: Server host (default: 0.0.0.0)PORT: Server port (default: 8000)API_KEY: Optional API key for authenticationcurl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-d '{
"model": "gpt-4",
"messages": [
{
"role": "user",
"content": "Hello, who are you?"
}
],
"stream": true
}'
本项目通过逆向工程 GitHub Copilot API,提供了一个与 OpenAI API 兼容的接口。它允许你通过标准的 OpenAI API 接口使用 GitHub Copilot 的功能,支持流式输出和多种模型。
docker run -d -p 8000:8000 liuzhuogood/github-copilot-openai-api:latest
使用 API 密钥认证:
docker run -d -p 8000:8000 -e API_KEY=your_secret_key liuzhuogood/github-copilot-openai-api:latest
# 克隆仓库
git clone https://github.com/liuzhuogood/github-copilot-openai-api.git
cd github-copilot-openai-api
# 构建 Docker 镜像
docker build -t github-copilot-openai-api .
# 运行容器
docker run -d -p 8000:8000 github-copilot-openai-api
环境变量:
API_KEY:可选的 API 密钥认证curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: YOUR_API_KEY" \
-d '{
"model": "gpt-4",
"messages": [
{
"role": "user",
"content": "你好,请问你是谁?"
}
],
"stream": true
}'
Content type
Image
Digest
sha256:7255c20b0…
Size
40.8 MB
Last updated
over 1 year ago
docker pull liuzhuogood/github-copilot-openai-api