Skip to content

Commit 6d9333d

Browse files
v2.6.0: API spec updates, free/open-source branding, dependency upgrades
- Add max_completion_tokens normalization (GPT-5.x compat) - Add developer role → system mapping (OpenAI 2025+ spec) - Add stream_options.include_usage for streaming responses - Responses API: text.format and truncation pass-through - Expand Anthropic interface (thinking, metadata, tool_use) - Expand Google interface (frequencyPenalty, presencePenalty, safetySettings) - Update branding to emphasize free, open-source, trustworthy - Upgrade typescript 5.9.3, typescript-eslint 8.55.0, @types/node 25.2.3
1 parent 6973955 commit 6d9333d

7 files changed

Lines changed: 325 additions & 255 deletions

File tree

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ All notable changes to the "github-copilot-api-vscode" extension will be documen
44

55
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
66

7+
## [2.6.0] - 2026-02-13
8+
9+
### Added
10+
- **OpenAI Chat Completions:** `max_completion_tokens` parameter support (auto-normalized to `max_tokens` for GPT-5.x compatibility)
11+
- **OpenAI Chat Completions:** `developer` role support (auto-mapped to `system` for 2025+ spec)
12+
- **OpenAI Chat Completions:** `stream_options.include_usage` — emit usage chunk in streaming responses
13+
- **OpenAI Responses API:** `text.format` structured output pass-through (was hardcoded to `text`)
14+
- **OpenAI Responses API:** `truncation` parameter pass-through
15+
- **Anthropic Messages API:** `thinking`, `metadata` interface fields; `tool_use` stop reason; cache token usage
16+
- **Google Generative AI:** `frequencyPenalty`, `presencePenalty`, `responseMimeType`, `responseSchema`, `safetySettings` interface
17+
18+
### Changed
19+
- Updated branding to emphasize free, open-source, and trustworthy nature
20+
- Upgraded TypeScript to 5.9.3, typescript-eslint to 8.55.0, @types/node to 25.2.3
21+
722
## [2.5.1] - 2026-02-07
823

924
### Fixed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<h1 align="center">GitHub Copilot API Gateway</h1>
66

77
<p align="center">
8-
<strong>Use GitHub Copilot like any other AI API.</strong><br>
9-
One VS Code extension. Zero API keys. Works with LangChain, Cursor, Aider, and 50+ tools.
8+
<strong>Use GitHub Copilot like any other AI API — completely free & open-source.</strong><br>
9+
One VS Code extension. Zero API keys. 100% transparent. Works with LangChain, Cursor, Aider, and 50+ tools.
1010
</p>
1111

