From 1acbb12c650ae31a7594887ea8e1a6b113522497 Mon Sep 17 00:00:00 2001 From: feeeei Date: Wed, 15 Jul 2026 10:28:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80gork=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=AD=E7=9A=84=E5=90=8D=E7=A7=B0=E9=A3=8E?= =?UTF-8?q?=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 +++++------ frontend/src/components/keys/UseKeyModal.vue | 11 +++++------ .../src/components/keys/__tests__/UseKeyModal.spec.ts | 2 +- frontend/src/i18n/locales/en/dashboard.ts | 4 ++-- frontend/src/i18n/locales/zh/dashboard.ts | 4 ++-- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 00f021ea2c..ada3039897 100644 --- a/README.md +++ b/README.md @@ -734,14 +734,13 @@ For API-key accounts, select **Grok → API Key** in the create-account dialog. ```toml [models] -default = "sub2api-grok" -web_search = "sub2api-grok" +default = "grok" +web_search = "grok" -[model."sub2api-grok"] +[model."grok"] model = "grok-4.5" base_url = "https://your-sub2api.example.com/v1" -name = "Grok 4.5 via Sub2API" -description = "Grok 4.5 through a Sub2API Grok group" +name = "Grok 4.5" api_key = "sk-your-sub2api-key" api_backend = "responses" context_window = 1000000 @@ -752,7 +751,7 @@ Back up an existing `config.toml` before merging the entry. The file contains a ```bash grok inspect -grok -p "Reply with sub2api-ok" -m sub2api-grok +grok -p "Reply with sub2api-ok" -m grok ``` The `base_url` above is the public Sub2API URL ending in `/v1`, not `api.x.ai` or the internal xAI OAuth proxy URL. diff --git a/frontend/src/components/keys/UseKeyModal.vue b/frontend/src/components/keys/UseKeyModal.vue index 53ca732ebc..1dda0c51eb 100644 --- a/frontend/src/components/keys/UseKeyModal.vue +++ b/frontend/src/components/keys/UseKeyModal.vue @@ -663,14 +663,13 @@ function generateGrokFiles(baseUrl: string, apiKey: string): FileConfig[] { const isWindows = activeTab.value === 'windows' const configDir = isWindows ? '%userprofile%\\.grok' : '~/.grok' const configContent = `[models] -default = "sub2api-grok" -web_search = "sub2api-grok" +default = "grok" +web_search = "grok" -[model."sub2api-grok"] +[model."grok"] model = "grok-4.5" base_url = "${baseUrl}" -name = "Grok 4.5 via Sub2API" -description = "Grok 4.5 through a Sub2API Grok group" +name = "Grok 4.5" api_key = "${apiKey}" api_backend = "responses" context_window = 1000000 @@ -1223,7 +1222,7 @@ function generateOpenCodeConfig(platform: string, baseUrl: string, apiKey: strin provider[platform].models = openaiModels } else if (platform === 'grok') { provider[platform].npm = '@ai-sdk/openai' - provider[platform].name = 'Grok via Sub2API' + provider[platform].name = 'Grok' provider[platform].models = grokModels } diff --git a/frontend/src/components/keys/__tests__/UseKeyModal.spec.ts b/frontend/src/components/keys/__tests__/UseKeyModal.spec.ts index 134f09f6d0..e96939cb39 100644 --- a/frontend/src/components/keys/__tests__/UseKeyModal.spec.ts +++ b/frontend/src/components/keys/__tests__/UseKeyModal.spec.ts @@ -44,7 +44,7 @@ describe('UseKeyModal', () => { const grokConfig = wrapper.findAll('pre code') .map((code) => code.text()) - .find((content) => content.includes('[model."sub2api-grok"]')) + .find((content) => content.includes('[model."grok"]')) expect(grokConfig).toBeDefined() expect(grokConfig).toContain('model = "grok-4.5"') expect(grokConfig).toContain('base_url = "https://example.com/v1"') diff --git a/frontend/src/i18n/locales/en/dashboard.ts b/frontend/src/i18n/locales/en/dashboard.ts index 37b8f2a210..5a9d177f14 100644 --- a/frontend/src/i18n/locales/en/dashboard.ts +++ b/frontend/src/i18n/locales/en/dashboard.ts @@ -168,8 +168,8 @@ export default { grok: { description: 'Configure Grok Build or OpenCode to send Responses API traffic through your Sub2API Grok group.', configTomlHint: 'Back up an existing config.toml before merging this model entry. Run grok inspect after saving to verify the effective configuration.', - note: 'Save the file as ~/.grok/config.toml, then run grok inspect and select sub2api-grok from /model.', - noteWindows: 'Save the file as %USERPROFILE%\\.grok\\config.toml, then run grok inspect and select sub2api-grok from /model.', + note: 'Save the file as ~/.grok/config.toml, then run grok inspect and select grok from /model.', + noteWindows: 'Save the file as %USERPROFILE%\\.grok\\config.toml, then run grok inspect and select grok from /model.', }, opencode: { title: 'OpenCode Example', diff --git a/frontend/src/i18n/locales/zh/dashboard.ts b/frontend/src/i18n/locales/zh/dashboard.ts index c125e2eae8..e50fc6b487 100644 --- a/frontend/src/i18n/locales/zh/dashboard.ts +++ b/frontend/src/i18n/locales/zh/dashboard.ts @@ -172,8 +172,8 @@ export default { grok: { description: '配置 Grok Build 或 OpenCode,让 Responses API 请求通过当前 Sub2API Grok 分组发送。', configTomlHint: '如已有 config.toml,请先备份再合并此模型配置。保存后运行 grok inspect 验证生效配置。', - note: '保存为 ~/.grok/config.toml,然后运行 grok inspect,并在 /model 中选择 sub2api-grok。', - noteWindows: '保存为 %USERPROFILE%\\.grok\\config.toml,然后运行 grok inspect,并在 /model 中选择 sub2api-grok。' + note: '保存为 ~/.grok/config.toml,然后运行 grok inspect,并在 /model 中选择 grok。', + noteWindows: '保存为 %USERPROFILE%\\.grok\\config.toml,然后运行 grok inspect,并在 /model 中选择 grok。' }, opencode: { title: 'OpenCode 配置示例',