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
↓ 4 callers
Function
GetDiskCacheThresholdBytes
GetDiskCacheThresholdBytes 获取磁盘缓存阈值(字节)
common/disk_cache_config.go:51
↓ 4 callers
Method
GetEffectiveDisplayName
GetEffectiveDisplayName returns the admin-configured display name, or the literal "OIDC" when none has been set. Centralizing this fallback keeps the
setting/system_setting/oidc.go:36
↓ 4 callers
Function
GetGroupRatio
(name string)
setting/ratio_setting/group_ratio.go:79
↓ 4 callers
Function
GetImageFromUrl
GetImageFromUrl 获取图片的类型和base64编码的数据
service/image.go:69
↓ 4 callers
Function
GetOpenAIError
GetOpenAIError 从动态错误类型中提取OpenAIError结构
relaykit/dto/openai_response.go:401
↓ 4 callers
Method
GetOpenAIError
GetOpenAIError 从动态错误类型中提取OpenAIError结构
relaykit/dto/openai_response.go:21
↓ 4 callers
Method
GetSetting
()
model/user_cache.go:38
↓ 4 callers
Method
GetText
()
relaykit/dto/claude.go:42
↓ 4 callers
Function
GetTimestamp
()
relaykit/relayconvert/kitutil/value.go:50
↓ 4 callers
Function
GetTokenByIds
(id int, userId int)
model/token.go:260
↓ 4 callers
Function
GetUserAutoGroup
GetUserAutoGroup 根据用户分组获取自动分组设置
service/group.go:56
↓ 4 callers
Function
GetUserSetting
GetUserSetting gets setting from Redis first, falls back to DB if needed
model/user.go:1195
↓ 4 callers
Method
HasOtherRatio
(key string)
types/price_data.go:53
↓ 4 callers
Function
IncrementDiskFiles
IncrementDiskFiles 增加磁盘文件计数
common/disk_cache_config.go:109
↓ 4 callers
Method
Info
(context.Context, string, ...any)
model/user_session_migration_test.go:37
↓ 4 callers
Function
InitializeExternalIdentityClaims
InitializeExternalIdentityClaims imports legacy Telegram bindings after the claim table is migrated. Existing duplicate ownership fails migration rath
model/external_identity_claim.go:89
↓ 4 callers
Function
InjectTieredBillingInfo
InjectTieredBillingInfo overlays tiered billing fields onto an existing module-specific other map. Call this after GenerateTextOtherInfo / GenerateCla
service/log_info_generate.go:307
↓ 4 callers
Method
Insert
(inviterId int)
model/user.go:591
↓ 4 callers
Function
InvalidateSubscriptionPlanCache
(planId int)
model/subscription.go:135
↓ 4 callers
Function
IsDiskCacheEnabled
IsDiskCacheEnabled 是否启用磁盘缓存
common/disk_cache_config.go:44
↓ 4 callers
Function
IsQwenThinkingBudgetModel
(modelName string)
relaykit/dto/openai_request.go:234
↓ 4 callers
Method
IsStringSystem
()
relaykit/dto/claude.go:464
↓ 4 callers
Method
IsSuccess
()
dto/task.go:28
↓ 4 callers
Function
LookupResponseConverter
(converter string)
relaykit/relayconvert/response_registry.go:194
↓ 4 callers
Function
MaskSensitiveInfo
MaskSensitiveInfo masks sensitive information like URLs, IPs, and domain names in a string Example: http://example.com -> http://***.com https://api.t
relaykit/relayconvert/kitutil/mask.go:68
↓ 4 callers
Function
NewEstimatedGeminiChatBillingUsage
(usage *Usage)
relaykit/dto/billing_usage.go:110
↓ 4 callers
Function
NewNotify
(t string, title string, content string, values []interface{})
relaykit/dto/notify.go:18
↓ 4 callers
Function
NewSystemTaskProgressReporter
NewSystemTaskProgressReporter returns a throttled progress callback bound to a running task. Handlers call it with (processed, total) as they iterate
service/system_task.go:478
↓ 4 callers
Function
NormalizeResetPeriod
(period string)
model/subscription.go:335
↓ 4 callers
Function
NotifyUser
(userId int, userEmail string, userSetting dto.UserSetting, data dto.Notify)
service/user_notify.go:50
↓ 4 callers
Method
Observe
Observe records one completed final image output when billable. outputIndex may be nil; when set and nonnegative it participates in dedup.
relay/common/tool_usage.go:86
↓ 4 callers
Function
ObserveChannelAffinityUsageCacheByRelayFormat
ObserveChannelAffinityUsageCacheByRelayFormat records usage cache stats with a stable rate mode derived from relay format.
service/channel_affinity.go:778
↓ 4 callers
Function
OpenAIChatRequestToClaudeMessages
(c context.Context, info convmeta.Meta, textRequest dto.GeneralOpenAIRequest)
relaykit/relayconvert/request_compat.go:18
↓ 4 callers
Method
OtherRatioMultiplier
()
types/price_data.go:74
↓ 4 callers
Function
ParseDashboardAccessToken
ParseDashboardAccessToken distinguishes new-api dashboard JWTs from opaque credentials. A token carrying the dashboard issuer, audience and a known to
service/auth_token.go:107
↓ 4 callers
Method
ParseInput
()
relaykit/dto/embedding.go:57
↓ 4 callers
Function
QuotaRoundChecked
QuotaRoundChecked is QuotaRound but also returns a non-nil *QuotaClamp when the value was clamped, so billing callers can audit it.
common/quota_math.go:126
↓ 4 callers
Function
RefreshUserGroupCache
RefreshUserGroupCache writes the database-authoritative group into an existing user hash without changing the user's authentication version.
model/user_cache.go:217
↓ 4 callers
Method
ReplaceOtherRatios
(ratios map[string]float64)
types/price_data.go:45
↓ 4 callers
Method
Request
Request parameter duration's unit is seconds
common/rate-limit.go:45
↓ 4 callers
Function
ResetUserPasswordByEmail
(email string, password string)
model/user.go:1072
↓ 4 callers
Function
ResponsesResponseToChatCompletionsResponse
(resp *dto.OpenAIResponsesResponse, id string)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp.go:58
↓ 4 callers
Function
RouteTag
(tag string)
middleware/logger.go:12
↓ 4 callers
Function
SessionCookieOriginGuard
SessionCookieOriginGuard protects cookie-authenticated refresh/logout endpoints when secure cookie mode is enabled. In insecure local development mode
middleware/auth_origin.go:18
↓ 4 callers
Method
SetFirstResponseTime
()
relay/common/relay_info.go:812
↓ 4 callers
Method
SetIndex
set index
relaykit/dto/claude.go:508
↓ 4 callers
Function
SetLogDatabaseType
(databaseType DatabaseType)
common/database.go:27
↓ 4 callers
Method
SetMediaContent
(content []MediaContent)
relaykit/dto/openai_request.go:530
↓ 4 callers
Method
SetStringContent
(content string)
relaykit/dto/claude.go:160
↓ 4 callers
Method
SetUsage
(usage *dto.Usage)
relaykit/relayconvert/response_registry.go:390
↓ 4 callers
Function
SettleBilling
--------------------------------------------------------------------------- SettleBilling — 后结算辅助函数 --------------------------------------------------
service/billing.go:51
↓ 4 callers
Function
SetupContextForSelectedChannel
(c *gin.Context, channel *model.Channel, modelName string)
middleware/distributor.go:444
↓ 4 callers
Function
ShouldCopyUpstreamHeader
ShouldCopyUpstreamHeader checks whether a given upstream response header should be copied to the client response. It returns false for Content-Length
service/http.go:31
↓ 4 callers
Function
ShouldSkipRetryAfterChannelAffinityFailure
(c *gin.Context)
service/channel_affinity.go:626
↓ 4 callers
Method
Snapshot
()
model/task.go:392
↓ 4 callers
Method
SupportedEndpointTypesForModel
(model string)
relaykit/dto/channel_settings.go:208
↓ 4 callers
Function
TaskModel2Dto
(task *model.Task)
relay/relay_task.go:550
↓ 4 callers
Method
ToFileSource
()
relaykit/dto/gemini.go:210
↓ 4 callers
Function
TryUserAuth
()
middleware/auth.go:78
↓ 4 callers
Function
UpdateSystemTaskState
(taskID string, lockedBy string, state any)
model/system_task.go:309
↓ 4 callers
Function
UpdateUserSetting
(userId int, setting dto.UserSetting)
model/user.go:162
↓ 4 callers
Method
UpdateWithTx
(tx *gorm.DB, updatePassword bool)
model/user.go:725
↓ 4 callers
Function
ValidUsage
(usage *dto.Usage)
service/usage_helpr.go:31
↓ 4 callers
Function
ValidateNumericCode
ValidateNumericCode 验证数字验证码格式
common/totp.go:128
↓ 4 callers
Function
ValidatePasswordAndHash
(password string, hash string)
common/crypto.go:29
↓ 4 callers
Method
ValidateSettings
()
model/channel.go:946
↓ 4 callers
Method
ValidateTOTPAndUpdateUsage
ValidateTOTPAndUpdateUsage 验证TOTP并更新使用记录
model/twofa.go:337
↓ 4 callers
Function
WaffoPancakeBuyerIdentityFromUserID
WaffoPancakeBuyerIdentityFromUserID renders the canonical buyer identity for checkout. Webhook handlers compare against the value rendered here to rej
service/waffo_pancake.go:158
↓ 4 callers
Method
WriteContext
(c *gin.Context)
model/user_cache.go:29
↓ 4 callers
Function
applyRechargeRate
* Apply recharge rate to price * * priceRate represents how much users need to recharge (in the display currency) * to get 1 USD credit. usdExchang
web/src/features/pricing/lib/price.ts:131
↓ 4 callers
Function
baseAutoTokenRequest
(name string)
controller/token_auto_groups_test.go:56
↓ 4 callers
Function
bucketStart
(ts int64)
pkg/perf_metrics/metrics.go:266
↓ 4 callers
Function
buildClaudeUsageFromOpenAIUsage
(oaiUsage *dto.Usage)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_resp.go:38
↓ 4 callers
Function
buildDefaultDashboardFilters
( preferences: DashboardChartPreferences = getSavedChartPreferences() )
web/src/features/dashboard/lib/filters.ts:143
↓ 4 callers
Function
buildMaskedTokenResponse
(token *model.Token)
controller/token.go:44
↓ 4 callers
Function
cacheDeleteToken
(key string)
model/token_cache.go:21
↓ 4 callers
Function
calcNextResetTime
(base time.Time, plan *SubscriptionPlan, endUnix int64)
model/subscription.go:344
↓ 4 callers
Function
callback
(authorization: unknown)
web/src/features/auth/components/telegram-login-dialog.tsx:56
↓ 4 callers
Function
cleanupAuthArtifacts
()
service/auth_cleanup.go:29
↓ 4 callers
Function
clearAuthenticatedClientState
( queryClient: QueryClient, synchronizeTabs = true )
web/src/lib/auth-session.ts:197
↓ 4 callers
Function
clearChannelInfo
(channel *model.Channel)
controller/channel.go:67
↓ 4 callers
Function
clickHouseLogOrder
(prefix string)
model/log.go:106
↓ 4 callers
Function
clientCacheKey
(proxyCacheKey string, policy HTTPTransportPolicy)
service/http_client.go:112
↓ 4 callers
Function
composeTieredTextQuota
(relayInfo *relaycommon.RelayInfo, summary textQuotaSummary, tieredQuota int, tieredResult *billingexpr.Tiered
service/text_quota.go:203
↓ 4 callers
Function
confirmUserSessionActiveSnapshot
(session *UserSession)
model/user_session.go:358
↓ 4 callers
Method
convertOpenAICompatibleRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/advancedcustom/adaptor.go:520
↓ 4 callers
Function
createTaskError
(err error, code string, statusCode int, localError bool)
relay/common/relay_utils.go:110
↓ 4 callers
Function
decodeDataWithFlexibleTimes
(data []byte, target *T)
pkg/ionet/jsonutil.go:39
↓ 4 callers
Function
decodeImageConfig
decodeImageConfig 从字节数据解码图片配置
service/file_service.go:465
↓ 4 callers
Function
detectHEIF
detectHEIF checks ISOBMFF magic bytes to detect HEIC/HEIF files. Returns "image/heic", "image/heif", or "" if not recognized.
service/file_service.go:496
↓ 4 callers
Function
doRequest
(c *gin.Context, req *http.Request, info *common.RelayInfo)
relay/channel/api_request.go:477
↓ 4 callers
Function
drainClose
(t *testing.T, resp *http.Response)
service/http_client_transport_test.go:108
↓ 4 callers
Function
effectiveBillingUsage
(usage *dto.Usage)
service/billing_usage.go:20
↓ 4 callers
Function
exceedsMaxTokensLimit
(values ...*uint)
relay/helper/valid_request.go:124
↓ 4 callers
Function
finalizeMessage
( message: Message, apiReasoningContent?: string )
web/src/features/playground/lib/message/message-streaming-utils.ts:121
↓ 4 callers
Function
finishSystemTaskHandler
(task *model.SystemTask, runnerID string, status model.SystemTaskStatus, result any, runErr error)
controller/system_task_handlers.go:155
↓ 4 callers
Function
flowPathForStages
( row: FlowQuotaDataItem, stages: FlowNodeKind[], ctx: FlowPathContext = EMPTY_FLOW_PATH_CONTEXT )
web/src/features/dashboard/lib/flow.ts:271
↓ 4 callers
Function
formatDateTimeObject
(date: Date)
web/src/lib/time.ts:152
↓ 4 callers
Function
formatLatency
(ms: number)
web/src/features/performance-metrics/lib/format.ts:25
↓ 4 callers
Function
formatThroughput
(tps: number)
web/src/features/performance-metrics/lib/format.ts:19
← previous
next →
701–800 of 9,514, ranked by callers