Summary: Use GitHub Copilot to access the GPT-4 model for free
Note: Multiple GitHub Copilot accounts have already been banned for using this method, so it’s no longer recommended.
Prerequisites
What you’ll need:
GitHub Copilot
If you’re a college student, you can take advantage of GitHub’s education benefits — after verification, you’ll get access to GitHub Copilot. If you’re not a student and don’t want to pay the full price, you can search online for ways to get it for free or at a discounted rate.
Server (Optional)
aaamoon/copilot-gpt4-service: Convert Github Copilot to ChatGPT, free to use the GPT-4 model
This project leverages Copilot to call GPT models, enabling free access to GPT-4.
The repo author has deployed a public service, but since so many people use it, your Copilot could get banned by GitHub due to IP-related issues. Self-hosting the service is a safer option.
Getting Your Copilot Token
aaamoon/copilot-gpt4-service: Convert Github Copilot to ChatGPT, free to use the GPT-4 model
The project documentation covers several ways to obtain a Copilot token. If you want to skip the hassle, you can grab one directly from the site below — just keep in mind that since it’s not self-hosted, there’s some risk involved.
Get Copilot Token (cocopilot.org)
If you don’t want to self-host copilot-gpt4-service and ChatGPT-Next-Web, you can use the repo author’s NextChat (gpt4copilot.tech) directly. Just fill in the target URL with:
1 | https://gpt4copilot.tech/ |
For the API key, directly use the Copilot Token you obtained earlier.It seems this is no longer working — self-hosting is the only option now.
Setting Up copilot-gpt4-service
Build it with Docker:
1 | docker run -d \ |
If you need to specify a port, just change the 8080 before the colon to whatever you want — no other changes needed.
Once this step is done, you can already use HTTP-compatible clients to make calls, like Chatbox - Your AI assistant for work and study, free official download (chatboxai.app)
Setting Up ChatGPT-Next-Web
Pull the image:
1 | docker pull yidadaa/chatgpt-next-web |
If copilot-gpt4-service is deployed on the same server, you can set the BASE_URL parameter to http://copilot-gpt4-service:8080/
1 | docker run -d -p 3000:3000 \ |
Check the container info:
1 | docker ps |
Then add both containers to the same network:
1 | # Create a new network |
Usage
Visit <ip>:3000 to start using it. On first login, you’ll need to enter the password to access the configured API key, then switch the model to GPT-4 in the model selector.
Reference
ChatGPTNextWeb/ChatGPT-Next-Web: A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). Have your own cross-platform ChatGPT/Gemini app with one click. (github.com)
aaamoon/copilot-gpt4-service: Convert Github Copilot to ChatGPT, free to use the GPT-4 model