Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
bab4bb99
"frontend/git@web.lueluesay.top:chenxi/sub2api.git" did not exist on "4644af2ccc7e56fd30c9371ec2ad4f0328bee448"
Commit
bab4bb99
authored
Mar 05, 2026
by
shaw
Browse files
chore: 更新openai、claude使用秘钥教程部分
parent
33bae6f4
Changes
3
Hide whitespace changes
Inline
Side-by-side
frontend/src/components/account/CreateAccountModal.vue
View file @
bab4bb99
...
...
@@ -2341,7 +2341,7 @@ import { applyInterceptWarmup } from '@/components/account/credentialsBuilder'
import
{
formatDateTimeLocalInput
,
parseDateTimeLocalInput
}
from
'
@/utils/format
'
import
{
createStableObjectKeyResolver
}
from
'
@/utils/stableObjectKey
'
import
{
OPENAI_WS_MODE_CTX_POOL
,
//
OPENAI_WS_MODE_CTX_POOL,
OPENAI_WS_MODE_OFF
,
OPENAI_WS_MODE_PASSTHROUGH
,
isOpenAIWSModeEnabled
,
...
...
@@ -2542,7 +2542,8 @@ const geminiSelectedTier = computed(() => {
const
openAIWSModeOptions
=
computed
(()
=>
[
{
value
:
OPENAI_WS_MODE_OFF
,
label
:
t
(
'
admin.accounts.openai.wsModeOff
'
)
}
,
{
value
:
OPENAI_WS_MODE_CTX_POOL
,
label
:
t
(
'
admin.accounts.openai.wsModeCtxPool
'
)
}
,
// TODO: ctx_pool 选项暂时隐藏,待测试完成后恢复
//
{
value
:
OPENAI_WS_MODE_CTX_POOL
,
label
:
t
(
'
admin.accounts.openai.wsModeCtxPool
'
)
}
,
{
value
:
OPENAI_WS_MODE_PASSTHROUGH
,
label
:
t
(
'
admin.accounts.openai.wsModePassthrough
'
)
}
])
...
...
frontend/src/components/account/EditAccountModal.vue
View file @
bab4bb99
...
...
@@ -1273,7 +1273,7 @@ import { applyInterceptWarmup } from '@/components/account/credentialsBuilder'
import
{
formatDateTimeLocalInput
,
parseDateTimeLocalInput
}
from
'
@/utils/format
'
import
{
createStableObjectKeyResolver
}
from
'
@/utils/stableObjectKey
'
import
{
OPENAI_WS_MODE_CTX_POOL
,
//
OPENAI_WS_MODE_CTX_POOL,
OPENAI_WS_MODE_OFF
,
OPENAI_WS_MODE_PASSTHROUGH
,
isOpenAIWSModeEnabled
,
...
...
@@ -1388,7 +1388,8 @@ const codexCLIOnlyEnabled = ref(false)
const
anthropicPassthroughEnabled
=
ref
(
false
)
const
openAIWSModeOptions
=
computed
(()
=>
[
{
value
:
OPENAI_WS_MODE_OFF
,
label
:
t
(
'
admin.accounts.openai.wsModeOff
'
)
}
,
{
value
:
OPENAI_WS_MODE_CTX_POOL
,
label
:
t
(
'
admin.accounts.openai.wsModeCtxPool
'
)
}
,
// TODO: ctx_pool 选项暂时隐藏,待测试完成后恢复
//
{
value
:
OPENAI_WS_MODE_CTX_POOL
,
label
:
t
(
'
admin.accounts.openai.wsModeCtxPool
'
)
}
,
{
value
:
OPENAI_WS_MODE_PASSTHROUGH
,
label
:
t
(
'
admin.accounts.openai.wsModePassthrough
'
)
}
])
const
openaiResponsesWebSocketV2Mode
=
computed
({
...
...
frontend/src/components/keys/UseKeyModal.vue
View file @
bab4bb99
...
...
@@ -443,7 +443,22 @@ $env:ANTHROPIC_AUTH_TOKEN="${apiKey}"`
content
=
''
}
return
[{
path
,
content
}]
const
vscodeSettingsPath
=
activeTab
.
value
===
'
unix
'
?
'
~/.claude/settings.json
'
:
'
%userprofile%
\\
.claude
\\
settings.json
'
const
vscodeContent
=
`{
"env": {
"ANTHROPIC_BASE_URL": "
${
baseUrl
}
",
"ANTHROPIC_AUTH_TOKEN": "
${
apiKey
}
",
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
}
}`
return
[
{
path
,
content
},
{
path
:
vscodeSettingsPath
,
content
:
vscodeContent
,
hint
:
'
VSCode Claude Code
'
}
]
}
function
generateGeminiCliContent
(
baseUrl
:
string
,
apiKey
:
string
):
FileConfig
{
...
...
@@ -496,16 +511,16 @@ function generateOpenAIFiles(baseUrl: string, apiKey: string): FileConfig[] {
const
configDir
=
isWindows
?
'
%userprofile%
\\
.codex
'
:
'
~/.codex
'
// config.toml content
const
configContent
=
`model_provider = "
sub2api
"
const
configContent
=
`model_provider = "
OpenAI
"
model = "gpt-5.3-codex"
model_reasoning_effort = "high
"
network_access = "enabled
"
review_model = "gpt-5.3-codex
"
model_reasoning_effort = "xhigh
"
disable_response_storage = true
network_access = "enabled"
windows_wsl_setup_acknowledged = true
model_verbosity = "high"
[model_providers.
sub2api
]
name = "
sub2api
"
[model_providers.
OpenAI
]
name = "
OpenAI
"
base_url = "
${
baseUrl
}
"
wire_api = "responses"
requires_openai_auth = true`
...
...
@@ -533,16 +548,16 @@ function generateOpenAIWsFiles(baseUrl: string, apiKey: string): FileConfig[] {
const
configDir
=
isWindows
?
'
%userprofile%
\\
.codex
'
:
'
~/.codex
'
// config.toml content with WebSocket v2
const
configContent
=
`model_provider = "
sub2api
"
const
configContent
=
`model_provider = "
OpenAI
"
model = "gpt-5.3-codex"
model_reasoning_effort = "high
"
network_access = "enabled
"
review_model = "gpt-5.3-codex
"
model_reasoning_effort = "xhigh
"
disable_response_storage = true
network_access = "enabled"
windows_wsl_setup_acknowledged = true
model_verbosity = "high"
[model_providers.
sub2api
]
name = "
sub2api
"
[model_providers.
OpenAI
]
name = "
OpenAI
"
base_url = "
${
baseUrl
}
"
wire_api = "responses"
supports_websockets = true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment