Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/123marks_myaccountcockpit.json
T

1 line
6.8 KiB
JSON

{"repo": "123marks/myaccountcockpit", "files": {"src/utils/codexProviderPresets.ts": {"ae6cd962ef4b28b6bf4e27aca82996a63b186715": {"t": 1785596161.4039724, "n": 6335, "h": "36dfcb39548ee892", "c": "export interface CodexApiProviderPreset {\n id: string;\n name: string;\n baseUrls: string[];\n website?: string;\n apiKeyUrl?: string;\n isOfficial?: boolean;\n isPartner?: boolean;\n isService?: boolean;\n}\n\nexport const CODEX_API_PROVIDER_CUSTOM_ID = \"custom\";\nexport const COCKPIT_API_PROVIDER_ID = \"cockpit_api\";\n\nexport const CODEX_API_PROVIDER_PRESETS: readonly CodexApiProviderPreset[] = [\n {\n id: COCKPIT_API_PROVIDER_ID,\n name: \"Cockpit Api\",\n baseUrls: [\"https://chongcodex.cn/v1\"],\n website: \"https://chongcodex.cn/console\",\n apiKeyUrl: \"https://chongcodex.cn/console\",\n isPartner: true,\n isService: true,\n },\n {\n id: \"openai_official\",\n name: \"OpenAI Official\",\n baseUrls: [\"https://api.openai.com/v1\"],\n website: \"https://chatgpt.com/codex\",\n apiKeyUrl: \"https://platform.openai.com/api-keys\",\n isOfficial: true,\n },\n {\n id: \"azure_openai\",\n name: \"Azure OpenAI\",\n baseUrls: [\"https://YOUR_RESOURCE_NAME.openai.azure.com/openai\"],\n website:\n \"https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/codex\",\n isOfficial: true,\n },\n {\n id: \"packycode\",\n name: \"PackyCode\",\n baseUrls: [\n \"https://www.packyapi.com/v1\",\n \"https://api-slb.packyapi.com/v1\",\n ],\n website: \"https://www.packyapi.com\",\n apiKeyUrl: \"https://www.packyapi.com/register?aff=cc-switch\",\n isPartner: true,\n },\n {\n id: \"cubence\",\n name: \"Cubence\",\n baseUrls: [\n \"https://api.cubence.com/v1\",\n \"https://api-cf.cubence.com/v1\",\n \"https://api-dmit.cubence.com/v1\",\n \"https://api-bwg.cubence.com/v1\",\n ],\n website: \"https://cubence.com\",\n apiKeyUrl: \"https://cubence.com/signup?code=CCSWITCH&source=ccs\",\n isPartner: true,\n },\n {\n id: \"aigocode\",\n name: \"AIGoCode\",\n baseUrls: [\"https://api.aigocode.com\"],\n website: \"https://aigocode.com\",\n apiKeyUrl: \"https://aigocode.com/invite/CC-SWITCH\",\n isPartner: true,\n },\n {\n id: \"rightcode\",\n name: \"RightCode\",\n baseUrls: [\"https://right.codes/codex/v1\"],\n website: \"https://www.right.codes\",\n apiKeyUrl: \"https://www.right.codes/register?aff=CCSWITCH\",\n isPartner: true,\n },\n {\n id: \"sssaicode\",\n name: \"SSSAiCode\",\n baseUrls: [\n \"https://node-hk.sssaicode.com/api/v1\",\n \"https://claude2.sssaicode.com/api/v1\",\n \"https://anti.sssaicode.com/api/v1\",\n ],\n website: \"https://www.sssaicode.com\",\n apiKeyUrl: \"https://www.sssaicode.com/register?ref=DCP0SM\",\n isPartner: true,\n },\n {\n id: \"micu\",\n name: \"Micu\",\n baseUrls: [\"https://www.openclaudecode.cn/v1\"],\n website: \"https://www.openclaudecode.cn\",\n apiKeyUrl: \"https://www.openclaudecode.cn/register?aff=aOYQ\",\n isPartner: true,\n },\n {\n id: \"x_code_api\",\n name: \"X-Code API\",\n baseUrls: [\"https://x-code.cc/v1\"],\n website: \"https://x-code.cc\",\n apiKeyUrl: \"https://x-code.cc\",\n isPartner: true,\n },\n {\n id: \"ctok_ai\",\n name: \"CTok.ai\",\n baseUrls: [\"https://api.ctok.ai/v1\"],\n website: \"https://ctok.ai\",\n apiKeyUrl: \"https://ctok.ai\",\n isPartner: true,\n },\n {\n id: \"aihubmix\",\n name: \"AiHubMix\",\n baseUrls: [\"https://aihubmix.com/v1\", \"https://api.aihubmix.com/v1\"],\n website: \"https://aihubmix.com\",\n },\n {\n id: \"dmxapi\",\n name: \"DMXAPI\",\n baseUrls: [\"https://www.dmxapi.cn/v1\"],\n website: \"https://www.dmxapi.cn\",\n isPartner: true,\n },\n {\n id: \"compshare\",\n name: \"优云智算\",\n baseUrls: [\"https://api.modelverse.cn/v1\"],\n website: \"https://www.compshare.cn\",\n apiKeyUrl:\n \"https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch\",\n isPartner: true,\n },\n {\n id: \"openrouter\",\n name: \"OpenRouter\",\n baseUrls: [\"https://openrouter.ai/api/v1\"],\n website: \"https://openrouter.ai/\",\n apiKeyUrl: \"https://openrouter.ai/keys\",\n },\n {\n id: \"aicodemirror\",\n name: \"AICodeMirror\",\n baseUrls: [\n \"https://api.aicodemirror.com/api/codex/backend-api/codex\",\n \"https://api.claudecode.net.cn/api/codex/backend-api/codex\",\n ],\n website: \"https://www.aicodemirror.com\",\n apiKeyUrl: \"https://www.aicodemirror.com/register?invitecode=9915W3\",\n isPartner: true,\n },\n {\n id: \"aicoding\",\n name: \"AICoding\",\n baseUrls: [\"https://api.aicoding.sh\"],\n website: \"https://aicoding.sh\",\n apiKeyUrl: \"https://aicoding.sh/i/CCSWITCH\",\n isPartner: true,\n },\n {\n id: \"crazyrouter\",\n name: \"CrazyRouter\",\n baseUrls: [\"https://crazyrouter.com/v1\"],\n website: \"https://www.crazyrouter.com\",\n apiKeyUrl: \"https://www.crazyrouter.com/register?aff=OZcm&ref=cc-switch\",\n isPartner: true,\n },\n {\n id: \"deepseek\",\n name: \"DeepSeek\",\n baseUrls: [\"https://api.deepseek.com/v1\"],\n website: \"https://platform.deepseek.com/\",\n apiKeyUrl: \"https://platform.deepseek.com/api_keys\",\n },\n {\n id: \"moonshot\",\n name: \"Moonshot\",\n baseUrls: [\"https://api.moonshot.cn/v1\"],\n website: \"https://platform.moonshot.cn/\",\n },\n {\n id: \"siliconflow\",\n name: \"SiliconFlow\",\n baseUrls: [\"https://api.siliconflow.cn/v1\"],\n website: \"https://cloud.siliconflow.cn/\",\n },\n];\n\nfunction normalizeCodexProviderBaseUrl(value: string): string | null {\n const trimmed = value.trim();\n if (!trimmed) return null;\n try {\n const parsed = new URL(trimmed);\n if (parsed.protocol !== \"http:\" && parsed.protocol !== \"https:\")\n return null;\n return `${parsed.origin}${parsed.pathname}`\n .replace(/\\/+$/, \"\")\n .toLowerCase();\n } catch {\n return null;\n }\n}\n\nexport function findCodexApiProviderPresetById(\n id: string,\n): CodexApiProviderPreset | null {\n return CODEX_API_PROVIDER_PRESETS.find((preset) => preset.id === id) ?? null;\n}\n\nexport function findCodexApiProviderPresetByBaseUrl(\n rawBaseUrl: string,\n): CodexApiProviderPreset | null {\n const normalized = normalizeCodexProviderBaseUrl(rawBaseUrl);\n if (!normalized) return null;\n\n return (\n CODEX_API_PROVIDER_PRESETS.find((preset) =>\n preset.baseUrls.some(\n (baseUrl) => normalizeCodexProviderBaseUrl(baseUrl) === normalized,\n ),\n ) ?? null\n );\n}\n\nexport function resolveCodexApiProviderPresetId(rawBaseUrl: string): string {\n return (\n findCodexApiProviderPresetByBaseUrl(rawBaseUrl)?.id ??\n CODEX_API_PROVIDER_CUSTOM_ID\n );\n}\n"}}}}