diff --git a/docs/src/content/docs/en/configuration/providers.md b/docs/src/content/docs/en/configuration/providers.md index d89f41a4..6231909f 100644 --- a/docs/src/content/docs/en/configuration/providers.md +++ b/docs/src/content/docs/en/configuration/providers.md @@ -127,7 +127,7 @@ The credential pool is an upstream provider key pool. It is separate from the cl | Field | Capability | | --- | --- | | Fetch usage | Enables or disables account usage fetching for this provider. | -| Usage mode | Usage connector mode. `Standard usage endpoint` uses CCR standard account endpoints; `HTTP JSON request` maps a custom JSON endpoint; `Browser JSON request` uses CCR's in-app browser login state for a browser-executed JSON endpoint; `Raw connector JSON` edits the connector array directly. | +| Usage mode | Usage connector mode. `Standard usage endpoint` uses CCR standard account endpoints; `HTTP JSON request` maps a custom JSON endpoint; `Browser request` uses CCR's in-app browser login state to run a browser-side request and map the JSON response; `Raw connector JSON` edits the connector array directly. | | Refresh interval ms | Usage refresh interval in milliseconds. Empty uses the default interval. The minimum effective interval is 30000ms. | ### Standard usage endpoint @@ -157,9 +157,9 @@ Use this mode when the provider has a balance or quota endpoint that returns a c | Test usage request | Requests and parses the usage endpoint before saving. | | Response fields | Lists selectable paths from the response. Buttons such as `Balance rem`, `Balance total`, `Balance used`, `Sub rem`, `Sub limit`, and `Reset` fill the matching field. | -### Browser JSON request +### Browser request -Use this mode when the usage endpoint depends on a website login session, cookies, or localStorage. It is saved as the underlying `webcontent-json` connector and is available only in CCR Desktop. +Use this mode when the usage endpoint depends on a website login session, cookies, or localStorage. It is saved as the underlying `webcontent-json` connector and is available only in CCR Desktop. The endpoint response must still be JSON so the fields below can map it with CCR's lightweight JSONPath syntax. | Field | Capability | | --- | --- | @@ -171,7 +171,7 @@ Use this mode when the usage endpoint depends on a website login session, cookie | Open login browser | Opens CCR's in-app browser so the user can sign in before testing. | | Import from Chrome | Creates a Chrome login-state import job for the login URL, storage origin, and usage request URL domains, then writes cookies/localStorage into CCR's in-app browser partition. | -Browser JSON requests do not send the provider API key. CCR runs `fetch` inside the in-app browser from the browser storage origin, renders dynamic headers there, and applies the selected browser credentials mode. The usage request URL may be on another origin when that API allows the website origin through CORS. +Browser requests do not send the provider API key. CCR runs `fetch` inside the in-app browser from the browser storage origin, renders dynamic headers there, and applies the selected browser credentials mode. The usage request URL may be on another origin when that API allows the website origin through CORS. When `browser.credentials` is omitted, CCR defaults to `omit` if `browser.headerTemplates` is configured, otherwise it keeps the legacy cookie-oriented default `include`. @@ -223,7 +223,7 @@ Field paths use CCR's lightweight JSONPath syntax: | --- | --- | | `standard` | Uses CCR standard account endpoints. | | `http-json` | Requests a JSON endpoint and maps balance, subscription, status, and message fields. | -| `webcontent-json` | Uses CCR Desktop's in-app browser login state for a browser-executed JSON endpoint. The UI exposes this as `Browser JSON request`. | +| `webcontent-json` | Uses CCR Desktop's in-app browser login state to run a browser-side request and map the JSON response. The UI exposes this as `Browser request`. | | `plugin` | Calls an account usage connector registered by an installed plugin. | | `local-estimate` | Shows estimated quota from local time-window config without a remote request. | diff --git a/docs/src/content/docs/zh/configuration/providers.md b/docs/src/content/docs/zh/configuration/providers.md index 133492ad..c9be9fba 100644 --- a/docs/src/content/docs/zh/configuration/providers.md +++ b/docs/src/content/docs/zh/configuration/providers.md @@ -127,7 +127,7 @@ Kimi CLI 导入会读取本机 Kimi 配置(默认 `~/.kimi-code/config.toml` | 字段 | 代表的能力 | | --- | --- | | 获取用量 | 启用或关闭该供应商的账号用量读取。关闭后不请求用量接口。 | -| 用量模式 | 用量读取方式。`标准用量端点` 使用 CCR 标准账号端点;`HTTP JSON 请求` 手动配置一个 JSON 接口;`浏览器 JSON 请求` 使用 CCR 内置浏览器登录态执行浏览器侧 JSON 请求;`原始连接器 JSON` 直接编辑 connector 数组。 | +| 用量模式 | 用量读取方式。`标准用量端点` 使用 CCR 标准账号端点;`HTTP JSON 请求` 手动配置一个 JSON 接口;`浏览器请求` 使用 CCR 内置浏览器登录态执行浏览器侧请求并映射 JSON 响应;`原始连接器 JSON` 直接编辑 connector 数组。 | | 刷新间隔(毫秒) | 用量刷新间隔,单位毫秒。未填写时使用默认刷新间隔,最小有效间隔为 30000ms。 | ### 标准用量端点 @@ -157,9 +157,9 @@ Kimi CLI 导入会读取本机 Kimi 配置(默认 `~/.kimi-code/config.toml` | 测试用量请求 | 立即请求用量接口并解析映射结果,方便在保存前验证字段路径。 | | 响应字段 | 测试后列出响应 JSON 中可选字段。点击 `余额剩余`、`余额总额`、`余额已用`、`订阅剩余`、`订阅上限`、`重置时间` 可以把该路径快速填入对应字段。 | -### 浏览器 JSON 请求 +### 浏览器请求 -该模式适合用量接口依赖网页登录态、Cookie 或 localStorage 的情况。它保存为底层 `webcontent-json` connector,只在 CCR Desktop 可用。 +该模式适合用量接口依赖网页登录态、Cookie 或 localStorage 的情况。它保存为底层 `webcontent-json` connector,只在 CCR Desktop 可用;接口响应仍需是 JSON,后续字段映射继续使用下方的轻量 JSONPath。 | 字段 | 代表的能力 | | --- | --- | @@ -171,7 +171,7 @@ Kimi CLI 导入会读取本机 Kimi 配置(默认 `~/.kimi-code/config.toml` | 打开登录浏览器 | 打开 CCR 内置浏览器,让用户在测试前完成登录。 | | 从 Chrome 导入 | 为登录 URL、存储 Origin 和用量请求 URL 的域名创建 Chrome 登录态导入任务,并把 Cookie/localStorage 写入 CCR 内置浏览器分区。 | -浏览器 JSON 请求不会携带供应商 API Key。请求会从浏览器存储 Origin 在内置浏览器执行 `fetch`,在那里渲染动态请求头,并按所选 Fetch 凭据模式处理 Cookie 等浏览器凭据。用量请求 URL 可以是另一个 origin,前提是目标 API 允许该网站 origin 跨域访问。 +浏览器请求不会携带供应商 API Key。请求会从浏览器存储 Origin 在内置浏览器执行 `fetch`,在那里渲染动态请求头,并按所选 Fetch 凭据模式处理 Cookie 等浏览器凭据。用量请求 URL 可以是另一个 origin,前提是目标 API 允许该网站 origin 跨域访问。 如果 `browser.credentials` 未配置,CCR 在配置了 `browser.headerTemplates` 时默认使用 `omit`,否则保持面向 Cookie 场景的旧默认值 `include`。 @@ -223,7 +223,7 @@ Kimi CLI 导入会读取本机 Kimi 配置(默认 `~/.kimi-code/config.toml` | --- | --- | | `standard` | 使用 CCR 标准账号端点。 | | `http-json` | 请求一个 JSON 接口,并用 mapping 字段映射余额、套餐、状态和消息。 | -| `webcontent-json` | 使用 CCR Desktop 内置浏览器登录态执行浏览器侧 JSON 请求。UI 中对应 `浏览器 JSON 请求`。 | +| `webcontent-json` | 使用 CCR Desktop 内置浏览器登录态执行浏览器侧请求并映射 JSON 响应。UI 中对应 `浏览器请求`。 | | `plugin` | 调用已安装插件注册的账号用量 connector。 | | `local-estimate` | 不请求远程接口,基于本地窗口配置展示估算额度。 | diff --git a/packages/ui/src/pages/home/components/providers.tsx b/packages/ui/src/pages/home/components/providers.tsx index dd789ec1..cef358b0 100644 --- a/packages/ui/src/pages/home/components/providers.tsx +++ b/packages/ui/src/pages/home/components/providers.tsx @@ -3046,7 +3046,7 @@ function ProviderUsageSettings({ {draft.accountMode === "browser" ? ( <>