Skip to content

Commit 38f7d09

Browse files
committed
chore: rename to copilot-proxy-api, update docs
1 parent a46d446 commit 38f7d09

1 file changed

Lines changed: 29 additions & 31 deletions

File tree

README.md

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
>
1818
> Use this proxy responsibly to avoid account restrictions.
1919
20-
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/E1E519XS7W)
21-
2220
---
2321

2422
**Note:** If you are using [opencode](https://github.com/sst/opencode), you do not need this project. Opencode supports GitHub Copilot provider out of the box.
@@ -63,7 +61,7 @@ bun install
6361
Build image
6462

6563
```sh
66-
docker build -t copilot-api .
64+
docker build -t copilot-proxy-api .
6765
```
6866

6967
Run the container
@@ -75,33 +73,33 @@ mkdir -p ./copilot-data
7573
# Run the container with a bind mount to persist the token
7674
# This ensures your authentication survives container restarts
7775

78-
docker run -p 4141:4141 -v $(pwd)/copilot-data:/root/.local/share/copilot-api copilot-api
76+
docker run -p 4141:4141 -v $(pwd)/copilot-data:/root/.local/share/copilot-proxy-api copilot-proxy-api
7977
```
8078

8179
> **Note:**
82-
> The GitHub token and related data will be stored in `copilot-data` on your host. This is mapped to `/root/.local/share/copilot-api` inside the container, ensuring persistence across restarts.
80+
> The GitHub token and related data will be stored in `copilot-data` on your host. This is mapped to `/root/.local/share/copilot-proxy-api` inside the container, ensuring persistence across restarts.
8381
8482
### Docker with Environment Variables
8583

8684
You can pass the GitHub token directly to the container using environment variables:
8785

8886
```sh
8987
# Build with GitHub token
90-
docker build --build-arg GH_TOKEN=your_github_token_here -t copilot-api .
88+
docker build --build-arg GH_TOKEN=your_github_token_here -t copilot-proxy-api .
9189

9290
# Run with GitHub token
93-
docker run -p 4141:4141 -e GH_TOKEN=your_github_token_here copilot-api
91+
docker run -p 4141:4141 -e GH_TOKEN=your_github_token_here copilot-proxy-api
9492

9593
# Run with additional options
96-
docker run -p 4141:4141 -e GH_TOKEN=your_token copilot-api start --verbose --port 4141
94+
docker run -p 4141:4141 -e GH_TOKEN=your_token copilot-proxy-api start --verbose --port 4141
9795
```
9896

9997
### Docker Compose Example
10098

10199
```yaml
102100
version: "3.8"
103101
services:
104-
copilot-api:
102+
copilot-proxy-api:
105103
build: .
106104
ports:
107105
- "4141:4141"
@@ -122,19 +120,19 @@ The Docker image includes:
122120
You can run the project directly using npx:
123121
124122
```sh
125-
npx copilot-api@latest start
123+
npx copilot-proxy-api@latest start
126124
```
127125

128126
With options:
129127

130128
```sh
131-
npx copilot-api@latest start --port 8080
129+
npx copilot-proxy-api@latest start --port 8080
132130
```
133131

134132
For authentication only:
135133

136134
```sh
137-
npx copilot-api@latest auth
135+
npx copilot-proxy-api@latest auth
138136
```
139137

140138
## Command Structure
@@ -217,46 +215,46 @@ Using with npx:
217215

218216
```sh
219217
# Basic usage with start command
220-
npx copilot-api@latest start
218+
npx copilot-proxy-api@latest start
221219

222220
# Run on custom port with verbose logging
223-
npx copilot-api@latest start --port 8080 --verbose
221+
npx copilot-proxy-api@latest start --port 8080 --verbose
224222

225223
# Use with a business plan GitHub account
226-
npx copilot-api@latest start --account-type business
224+
npx copilot-proxy-api@latest start --account-type business
227225

228226
# Use with an enterprise plan GitHub account
229-
npx copilot-api@latest start --account-type enterprise
227+
npx copilot-proxy-api@latest start --account-type enterprise
230228

231229
# Enable manual approval for each request
232-
npx copilot-api@latest start --manual
230+
npx copilot-proxy-api@latest start --manual
233231

234232
# Set rate limit to 30 seconds between requests
235-
npx copilot-api@latest start --rate-limit 30
233+
npx copilot-proxy-api@latest start --rate-limit 30
236234

237235
# Wait instead of error when rate limit is hit
238-
npx copilot-api@latest start --rate-limit 30 --wait
236+
npx copilot-proxy-api@latest start --rate-limit 30 --wait
239237

240238
# Provide GitHub token directly
241-
npx copilot-api@latest start --github-token ghp_YOUR_TOKEN_HERE
239+
npx copilot-proxy-api@latest start --github-token ghp_YOUR_TOKEN_HERE
242240

243241
# Run only the auth flow
244-
npx copilot-api@latest auth
242+
npx copilot-proxy-api@latest auth
245243

246244
# Run auth flow with verbose logging
247-
npx copilot-api@latest auth --verbose
245+
npx copilot-proxy-api@latest auth --verbose
248246

249247
# Show your Copilot usage/quota in the terminal (no server needed)
250-
npx copilot-api@latest check-usage
248+
npx copilot-proxy-api@latest check-usage
251249

252250
# Display debug information for troubleshooting
253-
npx copilot-api@latest debug
251+
npx copilot-proxy-api@latest debug
254252

255253
# Display debug information in JSON format
256-
npx copilot-api@latest debug --json
254+
npx copilot-proxy-api@latest debug --json
257255

258256
# Initialize proxy from environment variables (HTTP_PROXY, HTTPS_PROXY, etc.)
259-
npx copilot-api@latest start --proxy-env
257+
npx copilot-proxy-api@latest start --proxy-env
260258
```
261259

262260
## Using the Usage Viewer
@@ -265,7 +263,7 @@ After starting the server, a URL to the Copilot Usage Dashboard will be displaye
265263

266264
1. Start the server. For example, using npx:
267265
```sh
268-
npx copilot-api@latest start
266+
npx copilot-proxy-api@latest start
269267
```
270268
2. The server will output a URL to the usage viewer. Copy and paste this URL into your browser. It will look something like this:
271269
`https://ericc-ch.github.io/copilot-api?endpoint=http://localhost:4141/usage`
@@ -291,7 +289,7 @@ There are two ways to configure Claude Code to use this proxy:
291289
To get started, run the `start` command with the `--claude-code` flag:
292290

293291
```sh
294-
npx copilot-api@latest start --claude-code
292+
npx copilot-proxy-api@latest start --claude-code
295293
```
296294

297295
You will be prompted to select a primary model and a "small, fast" model for background tasks. After selecting the models, a command will be copied to your clipboard. This command sets the necessary environment variables for Claude Code to use the proxy.
@@ -341,7 +339,7 @@ model = "gpt-5.2"
341339
model_provider = "copilot-proxy"
342340
343341
[model_providers.copilot-proxy]
344-
name = "GitHub Copilot (via copilot-api)"
342+
name = "GitHub Copilot (via copilot-proxy-api)"
345343
base_url = "http://localhost:4141/v1"
346344
wire_api = "responses"
347345
env_key = "OPENAI_API_KEY"
@@ -361,7 +359,7 @@ Start the proxy server and run Codex:
361359
362360
```sh
363361
# Start the proxy
364-
npx copilot-api@latest start
362+
npx copilot-proxy-api@latest start
365363
366364
# In another terminal, run Codex
367365
codex
@@ -387,6 +385,6 @@ bun run start
387385
388386
- To avoid hitting GitHub Copilot's rate limits, you can use the following flags:
389387
- `--manual`: Enables manual approval for each request, giving you full control over when requests are sent.
390-
- `--rate-limit <seconds>`: Enforces a minimum time interval between requests. For example, `copilot-api start --rate-limit 30` will ensure there's at least a 30-second gap between requests.
388+
- `--rate-limit <seconds>`: Enforces a minimum time interval between requests. For example, `copilot-proxy-api start --rate-limit 30` will ensure there's at least a 30-second gap between requests.
391389
- `--wait`: Use this with `--rate-limit`. It makes the server wait for the cooldown period to end instead of rejecting the request with an error. This is useful for clients that don't automatically retry on rate limit errors.
392390
- If you have a GitHub business or enterprise plan account with Copilot, use the `--account-type` flag (e.g., `--account-type business`). See the [official documentation](https://docs.github.com/en/enterprise-cloud@latest/copilot/managing-copilot/managing-github-copilot-in-your-organization/managing-access-to-github-copilot-in-your-organization/managing-github-copilot-access-to-your-organizations-network#configuring-copilot-subscription-based-network-routing-for-your-enterprise-or-organization) for more details.

0 commit comments

Comments
 (0)