1212
<p align="center">
@@ -67,6 +67,8 @@ response = client.chat.completions.create(
6767
)
6868
```
6969

70+
> 🔒 **Your data stays local.** This extension runs entirely on your machine — no third-party servers, no telemetry, no data collection. The full source code is available on [GitHub](https://github.com/suhaibbinyounis/github-copilot-api-vscode) for you to audit.
71+
7072
---
7173

7274
## ✅ What You Can Do
@@ -174,11 +176,17 @@ For advanced options (TLS, IP allowlisting, audit logging), see [CONTRIBUTING.md
174176

175177
---
176178

177-
## 📝 License
179+
## 🛡️ Trust & Transparency
180+
181+
This project is **100% free and open-source** under the [MIT License](LICENSE).
178182

179-
**MIT License** — See [LICENSE](LICENSE) for details.
183+
- 🔍 **Full source code** available on [GitHub](https://github.com/suhaibbinyounis/github-copilot-api-vscode)
184+
- 🚫 **No telemetry** — zero data collection, no analytics, no tracking
185+
- 🔒 **Runs locally** — your prompts and API keys never leave your machine
186+
- ✅ **Community-driven** — contributions welcome via [CONTRIBUTING.md](CONTRIBUTING.md)
187+
- 🛡️ **Security** — report vulnerabilities via [SECURITY.md](SECURITY.md)
180188

181-
> **Disclaimer:** This extension is an independent project and is not affiliated with GitHub, Microsoft, or OpenAI. It leverages your existing GitHub Copilot subscription. Use responsibly.
189+
> **Disclaimer:** This extension is an independent, community-built project and is not affiliated with GitHub, Microsoft, or OpenAI. It leverages your existing GitHub Copilot subscription. Use responsibly.
182190

183191
<p align="center">
184192
<strong>Built with ❤️ by <a href="https://suhaibbinyounis.com">Suhaib Bin Younis</a></strong>

dist/extension.js

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52632,6 +52632,16 @@ var CopilotApiGateway = class {
5263252632
}
5263352633
if (req.method === "POST" && url2.pathname === "/v1/chat/completions") {
5263452634
const body = await this.readJsonBody(req);
52635+
if (body?.max_completion_tokens && !body?.max_tokens) {
52636+
body.max_tokens = body.max_completion_tokens;
52637+
}
52638+
if (body?.messages && Array.isArray(body.messages)) {
52639+
for (const msg of body.messages) {
52640+
if (msg.role === "developer") {
52641+
msg.role = "system";
52642+
}
52643+
}
52644+
}
5263552645
if (body?.stream === true) {
5263652646
await this.processStreamingChatCompletion(body, req, res, requestId, requestStart);
5263752647
} else {
@@ -52787,6 +52797,13 @@ var CopilotApiGateway = class {
5278752797
if (body?.max_completion_tokens && !body?.max_tokens) {
5278852798
body.max_tokens = body.max_completion_tokens;
5278952799
}
52800+
if (body?.messages && Array.isArray(body.messages)) {
52801+
for (const msg of body.messages) {
52802+
if (msg.role === "developer") {
52803+
msg.role = "system";
52804+
}
52805+
}
52806+
}
5279052807
if (body?.stream === true) {
5279152808
await this.processStreamingChatCompletion(body, req, res, requestId, requestStart);
5279252809
} else {
@@ -53242,6 +53259,33 @@ data: ${JSON.stringify({ type: "error", error: { type: apiError.code || "api_err
5324253259
res.write(`data: ${JSON.stringify(finalChunk)}
5324353260

5324453261
`);
53262+
if (payload?.stream_options?.include_usage) {
53263+
let tokensIn2 = 0;
53264+
let tokensOut2 = 0;
53265+
try {
53266+
const inputString = lmMessages.map((m) => {
53267+
return typeof m.content === "string" ? m.content : JSON.stringify(m.content);
53268+
}).join("\n");
53269+
tokensIn2 = await lmModel.countTokens(inputString, new vscode4.CancellationTokenSource().token);
53270+
tokensOut2 = await lmModel.countTokens(totalContent, new vscode4.CancellationTokenSource().token);
53271+
} catch (_) {
53272+
}
53273+
const usageChunk = {
53274+
id: requestId,
53275+
object: "chat.completion.chunk",
53276+
created,
53277+
model,
53278+
choices: [],
53279+
usage: {
53280+
prompt_tokens: tokensIn2,
53281+
completion_tokens: tokensOut2,
53282+
total_tokens: tokensIn2 + tokensOut2
53283+
}
53284+
};
53285+
res.write(`data: ${JSON.stringify(usageChunk)}
53286+
53287+
`);
53288+
}
5324553289
res.write("data: [DONE]\n\n");
5324653290
res.end();
5324753291
let tokensIn = 0;
@@ -53400,14 +53444,14 @@ data: ${JSON.stringify({ type: "error", error: { type: apiError.code || "api_err
5340053444
store: payload.store ?? true,
5340153445
temperature: payload.temperature ?? 1,
5340253446
text: {
53403-
format: {
53447+
format: payload.text?.format ?? {
5340453448
type: "text"
5340553449
}
5340653450
},
5340753451
tool_choice: payload.tool_choice ?? "auto",
5340853452
tools: payload.tools ?? [],
5340953453
top_p: payload.top_p ?? 1,
53410-
truncation: "disabled",
53454+
truncation: payload.truncation ?? "disabled",
5341153455
usage: {
5341253456
input_tokens: inputTokens,
5341353457
input_tokens_details: {

dist/extension.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)