Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
9,195 in github.com/QuantumNous/new-api
⨍
Functions
9,195
◇
Types & classes
1,481
↓ 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
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:209
↓ 2 callers
Function
GeminiImageHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini.go:437
↓ 2 callers
Function
GeminiResponsesStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay_responses.go:82
↓ 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
GenerateOAuthCode
GenerateOAuthCode generates a state code for OAuth CSRF protection
controller/oauth.go:38
↓ 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:144
↓ 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:888
↓ 2 callers
Function
GetAllUsers
(pageInfo *common.PageInfo, sortOptions ...UserSortOptions)
model/user.go:349
↓ 2 callers
Function
GetAndValidateClaudeRequest
(c *gin.Context)
relay/helper/valid_request.go:289
↓ 2 callers
Function
GetAndValidateGeminiRequest
(c *gin.Context)
relay/helper/valid_request.go:370
↓ 2 callers
Function
GetAndValidateResponsesRequest
(c *gin.Context)
relay/helper/valid_request.go:133
↓ 2 callers
Function
GetAndValidateTextRequest
(c *gin.Context, relayMode int)
relay/helper/valid_request.go:312
↓ 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:1048
↓ 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
GetGeminiSafetySetting
GetGeminiSafetySetting 获取安全设置
setting/model_setting/gemini.go:56
↓ 2 callers
Function
GetGroupRatioSetting
()
setting/ratio_setting/group_ratio.go:54
↓ 2 callers
Function
GetGroupsEnabledModels
GetGroupsEnabledModels 按 groups 顺序获取各分组启用的模型并去重
service/group.go:58
↓ 2 callers
Method
GetHeaderOverride
()
model/channel.go:1037
↓ 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:343
↓ 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:890
↓ 2 callers
Function
GetPreferredModelOwnerChannelTypes
(modelNames []string, groups []string)
model/model_meta.go:155
↓ 2 callers
Method
GetPriority
()
model/channel.go:483
↓ 2 callers
Function
GetProvider
GetProvider returns the OAuth provider for the given name
oauth/registry.go:42
↓ 2 callers
Method
GetProviderId
GetProviderId returns the provider ID for binding purposes
oauth/generic.go:316
↓ 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
GetStringContent
()
dto/claude.go:135
↓ 2 callers
Method
GetSystemFingerprint
()
dto/openai_response.go:200
↓ 2 callers
Function
GetUnusedBackupCodeCount
GetUnusedBackupCodeCount 获取未使用的备用码数量
model/twofa.go:271
↓ 2 callers
Function
GetUserFlowQuotaDates
(c *gin.Context)
controller/usedata.go:107
↓ 2 callers
Function
GetUserIdByAffCode
(affCode string)
model/user.go:467
↓ 2 callers
Method
GetUserInfo
GetUserInfo retrieves user information using the access token
oauth/provider.go:23
↓ 2 callers
Function
GetUserModels
(c *gin.Context)
controller/user.go:638
↓ 2 callers
Function
GetUserUsedQuota
(id int)
model/user.go:1156
↓ 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:167
↓ 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:153
↓ 2 callers
Function
HandleStreamFormat
辅助函数
relay/channel/openai/helper.go:23
↓ 2 callers
Function
HandleStreamResponseData
(c *gin.Context, info *relaycommon.RelayInfo, claudeInfo *ClaudeResponseInfo, data string)
relay/channel/claude/relay-claude.go:86
↓ 2 callers
Function
HasCSAMViolationMarker
(err *types.NewAPIError)
service/violation_fee.go:30
↓ 2 callers
Method
HasCache
()
types/file_source.go:21
↓ 2 callers
Function
HasCheckedInToday
HasCheckedInToday 检查用户今天是否已签到
model/checkin.go:43
↓ 2 callers
Function
HasModelBillingConfig
(modelName string)
relay/helper/price.go:254
↓ 2 callers
Method
IncreaseRetry
()
service/channel_select.go:34
↓ 2 callers
Function
InitDB
()
model/main.go:181
↓ 2 callers
Function
InitializeUserAuthVersions
InitializeUserAuthVersions must run after AutoMigrate when upgrading an existing database. It is idempotent and portable across all supported DBs.
model/user_auth_cache.go:239
↓ 2 callers
Function
InputItems
(raw []byte)
service/relayconvert/internal/oai_responses/req_helpers.go:57
↓ 2 callers
Method
Insert
()
model/midjourney.go:161
↓ 2 callers
Method
Insert
()
model/model_meta.go:47
↓ 2 callers
Method
Insert
()
model/task.go:366
↓ 2 callers
Method
Insert
()
model/token.go:286
↓ 2 callers
Method
InsertWithTx
InsertWithTx inserts a new user within an existing transaction. This is used for OAuth registration where user creation and binding need to be atomic.
model/user.go:656
↓ 2 callers
Function
InvalidateCache
InvalidateCache clears the compiled-expression cache. Called when billing rules are updated.
pkg/billingexpr/compile.go:171
↓ 2 callers
Function
InvalidateProxyClient
InvalidateProxyClient removes one proxy client and closes its idle connections.
service/http_client.go:285
↓ 2 callers
Function
IsAdmin
(userId int)
model/user.go:1099
↓ 2 callers
Function
IsAdvancedCustomConverterAllowed
(converter string)
dto/channel_settings.go:305
← previous
next →
1,301–1,400 of 9,195, ranked by callers