A wrapper around GitHub Copilot API to make it OpenAI compatible, making it usable for other tools.
copilot-api-demo.mp4
- Bun (>= 1.2.x)
- GitHub account with Copilot Individual subscription
To install dependencies, run:
bun installYou can run the project directly using npx:
npx copilot-api@latestWith options:
npx copilot-api --port 8080The command accepts several command line options:
| Option | Description | Default |
|---|---|---|
| --port, -p | Port to listen on | 4141 |
| --verbose, -v | Enable verbose logging | false |
| --log-file | File to log request/response details | - |
Example with options:
npx copilot-api@latest --port 8080 --verbose --log-file copilot-api.txtThe project can be run from source in several ways:
bun run devbun run start- Use a free model from free provider like Gemini/Mistral/Openrouter for the weak model
- Rarely use architect mode
- Do not enable automatic yes in aider config
- Claude 3.7 thinking mode uses more tokens. Use it sparingly
- Manual approval for every request
- Rate limiting (only allow request every X seconds)
- Token counting