Merge pull request #3310 from heathermhuang/codex/grok-subscription-support

feat: add grok subscription support
This commit is contained in:
Wesley Liddick
2026-06-26 15:41:52 +08:00
committed by GitHub
109 changed files with 5594 additions and 224 deletions
+44
View File
@@ -2219,6 +2219,7 @@ export default {
openai: 'OpenAI',
gemini: 'Gemini',
antigravity: 'Antigravity',
grok: 'Grok',
},
deleteConfirm:
"Are you sure you want to delete '{name}'? All associated API keys will no longer belong to any group.",
@@ -3135,6 +3136,7 @@ export default {
googleOauth: 'Google OAuth',
codeAssist: 'Code Assist',
antigravityOauth: 'Antigravity OAuth',
grokOauth: 'Grok OAuth',
antigravityApikey: 'Connect via Base URL + API Key',
upstream: 'Upstream',
upstreamDesc: 'Connect via Base URL + API Key'
@@ -3493,6 +3495,10 @@ export default {
testModeCompact: 'Compact probe',
modelRestrictionDisabledByPassthrough: 'Automatic passthrough is enabled: model whitelist/mapping will not take effect.',
},
grok: {
baseUrlHint: 'Grok OAuth accounts forward to the official xAI API base URL.',
apiKeyHint: 'Grok subscription support uses OAuth refresh tokens; API keys are out of scope for this account type.'
},
anthropic: {
apiKeyPassthrough: 'Auto passthrough (auth only)',
apiKeyPassthroughDesc:
@@ -3831,6 +3837,31 @@ export default {
pleaseEnterRefreshToken: 'Please enter Refresh Token',
pleaseEnterSessionToken: 'Please enter Session Token'
},
grok: {
title: 'Grok Account Authorization',
followSteps: 'Follow these steps to authorize your xAI/Grok account:',
step1GenerateUrl: 'Generate the xAI authorization URL',
generateAuthUrl: 'Generate Auth URL',
step2OpenUrl: 'Open the URL in your browser and complete authorization',
openUrlDesc: 'Open the authorization URL in a new tab, sign in to xAI, and authorize API access.',
importantNotice: 'When the browser reaches the local callback URL, copy the full URL or the code query parameter back here.',
step3EnterCode: 'Enter Authorization URL or Code',
authCodeDesc: 'After authorization, paste the callback URL, query string, or authorization code:',
authCode: 'Authorization URL or Code',
authCodePlaceholder: 'Paste the full callback URL, ?code=... query string, or code value',
authCodeHint: 'Full callback URLs, query strings, and bare codes are accepted.',
refreshTokenAuth: 'Manual RT Input',
refreshTokenDesc: 'Enter existing xAI refresh token(s). Supports batch input, one per line.',
refreshTokenPlaceholder: 'Paste your xAI refresh token...\nSupports multiple, one per line',
validating: 'Validating...',
validateAndCreate: 'Validate & Create Account',
pleaseEnterRefreshToken: 'Please enter Refresh Token',
failedToGenerateUrl: 'Failed to generate Grok auth URL',
missingExchangeParams: 'Missing authorization code, state, or OAuth session',
failedToExchangeCode: 'Failed to exchange Grok authorization code',
failedToValidateRT: 'Failed to validate Grok refresh token',
oauthOnlyHint: 'Initial Grok support is OAuth subscription-backed Responses API text and reasoning traffic only.'
},
// Gemini specific
gemini: {
title: 'Gemini Account Authorization',
@@ -4052,6 +4083,7 @@ export default {
openaiAccount: 'OpenAI Account',
geminiAccount: 'Gemini Account',
antigravityAccount: 'Antigravity Account',
grokAccount: 'Grok Account',
inputMethod: 'Input Method',
reAuthorizedSuccess: 'Account re-authorized successfully',
// Test Modal
@@ -4126,6 +4158,18 @@ export default {
gemini3Flash: 'G3F',
gemini3Image: 'G31FI',
claude: 'Claude',
grokRequests: 'Req',
grokTokens: 'Tok',
grokUnknown: 'Grok quota is unknown until the first upstream response includes xAI rate-limit headers.',
grokRetryAfter: 'Retry after {time}',
grokProbe: 'Probe',
grokProbeTooltip: 'Send a minimal xAI Responses probe and read quota headers',
grokResetUnsupported: 'Reset unsupported',
grokResetUnsupportedTooltip: 'xAI does not expose reset credits for Grok OAuth accounts',
grokNoHeaders: 'No quota headers observed',
grokLastStatus: 'Status {status}',
grokLastProbe: 'Probe {time}',
grokLastHeadersSeen: 'Headers {time}',
passiveSampled: 'Passive',
activeQuery: 'Query'
},
+44
View File
@@ -3315,6 +3315,7 @@ export default {
anthropic: 'Anthropic',
gemini: 'Gemini',
antigravity: 'Antigravity',
grok: 'Grok',
},
types: {
oauth: 'OAuth',
@@ -3323,6 +3324,7 @@ export default {
googleOauth: 'Google OAuth',
codeAssist: 'Code Assist',
antigravityOauth: 'Antigravity OAuth',
grokOauth: 'Grok OAuth',
antigravityApikey: '通过 Base URL + API Key 连接',
upstream: '对接上游',
upstreamDesc: '通过 Base URL + API Key 连接上游',
@@ -3406,6 +3408,18 @@ export default {
gemini3Flash: 'G3F',
gemini3Image: 'G31FI',
claude: 'Claude',
grokRequests: '请求',
grokTokens: 'Token',
grokUnknown: 'Grok 配额需等待首次上游响应返回 xAI rate-limit 头后显示。',
grokRetryAfter: '{time} 后重试',
grokProbe: '探测',
grokProbeTooltip: '发送最小 xAI Responses 探测请求并读取配额响应头',
grokResetUnsupported: '不支持重置',
grokResetUnsupportedTooltip: 'xAI 未向 Grok OAuth 账号开放重置额度接口',
grokNoHeaders: '未观察到配额响应头',
grokLastStatus: '状态 {status}',
grokLastProbe: '探测 {time}',
grokLastHeadersSeen: '响应头 {time}',
passiveSampled: '被动采样',
activeQuery: '查询'
},
@@ -3649,6 +3663,10 @@ export default {
testModeCompact: 'Compact 探测',
modelRestrictionDisabledByPassthrough: '已开启自动透传:模型白名单/映射不会生效。',
},
grok: {
baseUrlHint: 'Grok OAuth 账号会转发到官方 xAI API Base URL。',
apiKeyHint: 'Grok 订阅支持使用 OAuth refresh token;API Key 账号不在本次范围内。'
},
anthropic: {
apiKeyPassthrough: '自动透传(仅替换认证)',
apiKeyPassthroughDesc:
@@ -3976,6 +3994,31 @@ export default {
pleaseEnterRefreshToken: '请输入 Refresh Token',
pleaseEnterSessionToken: '请输入 Session Token'
},
grok: {
title: 'Grok 账号授权',
followSteps: '请按照以下步骤授权您的 xAI/Grok 账号:',
step1GenerateUrl: '生成 xAI 授权链接',
generateAuthUrl: '生成授权链接',
step2OpenUrl: '在浏览器中打开链接并完成授权',
openUrlDesc: '在新标签页中打开授权链接,登录 xAI 并授权 API 访问。',
importantNotice: '当浏览器跳转到本地 callback URL 后,请复制完整 URL 或 code 参数回填到这里。',
step3EnterCode: '输入授权链接或 Code',
authCodeDesc: '授权完成后,粘贴 callback URL、查询字符串或授权码:',
authCode: '授权链接或 Code',
authCodePlaceholder: '粘贴完整 callback URL、?code=... 查询字符串或 code 值',
authCodeHint: '支持完整 callback URL、查询字符串或裸 code。',
refreshTokenAuth: '手动输入 RT',
refreshTokenDesc: '输入已有的 xAI refresh token,支持批量输入(每行一个)。',
refreshTokenPlaceholder: '粘贴您的 xAI refresh token...\n支持多个,每行一个',
validating: '验证中...',
validateAndCreate: '验证并创建账号',
pleaseEnterRefreshToken: '请输入 Refresh Token',
failedToGenerateUrl: '生成 Grok 授权链接失败',
missingExchangeParams: '缺少授权码、state 或 OAuth 会话',
failedToExchangeCode: 'Grok 授权码兑换失败',
failedToValidateRT: '验证 Grok refresh token 失败',
oauthOnlyHint: '首版 Grok 支持仅包含 OAuth 订阅的 Responses API 文本/推理转发。'
},
// Gemini specific
gemini: {
title: 'Gemini 账户授权',
@@ -4192,6 +4235,7 @@ export default {
openaiAccount: 'OpenAI 账号',
geminiAccount: 'Gemini 账号',
antigravityAccount: 'Antigravity 账号',
grokAccount: 'Grok 账号',
inputMethod: '输入方式',
reAuthorizedSuccess: '账号重新授权成功',
// Test Modal