Files

1 line
216 KiB
JSON

{"repo": "ai365vip/chat-api", "files": {"common/constants.go": {"f7ea0d24a79fd86a8e58e7ad4e068d038d86228c": {"t": 1785746053.9966319, "n": 6137, "h": "67f4d1438c53ae80", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\"\n\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar AdjustHour = GetOrDefault(\"ADJUSTHOUR\", 0)\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n\tChannelTypeCohere = 37\n\tChannelTypeDeepSeek = 38\n\tChannelTypeTogetherAI = 39\n\tChannelTypeDeepL = 40\n\tChannelTypeDouBao = 41\n\tChannelTypeGCP = 42\n\tChannelTypeXAI = 43\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n\t\"https://api.cohere.ai\", //37\n\t\"https://api.deepseek.com\", //38\n\t\"https://api.together.xyz\", // 39\n\t\"https://api-free.deepl.com\", // 40\n\t\"https://ark.cn-beijing.volces.com\", // 41\n\t\"\", // 42\n\t\"https://api.x.ai\", // 43\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "b100b9f04876e503aba28683d2d0b89199bf8a8f": {"t": 1785759252.157114, "n": 6137, "h": "67f4d1438c53ae80", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\"\n\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar AdjustHour = GetOrDefault(\"ADJUSTHOUR\", 0)\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n\tChannelTypeCohere = 37\n\tChannelTypeDeepSeek = 38\n\tChannelTypeTogetherAI = 39\n\tChannelTypeDeepL = 40\n\tChannelTypeDouBao = 41\n\tChannelTypeGCP = 42\n\tChannelTypeXAI = 43\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n\t\"https://api.cohere.ai\", //37\n\t\"https://api.deepseek.com\", //38\n\t\"https://api.together.xyz\", // 39\n\t\"https://api-free.deepl.com\", // 40\n\t\"https://ark.cn-beijing.volces.com\", // 41\n\t\"\", // 42\n\t\"https://api.x.ai\", // 43\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "d6401f0ca7382d3d643b2793cc1d97947775b7e3": {"t": 1785759253.6137972, "n": 6060, "h": "29e364329a5a74b7", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\"\n\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar AdjustHour = GetOrDefault(\"ADJUSTHOUR\", 0)\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n\tChannelTypeCohere = 37\n\tChannelTypeDeepSeek = 38\n\tChannelTypeTogetherAI = 39\n\tChannelTypeDeepL = 40\n\tChannelTypeDouBao = 41\n\tChannelTypeGCP = 42\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n\t\"https://api.cohere.ai\", //37\n\t\"https://api.deepseek.com\", //38\n\t\"https://api.together.xyz\", // 39\n\t\"https://api-free.deepl.com\", // 40\n\t\"https://ark.cn-beijing.volces.com\", // 41\n\t\"\", //42\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "62e3ed8f5b1e93595e6b8bfc39bed82df7b7ac10": {"t": 1785759255.1169631, "n": 5985, "h": "8822ba1ac77e5a72", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\"\n\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar AdjustHour = GetOrDefault(\"ADJUSTHOUR\", 0)\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n\tChannelTypeCohere = 37\n\tChannelTypeDeepSeek = 38\n\tChannelTypeTogetherAI = 39\n\tChannelTypeDeepL = 40\n\tChannelTypeDouBao = 41\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n\t\"https://api.cohere.ai\", //37\n\t\"https://api.deepseek.com\", //38\n\t\"https://api.together.xyz\", // 39\n\t\"https://api-free.deepl.com\", // 40\n\t\"https://ark.cn-beijing.volces.com\", // 41\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "7a2bf6452391abca0e9cad6ee2581e9fc7dbdf90": {"t": 1785759256.9179785, "n": 6032, "h": "16d7c3580d1e7a8e", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\"\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar AdjustHour = GetOrDefault(\"ADJUSTHOUR\", 0)\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n\tChannelTypeCohere = 37\n\tChannelTypeDeepSeek = 38\n\tChannelTypeTogetherAI = 39\n\tChannelTypeDeepL = 40\n\tChannelTypeDouBao = 41\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n\t\"https://api.cohere.ai\", //37\n\t\"https://api.deepseek.com\", //38\n\t\"https://api.together.xyz\", // 39\n\t\"https://api-free.deepl.com\", // 40\n\t\"https://ark.cn-beijing.volces.com\", // 41\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "ae6227e39b10f09b7f42e0cf34ae7c0296a1a225": {"t": 1785759258.2629833, "n": 5860, "h": "d8a1d3dfb92c5369", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\"\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar AdjustHour = GetOrDefault(\"ADJUSTHOUR\", 0)\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n\tChannelTypeCohere = 37\n\tChannelTypeDeepSeek = 38\n\tChannelTypeTogetherAI = 39\n\tChannelTypeDeepL = 40\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n\t\"https://api.cohere.ai\", //37\n\t\"https://api.deepseek.com\", //38\n\t\"https://api.together.xyz\", // 39\n\t\"https://api-free.deepl.com\", // 39\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "bc06979d2e2acb17387d9cf924122882e6422051": {"t": 1785759259.4810944, "n": 5790, "h": "fd801b47f247b7ad", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\"\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar AdjustHour = GetOrDefault(\"ADJUSTHOUR\", 0)\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n\tChannelTypeCohere = 37\n\tChannelTypeDeepSeek = 38\n\tChannelTypeTogetherAI = 39\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n\t\"https://api.cohere.ai\", //37\n\t\"https://api.deepseek.com\", //38\n\t\"https://api.together.xyz\", // 39\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "892d691980f79b30b91a6a176e5e8fb7ca81323f": {"t": 1785759260.8647172, "n": 5720, "h": "6760600605575b06", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\"\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar AdjustHour = GetOrDefault(\"ADJUSTHOUR\", 0)\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n\tChannelTypeCohere = 37\n\tChannelTypeDeepSeek = 38\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n\t\"https://api.cohere.ai\", //37\n\t\"https://api.deepseek.com\", //38\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "6af2731705a2e5add516689a47388aba94085d61": {"t": 1785759262.6644874, "n": 5651, "h": "770ff29e5ddf6ed7", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\"\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar AdjustHour = GetOrDefault(\"ADJUSTHOUR\", 0)\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n\tChannelTypeCohere = 37\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n\t\"https://api.cohere.ai\", //37\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "a4c8f37de6bdca86394cbd5fa582c5ff4aabda0b": {"t": 1785759265.8326447, "n": 5652, "h": "a25e0f5ab07d546e", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\"\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar AdjustHour = GetAdjustHour(\"ADJUSTHOUR\", 0)\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n\tChannelTypeCohere = 37\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n\t\"https://api.cohere.ai\", //37\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "44ebbdccad2f4a3475327e08e6ed273df2268c58": {"t": 1785759268.6102417, "n": 5579, "h": "2e0aab5754482a5e", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar AdjustHour = GetAdjustHour(\"ADJUSTHOUR\", 0)\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n\tChannelTypeCohere = 37\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n\t\"https://api.cohere.ai\", //37\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "d43390930b338819d3d4186f81a7baff4a1fde6a": {"t": 1785759270.7742262, "n": 5530, "h": "a331e6b71d27de65", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n\tChannelTypeCohere = 37\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n\t\"https://api.cohere.ai\", //37\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "9a8c2ba83124d44e4e3d9a4cb471c0371e106173": {"t": 1785759272.4576917, "n": 5461, "h": "54fe2accd7586db8", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "3acfc1250900f9e49f76f3832186000a69c5ea62": {"t": 1785759273.8389325, "n": 5531, "h": "44e4ffdaea2a03ec", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeOaifree = 35\n\tChannelTypeAwsClaude = 36\n\tChannelTypeCoze = 37\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"https://api.oaifree.com\", // 35\n\t\"\", // 36\n\t\"https://api.coze.com\", // 37\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "f362a80300579666873968ae134b6a6c19754764": {"t": 1785759275.0803843, "n": 7923, "h": "2469f4b46854cdea", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar GroupEnable = true\nvar LogContentEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\nvar ApproximateTokenEnabled = false\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar AutomaticEnableChannelEnabled = false\nvar TopupRatioEnabled = true\nvar TopupAmountEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n\tChannelTypeCoze = 36\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\t\"https://api.coze.com\", // 36\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "93586724788e4ecf2326d66169a1584175d0ae78": {"t": 1785759277.4613073, "n": 7854, "h": "e630c46b15542282", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar GroupEnable = true\nvar LogContentEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\nvar ApproximateTokenEnabled = false\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar AutomaticEnableChannelEnabled = false\nvar TopupRatioEnabled = true\nvar TopupAmountEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n\tChannelTypeAwsClaude = 35\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n\t\"\", // 35\n\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n\tConfigSK = ConfigKeyPrefix + \"sk\"\n\tConfigAK = ConfigKeyPrefix + \"ak\"\n\tConfigRegion = ConfigKeyPrefix + \"region\"\n\tConfigUserID = ConfigKeyPrefix + \"user_id\"\n)\n"}, "68dcf000f8d0cf03bce18746cd63ea44fcd148c1": {"t": 1785759280.1736207, "n": 7590, "h": "956031c0072b41e1", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar GroupEnable = true\nvar LogContentEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\nvar ApproximateTokenEnabled = false\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar AutomaticEnableChannelEnabled = false\nvar TopupRatioEnabled = true\nvar TopupAmountEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 60\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n)\n"}, "851870cb1d4b89095e44a0005212d5aef2d97a56": {"t": 1785759281.6540582, "n": 7591, "h": "8cbb36c9b10e8d74", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar GroupEnable = true\nvar LogContentEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\nvar ApproximateTokenEnabled = false\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar AutomaticEnableChannelEnabled = false\nvar TopupRatioEnabled = true\nvar TopupAmountEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 28\n\tChannelTypeGroq = 29\n\tChannelTypeBaichuan = 30\n\tChannelTypeMinimax = 31\n\tChannelTypeMistral = 32\n\tChannelTypeOllama = 33\n\tChannelTypeLingYiWanWu = 34\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //28\n\t\"https://api.groq.com/openai\", // 29\n\t\"https://api.baichuan-ai.com\", // 30\n\t\"https://api.minimax.chat\", // 31\n\t\"https://api.mistral.ai\", // 32\n\t\"http://localhost:11434\", // 33\n\t\"https://api.lingyiwanwu.com\", // 34\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n)\n"}, "b083b1e8e2c0b8fc6c4f24dbc4b6ed551469b84b": {"t": 1785759284.0637321, "n": 7591, "h": "d23302c235bb007f", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar GroupEnable = true\nvar LogContentEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\nvar ApproximateTokenEnabled = false\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar AutomaticEnableChannelEnabled = false\nvar TopupRatioEnabled = true\nvar TopupAmountEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeStability = 29\n\tChannelTypeGroq = 30\n\tChannelTypeBaichuan = 31\n\tChannelTypeMinimax = 32\n\tChannelTypeMistral = 33\n\tChannelTypeOllama = 34\n\tChannelTypeLingYiWanWu = 35\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://api.stability.ai\", //29\n\t\"https://api.groq.com/openai\", // 30\n\t\"https://api.baichuan-ai.com\", // 31\n\t\"https://api.minimax.chat\", // 32\n\t\"https://api.mistral.ai\", // 33\n\t\"http://localhost:11434\", // 34\n\t\"https://api.lingyiwanwu.com\", // 35\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n)\n"}, "1c1036fc156ca8377c296c8196405cec71298cf4": {"t": 1785759286.277285, "n": 7660, "h": "759b7a9ca68705d9", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar GroupEnable = true\nvar LogContentEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\nvar ApproximateTokenEnabled = false\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar AutomaticEnableChannelEnabled = false\nvar TopupRatioEnabled = true\nvar TopupAmountEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeZhipu_v4 = 28\n\tChannelTypeStability = 29\n\tChannelTypeGroq = 30\n\tChannelTypeBaichuan = 31\n\tChannelTypeMinimax = 32\n\tChannelTypeMistral = 33\n\tChannelTypeOllama = 34\n\tChannelTypeLingYiWanWu = 35\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://open.bigmodel.cn\", //28\n\t\"https://api.stability.ai\", //29\n\t\"https://api.groq.com/openai\", // 30\n\t\"https://api.baichuan-ai.com\", // 31\n\t\"https://api.minimax.chat\", // 32\n\t\"https://api.mistral.ai\", // 33\n\t\"http://localhost:11434\", // 34\n\t\"https://api.lingyiwanwu.com\", // 35\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n)\n"}, "c53de8a42ab8da6134eb9bc2520285b1f23f909c": {"t": 1785759288.7875562, "n": 7225, "h": "e17b2d85ae3843b9", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar GroupEnable = true\nvar LogContentEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\nvar ApproximateTokenEnabled = false\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar AutomaticEnableChannelEnabled = false\nvar TopupRatioEnabled = true\nvar TopupAmountEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeZhipu_v4 = 28\n\tChannelTypeStability = 29\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://open.bigmodel.cn\", //28\n\t\"https://api.stability.ai\", //29\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n)\n"}, "26d064950994255d4c5f9638ad03c6b3eb25b91f": {"t": 1785759290.6237502, "n": 7159, "h": "055648e8d3062db8", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar GroupEnable = true\nvar LogContentEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\nvar ApproximateTokenEnabled = false\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar AutomaticEnableChannelEnabled = false\nvar TopupRatioEnabled = true\nvar TopupAmountEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n\tChannelTypeZhipu_v4 = 28\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\", //27\n\t\"https://open.bigmodel.cn\", //28\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n)\n"}, "472454b0b27e3bc7a4e899004330b176311d77ff": {"t": 1785759291.9403224, "n": 7039, "h": "fe2cb11b3487d017", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar GroupEnable = true\nvar LogContentEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\nvar ApproximateTokenEnabled = false\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar AutomaticEnableChannelEnabled = false\nvar TopupRatioEnabled = true\nvar TopupAmountEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\",\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n)\n"}, "ce6d10922ec1af48de7a2116925d25f46cc14d38": {"t": 1785759293.2088351, "n": 6979, "h": "897556d1f1df9d44", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar GroupEnable = true\nvar LogContentEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\nvar ApproximateTokenEnabled = false\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar AutomaticEnableChannelEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n\tChannelTypeMoonshot = 27\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"https://generativelanguage.googleapis.com\", //24\n\t\"\", //25\n\t\"\", //26\n\t\"https://api.moonshot.cn\",\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n)\n"}, "417cac48bee88cadcbd1bcf99a43e69514f65846": {"t": 1785759295.8668847, "n": 6899, "h": "e5a76ff6f7a4a2db", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar GroupEnable = true\nvar LogContentEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"\", //24\n\t\"\", //25\n\t\"\", //26\n}\n\nconst (\n\tConfigKeyPrefix = \"cfg_\"\n\n\tConfigKeyAPIVersion = ConfigKeyPrefix + \"api_version\"\n\tConfigKeyLibraryID = ConfigKeyPrefix + \"library_id\"\n\tConfigKeyPlugin = ConfigKeyPrefix + \"plugin\"\n)\n"}, "2547babcc9422e2452bd379853604586e2a592ba": {"t": 1785759297.452185, "n": 6702, "h": "3e047a3c4d9bb9dd", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar GroupEnable = true\nvar LogContentEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"\", //24\n\t\"\", //25\n\t\"\", //26\n}\n"}, "753635ef7e2ee95d233e913e619ee04f9cfa04f4": {"t": 1785759299.0494835, "n": 6650, "h": "1b1603077a22cfc7", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n\tChannelTypeLobeChat = 26\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"\", //24\n\t\"\", //25\n\t\"\", //26\n}\n"}, "5c0417e5c64f0cb0798d06fcf0b309154c9dbcf0": {"t": 1785759300.4752905, "n": 6575, "h": "f8090f64f6b16314", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar RedempTionCount = 30\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"\", //24\n\t\"\", //25\n}\n"}, "13014510a39e15b4f2a5dcb6968babd64e7ad1f4": {"t": 1785759301.6839297, "n": 6550, "h": "49bb7e4fd0c2cd31", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\nvar GeminiSafetySetting = GetOrDefaultString(\"GEMINI_SAFETY_SETTING\", \"BLOCK_NONE\")\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"\", //24\n\t\"\", //25\n}\n"}, "e130e8a9868eef25586cb21b72a5231b98f2bf72": {"t": 1785759303.0350718, "n": 6467, "h": "715f6b76a970d368", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar MiniQuota = 1.0\nvar ProporTions = 10\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\n\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"\", //24\n\t\"\", //25\n}\n"}, "17d46bbc6a06ff0531e657d6a12218e357b79f68": {"t": 1785759304.4379537, "n": 6426, "h": "bb462dc94c2f8149", "c": "package common\n\nimport (\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/google/uuid\"\n)\n\nvar StartTime = time.Now().Unix() // unit: second\nvar Version = \"v0.0.0\" // this hard coding will be replaced automatically when building, no need to manually change\nvar SystemName = \"Chat API\"\nvar SystemText = \"\"\nvar ServerAddress = \"http://localhost:3000\"\nvar PayAddress = \"\"\nvar EpayId = \"\"\nvar EpayKey = \"\"\nvar Price = 7.3\nvar Footer = \"\"\nvar Logo = \"\"\nvar TopUpLink = \"\"\nvar ChatLink = \"\"\nvar QuotaPerUnit = 500 * 1000.0 // $0.002 / 1K tokens\nvar DisplayInCurrencyEnabled = true\nvar DisplayTokenStatEnabled = true\nvar EmailNotificationsEnabled = true\nvar WxPusherNotificationsEnabled = true\nvar ModelRatioEnabled = true\nvar BillingByRequestEnabled = true\nvar Wx = true\nvar Zfb = true\nvar DrawingEnabled = true\nvar DataExportEnabled = true\nvar DataExportInterval = 5 // unit: minute\nvar UserGroup = \"default\"\nvar VipUserGroup = \"default\"\n\n// Any options with \"Secret\", \"Token\" in its key won't be return by GetOptions\n\nvar SessionSecret = uuid.New().String()\n\nvar OptionMap map[string]string\nvar OptionMapRWMutex sync.RWMutex\n\nvar ItemsPerPage = 10\nvar MaxRecentItems = 100\n\nvar PasswordLoginEnabled = true\nvar PasswordRegisterEnabled = true\nvar EmailVerificationEnabled = false\nvar GitHubOAuthEnabled = false\nvar WeChatAuthEnabled = false\nvar TurnstileCheckEnabled = false\nvar RegisterEnabled = true\n\nvar EmailDomainRestrictionEnabled = false\nvar EmailDomainWhitelist = []string{\n\t\"gmail.com\",\n\t\"163.com\",\n\t\"126.com\",\n\t\"qq.com\",\n\t\"outlook.com\",\n\t\"hotmail.com\",\n\t\"icloud.com\",\n\t\"yahoo.com\",\n\t\"foxmail.com\",\n}\n\nvar DebugEnabled = os.Getenv(\"DEBUG\") == \"true\"\nvar MemoryCacheEnabled = os.Getenv(\"MEMORY_CACHE_ENABLED\") == \"true\"\n\nvar LogConsumeEnabled = true\n\nvar SMTPServer = \"\"\nvar SMTPPort = 587\nvar SMTPAccount = \"\"\nvar SMTPFrom = \"\"\nvar SMTPToken = \"\"\n\nvar AppToken = \"\"\nvar Uids = \"\"\n\nvar GitHubClientId = \"\"\nvar GitHubClientSecret = \"\"\n\nvar WeChatServerAddress = \"\"\nvar WeChatServerToken = \"\"\nvar WeChatAccountQRCodeImageURL = \"\"\n\nvar TurnstileSiteKey = \"\"\nvar TurnstileSecretKey = \"\"\n\nvar QuotaForNewUser = 0\nvar QuotaForInviter = 0\nvar QuotaForInvitee = 0\nvar ChannelDisableThreshold = 5.0\nvar AutomaticDisableChannelEnabled = false\nvar QuotaRemindThreshold = 1000\nvar PreConsumedQuota = 500\n\nvar RetryTimes = 0\n\nvar RootUserEmail = \"\"\n\nvar IsMasterNode = os.Getenv(\"NODE_TYPE\") != \"slave\"\n\nvar requestInterval, _ = strconv.Atoi(os.Getenv(\"POLLING_INTERVAL\"))\nvar RequestInterval = time.Duration(requestInterval) * time.Second\n\nvar SyncFrequency = GetOrDefault(\"SYNC_FREQUENCY\", 60) // unit is second\n\nvar BatchUpdateEnabled = false\nvar BatchUpdateInterval = GetOrDefault(\"BATCH_UPDATE_INTERVAL\", 5)\n\nvar RelayTimeout = GetOrDefault(\"RELAY_TIMEOUT\", 0) // unit is second\n\nconst (\n\tRequestIdKey = \"X-Oneapi-Request-Id\"\n)\n\nconst (\n\tRoleGuestUser = 0\n\tRoleCommonUser = 1\n\tRoleAdminUser = 10\n\tRoleRootUser = 100\n)\n\nvar (\n\tFileUploadPermission = RoleGuestUser\n\tFileDownloadPermission = RoleGuestUser\n\tImageUploadPermission = RoleGuestUser\n\tImageDownloadPermission = RoleGuestUser\n)\n\n// All duration's unit is seconds\n// Shouldn't larger then RateLimitKeyExpirationDuration\nvar (\n\tGlobalApiRateLimitNum = GetOrDefault(\"GLOBAL_API_RATE_LIMIT\", 180)\n\tGlobalApiRateLimitDuration int64 = 3 * 60\n\n\tGlobalWebRateLimitNum = GetOrDefault(\"GLOBAL_WEB_RATE_LIMIT\", 400)\n\tGlobalWebRateLimitDuration int64 = 3 * 400\n\n\tUploadRateLimitNum = 10\n\tUploadRateLimitDuration int64 = 60\n\n\tDownloadRateLimitNum = 10\n\tDownloadRateLimitDuration int64 = 60\n\n\tCriticalRateLimitNum = 20\n\tCriticalRateLimitDuration int64 = 20 * 60\n)\n\nvar RateLimitKeyExpirationDuration = 20 * time.Minute\n\nconst (\n\tUserStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tUserStatusDisabled = 2 // also don't use 0\n)\n\nconst (\n\tTokenStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tTokenStatusDisabled = 2 // also don't use 0\n\tTokenStatusExpired = 3\n\tTokenStatusExhausted = 4\n)\n\nconst (\n\tRedemptionCodeStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tRedemptionCodeStatusDisabled = 2 // also don't use 0\n\tRedemptionCodeStatusUsed = 3 // also don't use 0\n)\n\nconst (\n\tChannelStatusUnknown = 0\n\tChannelStatusEnabled = 1 // don't use 0, 0 is the default value!\n\tChannelStatusManuallyDisabled = 2 // also don't use 0\n\tChannelStatusAutoDisabled = 3\n)\n\nconst (\n\tChannelTypeUnknown = 0\n\tChannelTypeOpenAI = 1\n\tChannelTypeAPI2D = 2\n\tChannelTypeAzure = 3\n\tChannelTypeCloseAI = 4\n\tChannelTypeOpenAISB = 5\n\tChannelTypeOpenAIMax = 6\n\tChannelTypeOhMyGPT = 7\n\tChannelTypeCustom = 8\n\tChannelTypeAILS = 9\n\tChannelTypeAIProxy = 10\n\tChannelTypePaLM = 11\n\tChannelTypeAPI2GPT = 12\n\tChannelTypeAIGC2D = 13\n\tChannelTypeAnthropic = 14\n\tChannelTypeBaidu = 15\n\tChannelTypeZhipu = 16\n\tChannelTypeAli = 17\n\tChannelTypeXunfei = 18\n\tChannelType360 = 19\n\tChannelTypeOpenRouter = 20\n\tChannelTypeAIProxyLibrary = 21\n\tChannelTypeFastGPT = 22\n\tChannelTypeTencent = 23\n\tChannelTypeGemini = 24\n\tChannelTypeChatBot = 25\n)\n\nvar ChannelBaseURLs = []string{\n\t\"\", // 0\n\t\"https://api.openai.com\", // 1\n\t\"https://oa.api2d.net\", // 2\n\t\"\", // 3\n\t\"https://api.closeai-proxy.xyz\", // 4\n\t\"https://api.openai-sb.com\", // 5\n\t\"https://api.openaimax.com\", // 6\n\t\"https://api.ohmygpt.com\", // 7\n\t\"\", // 8\n\t\"https://api.caipacity.com\", // 9\n\t\"https://api.aiproxy.io\", // 10\n\t\"\", // 11\n\t\"https://api.api2gpt.com\", // 12\n\t\"https://api.aigc2d.com\", // 13\n\t\"https://api.anthropic.com\", // 14\n\t\"https://aip.baidubce.com\", // 15\n\t\"https://open.bigmodel.cn\", // 16\n\t\"https://dashscope.aliyuncs.com\", // 17\n\t\"\", // 18\n\t\"https://ai.360.cn\", // 19\n\t\"https://openrouter.ai/api\", // 20\n\t\"https://api.aiproxy.io\", // 21\n\t\"https://fastgpt.run/api/openapi\", // 22\n\t\"https://hunyuan.cloud.tencent.com\", //23\n\t\"\", //24\n\t\"\", //25\n}\n"}}}}