[UNTESTED] [liushoukai/copilot-api-proxy] 1 endpoint(s)
ChatGPT
API Proxy/ChatGPT
2,129 characters
Status: [UNTESTED]
Endpoints found:
http://127.0.0.1:4142/v1/messages
Source: https://github.com/liushoukai/copilot-api-proxy
# copilot-api-proxy
English | [中文](./README.zh.md)
A local proxy that wraps GitHub Copilot as a standard **OpenAI / Anthropic**-compatible API.
All you need is a GitHub Copilot subscription — no extra API key required.
---
## Quick Start
### 1. Authenticate
```bash
./copilot-api-proxy auth
```
> First run only. Authorizes via GitHub Device Flow and caches the token locally.
### 2. Start the proxy
```bash
./copilot-api-proxy start
```
The proxy is now running at **`http://127.0.0.1:4142`**.
### 3. Configure Claude Code
Open your Claude Code `settings.json` and add:
```json
{
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:4142"
}
}
```
> **Where is `settings.json`?**
> macOS: `~/Library/Application Support/Claude/claude_code/settings.json`
> Linux: `~/.config/Claude/claude_code/settings.json`
That's it. Start Claude Code and all Anthropic API requests will be routed through your Copilot subscription.
---
## Build from Source
```bash
cargo build --release
# Binary: ./target/release/copilot-api-proxy
```
---
## CLI Reference
### `auth`
```bash
./copilot-api-proxy auth [flags]
```
| Flag | Description |
|------|-------------|
| `-f, --force` | Force re-authentication, ignoring cached token |
| `--show-token` | Print the GitHub Token after auth |
### `start`
```bash
./copilot-api-proxy start [flags]
```
| Flag | Default | Description |
|------|---------|-------------|
| `-p, --port` | `4142` | Listening port |
| `--host` | `127.0.0.1` | Listening address. Use `0.0.0.0` to expose to LAN (use with caution) |
| `-v, --verbose` | `false` | Enable DEBUG level logging |
| `-g, --github-token` | — | Provide a GitHub Token directly, skip auth flow |
| `-a, --account-type` | `individual` | `individual` / `business` / `enterprise` |
| `--show-token` | `false` | Print GitHub Token and Copilot Token on startup |
| `--proxy` | — | HTTP/HTTPS proxy URL, e.g. `http://127.0.0.1:7890`. Equivalent to setting `HTTP_PROXY` and `HTTPS_PROXY`