Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
9,514 in github.com/QuantumNous/new-api
⨍
Functions
9,514
◇
Types & classes
1,507
↓ 3 callers
Function
ConvertRequestVia
(c context.Context, info convmeta.Meta, request any, path ...types.RelayFormat)
relaykit/relayconvert/request_registry.go:174
↓ 3 callers
Method
ConvertRerankRequest
(c *gin.Context, relayMode int, request dto.RerankRequest)
relay/channel/adapter.go:22
↓ 3 callers
Function
CountUserSessionsCreatedSince
CountUserSessionsCreatedSince counts every issued row, regardless of its current status or expiry. userID zero selects the global count.
model/user_session.go:185
↓ 3 callers
Function
CountUserTokens
CountUserTokens returns total number of tokens for the given user, used for pagination
model/token.go:466
↓ 3 callers
Function
CreateBodyStorage
CreateBodyStorage 根据数据大小创建合适的存储
common/body_storage.go:241
↓ 3 callers
Function
CreateDiskCacheFile
CreateDiskCacheFile 创建磁盘缓存文件 cacheType: 缓存类型(body/file) 返回文件路径和文件句柄
common/disk_cache.go:42
↓ 3 callers
Function
CreatePendingTwoFASetupBackupCodes
CreatePendingTwoFASetupBackupCodes stores recovery codes for an unverified setup. Regeneration for an enabled factor must advance auth_version.
model/twofa.go:189
↓ 3 callers
Function
DeletePasskeyByUserIDWithAuthVersion
(userID int)
model/passkey.go:218
↓ 3 callers
Function
DisableTwoFAWithAuthVersion
DisableTwoFAWithAuthVersion atomically removes the factor and invalidates every access token issued against the previous security configuration.
model/twofa.go:279
↓ 3 callers
Function
Distribute
()
middleware/distributor.go:33
↓ 3 callers
Function
DoMidjourneyHttpRequest
(c *gin.Context, timeout time.Duration, fullRequestURL string)
service/midjourney.go:165
↓ 3 callers
Function
EmailVerificationRateLimit
()
middleware/email-verification-rate-limit.go:61
↓ 3 callers
Function
EncodeLocalTaskID
EncodeLocalTaskID encodes an upstream operation name to a URL-safe base64 string. Used by Gemini/Vertex to store upstream names as task IDs.
relay/channel/task/taskcommon/helpers.go:50
↓ 3 callers
Function
EnqueueSystemTask
EnqueueSystemTask creates an on-demand task of the given type. The returned bool is true only when a new pending row was created; false means an activ
service/system_task.go:201
↓ 3 callers
Function
EnsureEmailAvailable
(email string, excludeUserID int)
model/user.go:301
↓ 3 callers
Function
ExpireSubscriptionOrder
(tradeNo string, expectedPaymentProvider string)
model/subscription.go:679
↓ 3 callers
Function
ExtractOutputTextFromResponses
(resp *dto.OpenAIResponsesResponse)
service/openai_chat_responses_compat.go:28
↓ 3 callers
Function
FetchModels
(c *gin.Context)
controller/channel.go:1274
↓ 3 callers
Method
FetchTask
── Polling ──────────────────────────────────────────────────────
relay/channel/adapter.go:78
↓ 3 callers
Function
GeminiResponsesHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay_responses.go:21
↓ 3 callers
Function
GenerateSystemTaskID
()
model/system_task.go:84
↓ 3 callers
Function
GenerateVerificationCode
(length int)
common/verification.go:26
↓ 3 callers
Function
GetAllChannels
(startIdx int, num int, selectAll bool, idSort bool, sortOptions ...ChannelSortOptions)
model/channel.go:356
↓ 3 callers
Function
GetAndValidOpenAIImageRequest
(c *gin.Context, relayMode int)
relay/helper/valid_request.go:182
↓ 3 callers
Method
GetAutoGroups
()
model/token.go:35
↓ 3 callers
Function
GetBase64Data
GetBase64Data 获取 base64 编码的数据
service/file_service.go:418
↓ 3 callers
Method
GetBase64Data
()
relaykit/types/file_source.go:180
↓ 3 callers
Function
GetBillingExpr
(model string)
setting/billing_setting/tiered_billing.go:45
↓ 3 callers
Function
GetBillingMode
--------------------------------------------------------------------------- Read accessors (hot path, must be fast) ----------------------------------
setting/billing_setting/tiered_billing.go:38
↓ 3 callers
Function
GetByMJId
(userId int, mjId string)
model/midjourney.go:127
↓ 3 callers
Method
GetCache
()
relaykit/types/file_source.go:20
↓ 3 callers
Function
GetCallbackAddress
()
service/epay.go:8
↓ 3 callers
Function
GetChannelPollingLock
GetChannelPollingLock returns or creates a mutex for the given channel ID
model/channel.go:617
↓ 3 callers
Method
GetChannelType
()
relaykit/relayconvert/convmeta/meta.go:25
↓ 3 callers
Function
GetClaudeSettings
GetClaudeSettings 获取Claude配置
setting/model_setting/claude.go:45
↓ 3 callers
Function
GetEffectiveHeaderOverride
(info *RelayInfo)
relay/common/override.go:431
↓ 3 callers
Function
GetEnvOrDefaultBool
(env string, defaultValue bool)
common/env.go:28
↓ 3 callers
Function
GetFlowQuotaData
(startTime int64, endTime int64, username string, userID int, role int)
model/usedata_flow.go:25
↓ 3 callers
Method
GetFullKey
()
model/token.go:76
↓ 3 callers
Function
GetGeminiVersionSetting
GetGeminiVersionSetting 获取版本设置
setting/model_setting/gemini.go:103
↓ 3 callers
Method
GetIsStream
()
relaykit/relayconvert/convmeta/meta.go:26
↓ 3 callers
Function
GetLatestSystemTask
GetLatestSystemTask returns the most recent task row of the given type (any status) so the scheduler can decide whether enough time has elapsed since
model/system_task.go:193
↓ 3 callers
Function
GetLegalSettings
()
setting/system_setting/legal.go:19
↓ 3 callers
Function
GetMimeTypeByExtension
(ext string)
service/file_decoder.go:159
↓ 3 callers
Function
GetMissingModels
GetMissingModels returns model names that are referenced in the system
model/missing_models.go:4
↓ 3 callers
Method
GetName
GetName returns the display name of the provider (e.g., "GitHub", "Discord")
oauth/provider.go:13
↓ 3 callers
Method
GetOpenAIError
GetOpenAIError 从动态错误类型中提取OpenAIError结构
relaykit/dto/openai_response.go:51
↓ 3 callers
Method
GetOriginModelName
()
relaykit/relayconvert/convmeta/meta.go:19
↓ 3 callers
Function
GetPerformanceMonitorConfig
GetPerformanceMonitorConfig 获取性能监控配置
common/performance_config.go:26
↓ 3 callers
Function
GetPreferredChannelByAffinity
(c *gin.Context, modelName string, usingGroup string)
service/channel_affinity.go:550
↓ 3 callers
Function
GetQuotaSetting
()
setting/operation_setting/quota_setting.go:19
↓ 3 callers
Method
GetRawData
()
relaykit/types/file_source.go:16
↓ 3 callers
Method
GetRequestURL
(info *relaycommon.RelayInfo)
relay/channel/adapter.go:19
↓ 3 callers
Method
GetRetry
()
service/channel_select.go:22
↓ 3 callers
Method
GetSendResponseCount
GetSendResponseCount / IncrSendResponseCount expose the shared downstream-chunk counter (the host may also increment it).
relaykit/relayconvert/convmeta/meta.go:41
↓ 3 callers
Method
GetStringSystem
()
relaykit/dto/claude.go:469
↓ 3 callers
Function
GetSubscriptionOrderByTradeNo
(tradeNo string)
model/subscription.go:241
↓ 3 callers
Method
GetSystemRoleName
()
relaykit/dto/openai_request.go:242
↓ 3 callers
Function
GetSystemStatus
GetSystemStatus 获取当前系统状态
common/system_monitor.go:79
↓ 3 callers
Method
GetTag
()
model/channel.go:327
↓ 3 callers
Function
GetUniqueUserByEmail
(email string)
model/user.go:1033
↓ 3 callers
Method
GetWeight
()
model/channel.go:490
↓ 3 callers
Function
HandleClaudeResponseData
(c *gin.Context, info *relaycommon.RelayInfo, claudeInfo *ClaudeResponseInfo, httpResp *http.Response, data []
relay/channel/claude/relay-claude.go:217
↓ 3 callers
Function
HandleGroupRatio
HandleGroupRatio checks for "auto_group" in the context and updates the group ratio and relayInfo.UsingGroup if present
relay/helper/price.go:45
↓ 3 callers
Function
HardDeleteUserById
(id int)
model/user.go:484
↓ 3 callers
Method
HasImage
()
relay/common/relay_utils.go:23
↓ 3 callers
Method
IncrSendResponseCount
()
relaykit/relayconvert/convmeta/meta.go:42
↓ 3 callers
Method
IncreaseRetry
()
service/channel_select.go:33
↓ 3 callers
Method
IncrementFailedAttempts
IncrementFailedAttempts 增加失败尝试次数
model/twofa.go:132
↓ 3 callers
Method
Insert
Insert 创建新的供应商记录
model/vendor_meta.go:27
↓ 3 callers
Method
Insert
()
model/token.go:311
↓ 3 callers
Function
Interface2String
(inter interface{})
common/utils.go:191
↓ 3 callers
Function
InvalidateProxyClient
InvalidateProxyClient removes every cached policy variant for one proxy and closes their idle connections (including all HTTP/2 shards).
service/http_client.go:411
↓ 3 callers
Function
IsAlwaysSkipRetryStatusCode
(code int)
setting/operation_setting/status_code_ranges.go:70
↓ 3 callers
Function
IsDiskCacheAvailable
IsDiskCacheAvailable 检查是否可以创建新的磁盘缓存
common/disk_cache_config.go:170
↓ 3 callers
Method
IsLocked
IsLocked 检查账户是否被锁定
model/twofa.go:180
↓ 3 callers
Function
IsOpenAIReasoningOModel
(modelName string)
relaykit/dto/openai_request.go:224
↓ 3 callers
Function
IsRequestBodyTooLargeError
(err error)
common/gin.go:25
↓ 3 callers
Function
IsSkipRetryError
(err *NewAPIError)
relaykit/types/error.go:373
↓ 3 callers
Method
IsStream
(c *http.Request)
relaykit/dto/request_common.go:10
↓ 3 callers
Function
IsUserSelectableGroup
(userGroup, groupName string)
service/group.go:48
↓ 3 callers
Method
Items
()
types/set.go:30
↓ 3 callers
Function
ListActiveUserSessions
(userID int, currentSID string, now int64)
model/user_session.go:395
↓ 3 callers
Function
LoadFromJsonString
(m *RWMap[K, V], jsonStr string)
types/rw_map.go:76
↓ 3 callers
Function
LocalLogPreview
LocalLogPreview limits log-only content unless debug logging is enabled.
common/str.go:18
↓ 3 callers
Function
LogError
(message string)
relaykit/relayconvert/kitutil/log.go:45
↓ 3 callers
Function
LogJson
LogJson 仅供测试使用 only for test
logger/logger.go:176
↓ 3 callers
Function
LogQuotaData
(params QuotaDataLogParams)
model/usedata.go:78
↓ 3 callers
Function
LookupRequestConverter
(converter string)
relaykit/relayconvert/request_registry.go:140
↓ 3 callers
Method
ModelListRoute
ModelListRoute returns the explicitly configured OpenAI Models discovery route. Template routes that merely happen to match /v1/models are not discove
relaykit/dto/channel_settings.go:184
↓ 3 callers
Function
ModelPriceHelperPerCall
ModelPriceHelperPerCall 按次/按量计费的 PriceHelper (MJ、Task)
relay/helper/price.go:187
↓ 3 callers
Function
NewChannelError
(channelId int, channelType int, channelName string, isMultiKey bool, usingKey string, autoBan bool)
relaykit/types/channel_error.go:12
↓ 3 callers
Function
NewChannelSortOptions
(sortBy string, sortOrder string, idSort bool)
model/channel.go:87
↓ 3 callers
Function
NewRequestId
()
common/utils.go:281
↓ 3 callers
Function
NewSSRFProtectionFromFetchSetting
NewSSRFProtectionFromFetchSetting builds an SSRFProtection from persisted fetch_setting values.
common/ssrf_protection.go:33
↓ 3 callers
Function
NewURLFileSource
--------------------------------------------------------------------------- Constructors -------------------------------------------------------------
relaykit/types/file_source.go:123
↓ 3 callers
Method
NormalizeDefaults
()
model/subscription.go:204
↓ 3 callers
Function
NormalizeHTTPTransportPolicy
NormalizeHTTPTransportPolicy converts channel settings into a safe runtime policy. Invalid stored values never panic; they clamp to defaults and warn
service/http_transport_policy.go:31
↓ 3 callers
Function
NormalizeOrigin
NormalizeOrigin validates and canonicalizes a browser origin. Only an exact scheme/host/effective-port match is meaningful; paths and wildcards are no
common/session_cookie.go:14
↓ 3 callers
Function
NotifyRootUser
(t string, subject string, content string)
service/user_notify.go:16
← previous
next →
901–1,000 of 9,514, ranked by callers