mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
feat(codex): add xAI (Grok) native Responses preset
API-key preset pointing at https://api.x.ai/v1 with wire_api = "responses": xAI serves the Responses API natively, so no route takeover conversion is needed. Ships a grok-4.5 catalog entry (500K context, parallel tools, text+image) so the model shows up under Codex's strict catalog parsing. This is deliberately not a managed-account preset: providerType stays absent, pinned by a regression test alongside the Claude-side xAI OAuth presets.
This commit is contained in:
@@ -999,6 +999,30 @@ requires_openai_auth = true`,
|
||||
icon: "novita",
|
||||
iconColor: "#000000",
|
||||
},
|
||||
{
|
||||
name: "xAI (Grok)",
|
||||
websiteUrl: "https://x.ai/api",
|
||||
apiKeyUrl: "https://console.x.ai",
|
||||
auth: generateThirdPartyAuth(""),
|
||||
config: generateThirdPartyConfig("xai", "https://api.x.ai/v1", "grok-4.5"),
|
||||
endpointCandidates: ["https://api.x.ai/v1"],
|
||||
// xAI 官方以 /v1/responses 为一等端点(docs.x.ai api-reference):Codex 硬依赖的
|
||||
// store:false / include=["reasoning.encrypted_content"] / reasoning effort 均支持,
|
||||
// 原生 Responses,无需路由接管转换
|
||||
apiFormat: "openai_responses",
|
||||
modelCatalog: modelCatalog([
|
||||
{
|
||||
model: "grok-4.5",
|
||||
displayName: "Grok 4.5",
|
||||
contextWindow: 500000,
|
||||
supportsParallelToolCalls: true,
|
||||
inputModalities: ["text", "image"],
|
||||
},
|
||||
]),
|
||||
category: "third_party",
|
||||
icon: "xai",
|
||||
iconColor: "#000000",
|
||||
},
|
||||
{
|
||||
name: "Nvidia",
|
||||
websiteUrl: "https://build.nvidia.com",
|
||||
|
||||
Reference in New Issue
Block a user