Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
10,602 in github.com/QuantumNous/new-api
⨍
Functions
10,602
◇
Types & classes
1,425
↓ 2 callers
Function
DefaultInt
DefaultInt returns val if non-zero, otherwise fallback.
relay/channel/task/taskcommon/helpers.go:41
↓ 2 callers
Function
DefaultString
DefaultString returns val if non-empty, otherwise fallback.
relay/channel/task/taskcommon/helpers.go:33
↓ 2 callers
Method
Delete
Delete 删除2FA设置
model/twofa.go:97
↓ 2 callers
Method
Delete
()
model/redemption.go:206
↓ 2 callers
Method
Delete
()
model/token.go:324
↓ 2 callers
Function
DeleteOldLogBatch
(ctx context.Context, targetTimestamp int64, limit int)
model/log.go:703
↓ 2 callers
Function
DeletePasskeyByUserID
(userID int)
model/passkey.go:199
↓ 2 callers
Function
DeleteUserOAuthBinding
DeleteUserOAuthBinding deletes an OAuth binding
model/user_oauth_binding.go:133
↓ 2 callers
Function
DisableCache
()
middleware/disable-cache.go:5
↓ 2 callers
Function
DisableChannel
disable & notify
service/channel.go:19
↓ 2 callers
Function
DisableTwoFA
DisableTwoFA 禁用用户的2FA
model/twofa.go:213
↓ 2 callers
Function
DoFormRequest
(a Adaptor, c *gin.Context, info *common.RelayInfo, requestBody io.Reader)
relay/channel/api_request.go:337
↓ 2 callers
Function
DoWssRequest
(a Adaptor, c *gin.Context, info *common.RelayInfo, requestBody io.Reader)
relay/channel/api_request.go:369
↓ 2 callers
Method
EditWithTx
(tx *gorm.DB, updatePassword bool)
model/user.go:680
↓ 2 callers
Method
Error
()
oauth/linuxdo.go:193
↓ 2 callers
Function
EstimateTokenByModel
(model, text string)
service/token_estimator.go:216
↓ 2 callers
Method
ExchangeToken
ExchangeToken exchanges the authorization code for an access token The gin.Context is passed for providers that need request info (e.g., for redirect_
oauth/provider.go:20
↓ 2 callers
Function
ExpireStaleSystemTaskLocks
(now int64)
model/system_task.go:360
↓ 2 callers
Function
ExplicitUserOverrides
ExplicitUserOverrides returns only the per-user override entries.
service/authz/override.go:108
↓ 2 callers
Function
ExtendWriteDeadline
ExtendWriteDeadline pushes the connection write deadline forward before each stream write. Best-effort: writers that don't support deadlines (e.g. htt
relay/helper/stream_scanner.go:70
↓ 2 callers
Function
FetchGeminiModels
(baseURL, apiKey, proxyURL string)
relay/channel/gemini/relay-gemini.go:481
↓ 2 callers
Function
FetchOllamaModels
(baseURL, apiKey string)
relay/channel/ollama/relay-ollama.go:281
↓ 2 callers
Method
FetchTask
(baseURL string, key string, body map[string]any, proxy string)
service/task_polling.go:29
↓ 2 callers
Function
FindEarliestPendingSystemTasks
(taskTypes []string)
model/system_task.go:158
↓ 2 callers
Function
FixAbility
()
model/ability.go:337
↓ 2 callers
Function
GeminiChatStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini.go:195
↓ 2 callers
Function
GeminiImageHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini.go:422
↓ 2 callers
Function
GeminiResponsesStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay_responses.go:81
↓ 2 callers
Function
GeminiTextGenerationStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini-native.go:81
↓ 2 callers
Function
GenerateBackupCodes
GenerateBackupCodes 生成备用恢复码
common/totp.go:49
↓ 2 callers
Function
GenerateKey
()
common/utils.go:254
↓ 2 callers
Function
GenerateMjOtherInfo
(relayInfo *relaycommon.RelayInfo, priceData types.PriceData)
service/log_info_generate.go:292
↓ 2 callers
Function
GenerateStartEmptyResponse
(id string, createAt int64, model string, systemFingerprint *string)
relay/helper/common.go:184
↓ 2 callers
Function
GenerateTaskID
GenerateTaskID 生成对外暴露的 task_xxxx 格式 ID
model/task.go:140
↓ 2 callers
Function
Get2FAIssuer
Get2FAIssuer 获取2FA发行者名称
common/totp.go:115
↓ 2 callers
Function
GetAllCustomOAuthProviders
GetAllCustomOAuthProviders returns all custom OAuth providers
model/custom_oauth_provider.go:74
↓ 2 callers
Function
GetAllFlowQuotaDates
(c *gin.Context)
controller/usedata.go:88
↓ 2 callers
Function
GetAllUserSubscriptions
GetAllUserSubscriptions returns all subscriptions (active and expired) for a user.
model/subscription.go:873
↓ 2 callers
Function
GetAndValidateClaudeRequest
(c *gin.Context)
relay/helper/valid_request.go:267
↓ 2 callers
Function
GetAndValidateGeminiRequest
(c *gin.Context)
relay/helper/valid_request.go:348
↓ 2 callers
Function
GetAndValidateResponsesRequest
(c *gin.Context)
relay/helper/valid_request.go:131
↓ 2 callers
Function
GetAndValidateTextRequest
(c *gin.Context, relayMode int)
relay/helper/valid_request.go:290
↓ 2 callers
Function
GetAutoGroups
()
setting/auto_group.go:35
↓ 2 callers
Function
GetBase64Data
GetBase64Data 获取 base64 编码的数据
service/file_service.go:418
↓ 2 callers
Method
GetBudgetTokens
()
dto/claude.go:458
↓ 2 callers
Function
GetByOnlyMJId
(mjId string)
model/midjourney.go:117
↓ 2 callers
Function
GetCacheRatio
GetCacheRatio returns the cache ratio for a model
setting/ratio_setting/cache_ratio.go:159
↓ 2 callers
Method
GetChannelName
()
relay/channel/adapter.go:29
↓ 2 callers
Function
GetChannelsByIds
(ids []int)
model/channel.go:1034
↓ 2 callers
Function
GetChannelsByTag
(tag string, idSort bool, selectAll bool, sortOptions ...ChannelSortOptions)
model/channel.go:368
↓ 2 callers
Method
GetClaudeError
GetClaudeError 从动态错误类型中提取ClaudeError结构
dto/claude.go:522
↓ 2 callers
Method
GetContainerLogsRaw
GetContainerLogsRaw retrieves the raw text logs for a specific container
pkg/ionet/container.go:152
↓ 2 callers
Function
GetContextKey
(c *gin.Context, key constant.ContextKey)
common/gin.go:161
↓ 2 callers
Function
GetContextKeyInt
(c *gin.Context, key constant.ContextKey)
common/gin.go:169
↓ 2 callers
Function
GetCreateCacheRatio
(name string)
setting/ratio_setting/cache_ratio.go:167
↓ 2 callers
Function
GetDiskCacheMaxSizeBytes
GetDiskCacheMaxSizeBytes 获取磁盘缓存最大大小(字节)
common/disk_cache_config.go:58
↓ 2 callers
Function
GetDiskCacheStats
GetDiskCacheStats 获取缓存统计信息
common/disk_cache_config.go:94
↓ 2 callers
Function
GetDiskSpaceInfo
GetDiskSpaceInfo 获取缓存目录所在磁盘的空间信息 (Windows)
common/system_monitor_windows.go:12
↓ 2 callers
Function
GetEnabledModels
()
model/ability.go:50
↓ 2 callers
Method
GetErrorType
()
types/error.go:116
↓ 2 callers
Function
GetExposedData
()
setting/ratio_setting/exposed_cache.go:35
↓ 2 callers
Method
GetFile
()
dto/openai_request.go:344
↓ 2 callers
Function
GetGPTImage1PriceOnceCall
(quality string, size string)
setting/operation_setting/tools.go:163
↓ 2 callers
Function
GetGeminiSafetySetting
GetGeminiSafetySetting 获取安全设置
setting/model_setting/gemini.go:54
↓ 2 callers
Function
GetGroupEnabledModels
(group string)
model/ability.go:43
↓ 2 callers
Method
GetHeaderOverride
()
model/channel.go:1023
↓ 2 callers
Function
GetImageRatio
(name string)
setting/ratio_setting/model_ratio.go:670
↓ 2 callers
Method
GetInputAudio
()
dto/openai_request.go:328
↓ 2 callers
Function
GetLatestSystemTasks
(taskTypes []string)
model/system_task.go:205
↓ 2 callers
Method
GetMaxGPUsPerContainer
GetMaxGPUsPerContainer retrieves the maximum number of GPUs available per hardware type
pkg/ionet/hardware.go:59
↓ 2 callers
Function
GetMaxUserId
()
model/user.go:283
↓ 2 callers
Function
GetMaxUserTokens
GetMaxUserTokens 获取每用户最大令牌数量
setting/operation_setting/token_setting.go:26
↓ 2 callers
Method
GetModelLimitsMap
()
model/token.go:350
↓ 2 callers
Function
GetModelSupportEndpointTypes
(model string)
model/pricing.go:98
↓ 2 callers
Method
GetOpenAIError
GetOpenAIError 从动态错误类型中提取OpenAIError结构
dto/openai_response.go:319
↓ 2 callers
Method
GetOtherInfo
()
model/channel.go:307
↓ 2 callers
Function
GetPaginatedChannelTags
(query *gorm.DB, offset int, limit int)
model/channel.go:884
↓ 2 callers
Function
GetPreferredModelOwnerChannelTypes
(modelNames []string, groups []string)
model/model_meta.go:155
↓ 2 callers
Method
GetPriority
()
model/channel.go:477
↓ 2 callers
Method
GetProviderId
GetProviderId returns the provider ID for binding purposes
oauth/generic.go:316
↓ 2 callers
Method
GetQuality
()
dto/openai_response.go:335
↓ 2 callers
Function
GetRandomInt
(max int)
common/utils.go:259
↓ 2 callers
Function
GetRedemptionById
(id int)
model/redemption.go:127
↓ 2 callers
Function
GetRequestURL
(info *relaycommon.RelayInfo)
relay/channel/minimax/relay-minimax.go:12
↓ 2 callers
Function
GetSetting
()
setting/perf_metrics_setting/config.go:23
↓ 2 callers
Method
GetSize
()
dto/openai_response.go:347
↓ 2 callers
Method
GetStringContent
()
dto/claude.go:135
↓ 2 callers
Method
GetSystemFingerprint
()
dto/openai_response.go:200
↓ 2 callers
Function
GetUserFlowQuotaDates
(c *gin.Context)
controller/usedata.go:107
↓ 2 callers
Function
GetUserIdByAffCode
(affCode string)
model/user.go:405
↓ 2 callers
Method
GetUserInfo
GetUserInfo retrieves user information using the access token
oauth/provider.go:23
↓ 2 callers
Function
GetUserUsedQuota
(id int)
model/user.go:977
↓ 2 callers
Function
GetVendorModelCounts
()
model/model_meta.go:89
↓ 2 callers
Function
GetVendors
GetVendors 返回当前定价接口使用到的供应商信息
model/pricing.go:90
↓ 2 callers
Method
GetVideoUrl
()
dto/openai_request.go:361
↓ 2 callers
Function
GetWaffoPayMethods
GetWaffoPayMethods 从 options 读取 Waffo 支付方式配置
setting/payment_waffo.go:27
↓ 2 callers
Function
GlobalAPIRateLimit
()
middleware/rate-limit.go:97
↓ 2 callers
Function
HandleClaudeResponseData
(c *gin.Context, info *relaycommon.RelayInfo, claudeInfo *ClaudeResponseInfo, httpResp *http.Response, data []
relay/channel/claude/relay-claude.go:197
↓ 2 callers
Function
HandleFinalResponse
(c *gin.Context, info *relaycommon.RelayInfo, lastStreamData string, responseId string, createAt int64, model
relay/channel/openai/helper.go:162
↓ 2 callers
Function
HandleStreamFinalResponse
(c *gin.Context, info *relaycommon.RelayInfo, claudeInfo *ClaudeResponseInfo)
relay/channel/claude/relay-claude.go:133
← previous
next →
1,301–1,400 of 10,602, ranked by callers