@jeffreycao/copilot-api 1.14.8 → 1.14.9
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 +6 -6
- package/README.zh-CN.md +6 -6
- package/dist/main.js +1 -1
- package/dist/{server-BayMzJcy.js → server-BgkyqOM7.js} +5 -1
- package/dist/{server-BayMzJcy.js.map → server-BgkyqOM7.js.map} +1 -1
- package/dist/{start-C-ugrdZG.js → start-B0sr92AZ.js} +2 -2
- package/dist/{start-C-ugrdZG.js.map → start-B0sr92AZ.js.map} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -680,19 +680,19 @@ For every endpoint above, the gateway replaces client authorization and account
|
|
|
680
680
|
|
|
681
681
|
### Anthropic Compatible Endpoints
|
|
682
682
|
|
|
683
|
-
These endpoints are designed to be compatible with the Anthropic Messages API.
|
|
683
|
+
These endpoints are designed to be compatible with the Anthropic Messages API. Provider-scoped models, Responses, alpha-search, and images routes accept both unversioned and `/v1` paths; Messages routes remain under `/v1`.
|
|
684
684
|
|
|
685
685
|
| Endpoint | Method | Description |
|
|
686
686
|
| -------------------------------- | ------ | ------------------------------------------------------------ |
|
|
687
687
|
| `POST /v1/messages` | `POST` | Creates a model response for a given conversation. Supports `provider/model` aliases for configured providers, including translation through `openai-compatible` providers. |
|
|
688
688
|
| `POST /v1/messages/count_tokens` | `POST` | Calculates the number of tokens for a given set of messages. Supports `provider/model` aliases for configured providers. |
|
|
689
689
|
| `POST /:provider/v1/messages` | `POST` | Proxies Anthropic Messages requests to the configured Anthropic provider, translates them through an OpenAI-compatible provider, or translates them through an OpenAI Responses provider. |
|
|
690
|
-
| `GET /:provider/v1/models`
|
|
690
|
+
| `GET /:provider/models`<br>`GET /:provider/v1/models` | `GET` | Proxies model listing requests to the configured provider. For `codex`, returns the built-in catalog by default; Codex clients (`User-Agent` starting with `codex`) are forwarded to the Codex Models upstream. |
|
|
691
691
|
| `POST /:provider/v1/messages/count_tokens` | `POST` | Calculates tokens locally for provider route requests. |
|
|
692
|
-
| `POST /:provider/v1/responses`
|
|
693
|
-
| `POST /:provider/v1/alpha/search`
|
|
694
|
-
| `POST /:provider/v1/images/generations` | `POST` | Proxies image generation. For `codex`, uses the Codex Images upstream; for other providers, forwards to `{baseUrl}/v1/images/generations` (15-minute timeout). |
|
|
695
|
-
| `POST /:provider/v1/images/edits`
|
|
692
|
+
| `POST /:provider/responses`<br>`POST /:provider/v1/responses` | `POST` | Proxies OpenAI Responses requests to a configured `openai-responses` provider (including `codex`). |
|
|
693
|
+
| `POST /:provider/alpha/search`<br>`POST /:provider/v1/alpha/search` | `POST` | Proxies alpha-search requests. For `codex`, forwards to the Codex Alpha Search upstream; for other providers, forwards to `{baseUrl}/v1/alpha/search`. |
|
|
694
|
+
| `POST /:provider/images/generations`<br>`POST /:provider/v1/images/generations` | `POST` | Proxies image generation. For `codex`, uses the Codex Images upstream; for other providers, forwards to `{baseUrl}/v1/images/generations` (15-minute timeout). |
|
|
695
|
+
| `POST /:provider/images/edits`<br>`POST /:provider/v1/images/edits` | `POST` | Proxies image edits. For `codex`, uses the Codex Images upstream; for other providers, forwards multipart/streamed bodies to `{baseUrl}/v1/images/edits` (15-minute timeout). |
|
|
696
696
|
|
|
697
697
|
### Usage Monitoring Endpoints
|
|
698
698
|
|
package/README.zh-CN.md
CHANGED
|
@@ -686,19 +686,19 @@ curl http://localhost:4141/admin/config/model-mappings \
|
|
|
686
686
|
|
|
687
687
|
### Anthropic 兼容端点
|
|
688
688
|
|
|
689
|
-
这些端点设计为兼容 Anthropic Messages API。
|
|
689
|
+
这些端点设计为兼容 Anthropic Messages API。provider 级的 models、Responses、alpha-search 和 images 路由同时支持无版本前缀与 `/v1` 两种路径;Messages 路由仍使用 `/v1`。
|
|
690
690
|
|
|
691
691
|
| 端点 | 方法 | 说明 |
|
|
692
692
|
| --- | --- | --- |
|
|
693
693
|
| `POST /v1/messages` | `POST` | 为给定对话创建模型响应。支持已配置 provider 的 `provider/model` 别名,包括通过 `openai-compatible` provider 做翻译。 |
|
|
694
694
|
| `POST /v1/messages/count_tokens` | `POST` | 计算一组消息的 token 数。支持已配置 provider 的 `provider/model` 别名。 |
|
|
695
695
|
| `POST /:provider/v1/messages` | `POST` | 将 Anthropic Messages 请求代理到已配置的 Anthropic provider,或翻译到 OpenAI 兼容 / OpenAI Responses provider。 |
|
|
696
|
-
| `GET /:provider/v1/models` | `GET` | 将模型列表请求代理到已配置的 provider。对 `codex` 默认返回内置模型目录;Codex 客户端(`User-Agent` 以 `codex` 开头)会转发到 Codex Models 上游。 |
|
|
696
|
+
| `GET /:provider/models`<br>`GET /:provider/v1/models` | `GET` | 将模型列表请求代理到已配置的 provider。对 `codex` 默认返回内置模型目录;Codex 客户端(`User-Agent` 以 `codex` 开头)会转发到 Codex Models 上游。 |
|
|
697
697
|
| `POST /:provider/v1/messages/count_tokens` | `POST` | 为 provider 路由请求在本地计算 token 数。 |
|
|
698
|
-
| `POST /:provider/v1/responses` | `POST` | 将 OpenAI Responses 请求代理到已配置的 `openai-responses` provider(含 `codex`)。 |
|
|
699
|
-
| `POST /:provider/v1/alpha/search` | `POST` | 代理 alpha-search 请求。对 `codex` 转发到 Codex Alpha Search 上游;其他 provider 转发到 `{baseUrl}/v1/alpha/search`。 |
|
|
700
|
-
| `POST /:provider/v1/images/generations` | `POST` | 代理图片生成。对 `codex` 使用 Codex Images 上游;其他 provider 转发到 `{baseUrl}/v1/images/generations`(15 分钟超时)。 |
|
|
701
|
-
| `POST /:provider/v1/images/edits` | `POST` | 代理图片编辑。对 `codex` 使用 Codex Images 上游;其他 provider 以 multipart/流式方式转发到 `{baseUrl}/v1/images/edits`(15 分钟超时)。 |
|
|
698
|
+
| `POST /:provider/responses`<br>`POST /:provider/v1/responses` | `POST` | 将 OpenAI Responses 请求代理到已配置的 `openai-responses` provider(含 `codex`)。 |
|
|
699
|
+
| `POST /:provider/alpha/search`<br>`POST /:provider/v1/alpha/search` | `POST` | 代理 alpha-search 请求。对 `codex` 转发到 Codex Alpha Search 上游;其他 provider 转发到 `{baseUrl}/v1/alpha/search`。 |
|
|
700
|
+
| `POST /:provider/images/generations`<br>`POST /:provider/v1/images/generations` | `POST` | 代理图片生成。对 `codex` 使用 Codex Images 上游;其他 provider 转发到 `{baseUrl}/v1/images/generations`(15 分钟超时)。 |
|
|
701
|
+
| `POST /:provider/images/edits`<br>`POST /:provider/v1/images/edits` | `POST` | 代理图片编辑。对 `codex` 使用 Codex Images 上游;其他 provider 以 multipart/流式方式转发到 `{baseUrl}/v1/images/edits`(15 分钟超时)。 |
|
|
702
702
|
|
|
703
703
|
### 使用量监控端点
|
|
704
704
|
|
package/dist/main.js
CHANGED
|
@@ -25,7 +25,7 @@ bindElectronFetch();
|
|
|
25
25
|
const { auth } = await import("./auth-DvJ8r_tN.js");
|
|
26
26
|
const { debug } = await import("./debug-Bb5hamXX.js");
|
|
27
27
|
const { mcp } = await import("./mcp-BseuqgHR.js");
|
|
28
|
-
const { start } = await import("./start-
|
|
28
|
+
const { start } = await import("./start-B0sr92AZ.js");
|
|
29
29
|
await runMain(defineCommand({
|
|
30
30
|
meta: {
|
|
31
31
|
name: "copilot-api",
|
|
@@ -7147,7 +7147,11 @@ server.route("/:provider/v1/models", providerModelRoutes);
|
|
|
7147
7147
|
server.route("/:provider/v1/responses", providerResponsesRoutes);
|
|
7148
7148
|
server.route("/:provider/v1/alpha/search", providerAlphaSearchRoutes);
|
|
7149
7149
|
server.route("/:provider/v1/images", providerImageRoutes);
|
|
7150
|
+
server.route("/:provider/models", providerModelRoutes);
|
|
7151
|
+
server.route("/:provider/responses", providerResponsesRoutes);
|
|
7152
|
+
server.route("/:provider/alpha/search", providerAlphaSearchRoutes);
|
|
7153
|
+
server.route("/:provider/images", providerImageRoutes);
|
|
7150
7154
|
//#endregion
|
|
7151
7155
|
export { server };
|
|
7152
7156
|
|
|
7153
|
-
//# sourceMappingURL=server-
|
|
7157
|
+
//# sourceMappingURL=server-BgkyqOM7.js.map
|