@nick3/copilot-api 1.5.9 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -30
- package/README.zh-CN.md +953 -0
- package/dist/{account-CbYMFuS4.js → account-B2tSWtVS.js} +2 -2
- package/dist/{account-CbYMFuS4.js.map → account-B2tSWtVS.js.map} +1 -1
- package/dist/{accounts-manager-BKG9aZEL.js → accounts-manager-CAyZJSn8.js} +144 -111
- package/dist/accounts-manager-CAyZJSn8.js.map +1 -0
- package/dist/admin/assets/index-BESw8Vvd.css +1 -0
- package/dist/admin/assets/index-Ddo9RHg-.js +101 -0
- package/dist/admin/index.html +2 -2
- package/dist/{auth-Ckj1wD43.js → auth-BXCeDjRG.js} +3 -3
- package/dist/{auth-Ckj1wD43.js.map → auth-BXCeDjRG.js.map} +1 -1
- package/dist/{check-usage-bIbj_1Q_.js → check-usage-CQxXYfUx.js} +3 -3
- package/dist/{check-usage-bIbj_1Q_.js.map → check-usage-CQxXYfUx.js.map} +1 -1
- package/dist/{get-copilot-token-MAZsr5Vu.js → get-copilot-token-p17sJyPU.js} +2 -2
- package/dist/{get-copilot-token-MAZsr5Vu.js.map → get-copilot-token-p17sJyPU.js.map} +1 -1
- package/dist/main.js +3 -3
- package/dist/{poll-access-token-DiwBJNtK.js → poll-access-token-Bc6VwWab.js} +49 -9
- package/dist/poll-access-token-Bc6VwWab.js.map +1 -0
- package/dist/{server-DAxpfPde.js → server-CFijvv3C.js} +106 -54
- package/dist/server-CFijvv3C.js.map +1 -0
- package/dist/{start-8dkfsQqd.js → start-DQlnH71A.js} +6 -6
- package/dist/{start-8dkfsQqd.js.map → start-DQlnH71A.js.map} +1 -1
- package/package.json +1 -1
- package/dist/accounts-manager-BKG9aZEL.js.map +0 -1
- package/dist/admin/assets/index-BFN8rXmt.css +0 -1
- package/dist/admin/assets/index-HnEqzcKv.js +0 -101
- package/dist/poll-access-token-DiwBJNtK.js.map +0 -1
- package/dist/server-DAxpfPde.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Copilot API Proxy
|
|
2
2
|
|
|
3
|
-
English | [
|
|
3
|
+
English | [简体中文](./README.zh-CN.md)
|
|
4
4
|
|
|
5
5
|
> [!WARNING]
|
|
6
|
-
> This is a reverse-engineered proxy of GitHub Copilot API. It is not supported by GitHub, and may break unexpectedly. Use at your own risk. In the current version, if not using opencode OAuth, the device ID and machine ID will be sent to GitHub Copilot.
|
|
6
|
+
> This is a reverse-engineered proxy of GitHub Copilot API. It is not supported by GitHub, and may break unexpectedly. Use at your own risk. In the current version, if not using opencode OAuth, the device ID and machine ID will be sent to GitHub Copilot.
|
|
7
7
|
|
|
8
8
|
> [!WARNING]
|
|
9
9
|
> **GitHub Security Notice:**
|
|
@@ -44,7 +44,7 @@ English | [中文](./README_CN.md)
|
|
|
44
44
|
|
|
45
45
|
## Project Overview
|
|
46
46
|
|
|
47
|
-
A reverse-engineered proxy for the GitHub Copilot API that exposes it as an OpenAI and Anthropic compatible service. This allows you to use GitHub Copilot with any tool that supports the OpenAI Chat Completions API or the Anthropic Messages API, including to power [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview).
|
|
47
|
+
A reverse-engineered proxy for the GitHub Copilot API that exposes it as an OpenAI and Anthropic compatible service. This allows you to use GitHub Copilot with any tool that supports the OpenAI Chat Completions / Responses API or the Anthropic Messages API, including to power [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview).
|
|
48
48
|
|
|
49
49
|
Compared with routing everything through plain Chat Completions compatibility, this proxy can prefer Copilot's native Anthropic-style Messages API for Claude-family models, preserve more native thinking/tool semantics, reduce unnecessary Premium request consumption on warmup or resumed tool turns, and expose phase-aware `gpt-5.4` / `gpt-5.3-codex` responses that are easier for users to follow.
|
|
50
50
|
|
|
@@ -128,10 +128,6 @@ When an Anthropic API key is configured, the proxy forwards Claude model token c
|
|
|
128
128
|
> [!NOTE]
|
|
129
129
|
> Anthropic's `/v1/messages/count_tokens` endpoint is **free** (no per-token cost). It is rate-limited to 100 RPM at Tier 1. The $5 credit purchase is only needed to activate API access — the token counting calls themselves cost nothing.
|
|
130
130
|
|
|
131
|
-
## Demo
|
|
132
|
-
|
|
133
|
-
https://github.com/user-attachments/assets/7654b383-669d-4eb9-b23c-06d7aefee8c5
|
|
134
|
-
|
|
135
131
|
## Prerequisites
|
|
136
132
|
|
|
137
133
|
- Bun (>= 1.2.x)
|
|
@@ -145,6 +141,32 @@ To install dependencies, run:
|
|
|
145
141
|
bun install
|
|
146
142
|
```
|
|
147
143
|
|
|
144
|
+
To start the server directly from source:
|
|
145
|
+
|
|
146
|
+
```sh
|
|
147
|
+
bun run start start
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Using with npx
|
|
151
|
+
|
|
152
|
+
You can run the project directly using npx:
|
|
153
|
+
|
|
154
|
+
```sh
|
|
155
|
+
npx @nick3/copilot-api@latest start
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
With options:
|
|
159
|
+
|
|
160
|
+
```sh
|
|
161
|
+
npx @nick3/copilot-api@latest start --port 8080
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
For authentication only:
|
|
165
|
+
|
|
166
|
+
```sh
|
|
167
|
+
npx @nick3/copilot-api@latest auth
|
|
168
|
+
```
|
|
169
|
+
|
|
148
170
|
## Using with Docker
|
|
149
171
|
|
|
150
172
|
Build image
|
|
@@ -233,26 +255,6 @@ The Docker image includes:
|
|
|
233
255
|
- Health check for container monitoring
|
|
234
256
|
- Pinned base image version for reproducible builds
|
|
235
257
|
|
|
236
|
-
## Using with npx
|
|
237
|
-
|
|
238
|
-
You can run the project directly using npx:
|
|
239
|
-
|
|
240
|
-
```sh
|
|
241
|
-
npx @nick3/copilot-api@latest start
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
With options:
|
|
245
|
-
|
|
246
|
-
```sh
|
|
247
|
-
npx @nick3/copilot-api@latest start --port 8080
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
For authentication only:
|
|
251
|
-
|
|
252
|
-
```sh
|
|
253
|
-
npx @nick3/copilot-api@latest auth
|
|
254
|
-
```
|
|
255
|
-
|
|
256
258
|
## Command Structure
|
|
257
259
|
|
|
258
260
|
Copilot API now uses a subcommand structure with these main commands:
|
|
@@ -831,7 +833,8 @@ Here is an example `.claude/settings.json` file:
|
|
|
831
833
|
},
|
|
832
834
|
"permissions": {
|
|
833
835
|
"deny": [
|
|
834
|
-
"WebSearch"
|
|
836
|
+
"WebSearch",
|
|
837
|
+
"mcp__ide__executeCode"
|
|
835
838
|
]
|
|
836
839
|
}
|
|
837
840
|
}
|
|
@@ -917,13 +920,13 @@ The project can be run from source in several ways:
|
|
|
917
920
|
### Development Mode
|
|
918
921
|
|
|
919
922
|
```sh
|
|
920
|
-
bun run dev
|
|
923
|
+
bun run dev start
|
|
921
924
|
```
|
|
922
925
|
|
|
923
926
|
### Production Mode
|
|
924
927
|
|
|
925
928
|
```sh
|
|
926
|
-
bun run start
|
|
929
|
+
bun run start start
|
|
927
930
|
```
|
|
928
931
|
|
|
929
932
|
## Usage Tips
|