@jeffreycao/copilot-api 2.4.1 → 2.4.2

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 CHANGED
@@ -780,7 +780,7 @@ These endpoints mimic the OpenAI API structure.
780
780
 
781
781
  | Endpoint | Method | Description |
782
782
  | --------------------------- | ------ | ---------------------------------------------------------------- |
783
- | `POST /v1/responses` | `POST` | OpenAI Most advanced interface for generating model responses. Supports `provider/model` aliases for `openai-responses` providers. |
783
+ | `POST /v1/responses` | `POST` | OpenAI Most advanced interface for generating model responses. Supports `Content-Encoding: zstd` request bodies and `provider/model` aliases for `openai-responses` providers. Zstd request decompression is limited to Responses routes, including provider-scoped aliases. |
784
784
  | `POST /v1/chat/completions` | `POST` | Creates a model response for the given chat conversation. Supports `provider/model` aliases for `openai-compatible` providers and can be used without Copilot when the target provider is configured. |
785
785
  | `GET /v1/models` | `GET` | Lists Copilot models plus enabled provider models using `provider/model-id` IDs. Requests from Codex clients (`User-Agent` beginning with `codex`) are forwarded to the Codex Models upstream. |
786
786
  | `POST /v1/embeddings` | `POST` | Creates an embedding vector representing the input text. |
@@ -792,8 +792,8 @@ These endpoints implement Codex backend APIs. Top-level image requests require a
792
792
  | Endpoint | Method | Description |
793
793
  | -------------------------------------------------------------- | ------ | --------------------------------------------------------------- |
794
794
  | `POST /v1/alpha/search` | `POST` | Routes Codex alpha-search requests to the Codex backend, or handles supported commands locally and through Responses web search. |
795
- | `POST /v1/images/generations` | `POST` | Forwards a JSON image generation request to the Codex Images upstream. When the request omits `Content-Type`, the gateway defaults it to `application/json`. |
796
- | `POST /v1/images/edits` | `POST` | Forwards an image edit request to the Codex Images upstream. Send this request as `multipart/form-data` and let the HTTP client generate the `boundary`; the gateway preserves the incoming content type and streams the upload body. |
795
+ | `POST /v1/images/generations` | `POST` | Forwards a JSON image generation request to the Codex Images upstream. When the request omits `Content-Type`, the gateway defaults it to `application/json`. Configured model mappings apply to the request `model`; a mapping that resolves to a `provider/model` alias forwards the request to that provider's images endpoint when the provider is configured. |
796
+ | `POST /v1/images/edits` | `POST` | Forwards an image edit request to the Codex Images upstream. Send this request as `multipart/form-data` and let the HTTP client generate the `boundary`. The gateway streams uploaded files to temporary disk files while receiving them and forwards them from disk, so large uploads are not held in memory. Multipart requests are limited to 128 MiB total, 64 MiB per file, and 16 files; requests over a limit return `413`. Model mappings and `provider/model` alias routing apply to this endpoint as well. |
797
797
 
798
798
  For requests routed to the Codex backend, the gateway replaces client authorization and account headers with the active Codex login and preserves compatible request metadata. Responses-backed alpha search instead follows the selected Copilot or provider route.
799
799
 
package/README.zh-CN.md CHANGED
@@ -828,7 +828,7 @@ curl http://localhost:4141/admin/config/model-mappings \
828
828
 
829
829
  | 端点 | 方法 | 说明 |
830
830
  | --------------------------- | ---- | -------------------------------------------------------------------------------------------------------- |
831
- | `POST /v1/responses` | `POST` | OpenAI 中用于生成模型响应的高级接口。支持 `openai-responses` provider 的 `provider/model` 别名。 |
831
+ | `POST /v1/responses` | `POST` | OpenAI 中用于生成模型响应的高级接口。支持 `Content-Encoding: zstd` 请求体和 `openai-responses` provider 的 `provider/model` 别名。zstd 请求解压仅作用于 Responses 路由,包括 provider-scoped 别名路由。 |
832
832
  | `POST /v1/chat/completions` | `POST` | 为给定聊天对话创建模型响应。支持 `openai-compatible` provider 的 `provider/model` 别名;目标 provider 已配置时可在没有 Copilot 的情况下使用。 |
833
833
  | `GET /v1/models` | `GET` | 列出 Copilot 模型以及已启用 provider 的 `provider/model-id` 模型。来自 Codex 客户端(`User-Agent` 以 `codex` 开头)的请求会转发到 Codex Models 上游。 |
834
834
  | `POST /v1/embeddings` | `POST` | 创建表示输入文本的向量嵌入。 |
@@ -840,8 +840,8 @@ curl http://localhost:4141/admin/config/model-mappings \
840
840
  | 端点 | 方法 | 说明 |
841
841
  | ---------------------------------------------------------- | ---- | ---------------------------------------------------------------------------------------------------- |
842
842
  | `POST /v1/alpha/search` | `POST` | 将 Codex alpha-search 请求路由到 Codex 后端,或在本地及通过 Responses web search 处理支持的命令。 |
843
- | `POST /v1/images/generations` | `POST` | 将 JSON 图片生成请求转发到 Codex Images 上游。请求未携带 `Content-Type` 时,网关默认补充 `application/json`。 |
844
- | `POST /v1/images/edits` | `POST` | 将图片编辑请求转发到 Codex Images 上游。请使用 `multipart/form-data`,并让 HTTP 客户端自动生成 `boundary`;网关会保留传入的 content type,并以流式方式转发上传请求体。 |
843
+ | `POST /v1/images/generations` | `POST` | 将 JSON 图片生成请求转发到 Codex Images 上游。请求未携带 `Content-Type` 时,网关默认补充 `application/json`。请求 `model` 命中已配置的 model mapping 时会被改写;映射结果为已配置 provider 的 `provider/model` 别名时,请求将转发到该 provider 的 images 端点。 |
844
+ | `POST /v1/images/edits` | `POST` | 将图片编辑请求转发到 Codex Images 上游。请使用 `multipart/form-data`,并让 HTTP 客户端自动生成 `boundary`;网关在接收上传时就把文件流式写入临时磁盘文件,转发时从磁盘读取,大文件不会常驻内存。multipart 请求总大小上限为 128 MiB,单文件上限为 64 MiB,最多包含 16 个文件;超过限制时返回 `413`。model mapping 与 `provider/model` 别名路由同样适用于此端点。 |
845
845
 
846
846
  对于路由到 Codex 后端的请求,网关会使用当前 Codex 登录态覆盖客户端的 authorization 和 account header,并保留兼容的请求元数据。基于 Responses 的 alpha-search 则遵循所选 Copilot 或 provider 的路由。
847
847
 
package/dist/main.js CHANGED
@@ -30,7 +30,7 @@ if (isMcpFastPath(process.argv)) {
30
30
  const { auth } = await import("./auth-BCZdnMmK.js");
31
31
  const { debug } = await import("./debug-DwoWAiuC.js");
32
32
  const { mcp } = await import("./mcp-fpSlKZxK.js");
33
- const { start } = await import("./start-Bxq46GxM.js");
33
+ const { start } = await import("./start-BGY-GA8y.js");
34
34
  await runMain(defineCommand({
35
35
  meta: {
36
36
  name: "copilot-api",