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
↓ 5 callers
Function
parseOptionalJson
(value: string | undefined)
web/src/features/channels/lib/channel-form.ts:72
↓ 5 callers
Function
parseRatioMap
(value: string)
web/src/features/system-settings/models/group-ratio-visual-editor.tsx:112
↓ 5 callers
Function
parseUsableMap
(value: string)
web/src/features/system-settings/models/group-ratio-visual-editor.tsx:119
↓ 5 callers
Function
preserveToolPrices
(t *testing.T)
setting/operation_setting/tools_price_test.go:11
↓ 5 callers
Function
quotaUnitsToDollars
(units: number)
web/src/lib/format.ts:105
↓ 5 callers
Function
requestClientIP
(router http.Handler, remoteAddr string, forwardedFor string)
trusted_proxies_test.go:13
↓ 5 callers
Function
requireOptionMissing
(t *testing.T, db *gorm.DB, key string)
model/frontend_option_migration_test.go:37
↓ 5 callers
Function
rowMetrics
(row: FlowQuotaDataItem)
web/src/features/dashboard/lib/flow.ts:156
↓ 5 callers
Function
sanitizeAuthRedirect
( value: unknown, origin: string )
web/src/features/auth/lib/auth-redirect.ts:46
↓ 5 callers
Function
sankeyDatumValue
( datum: Record<string, unknown>, key: string )
web/src/features/dashboard/lib/flow.ts:1041
↓ 5 callers
Function
seedPollingTask
(t *testing.T, channelID int, publicID string, upstreamID string)
service/task_polling_test.go:147
↓ 5 callers
Function
seedSubscriptionResetPlan
(t *testing.T, plan *SubscriptionPlan)
model/subscription_reset_test.go:12
↓ 5 callers
Function
seedTaskPollingChannel
(t *testing.T, id int, disableSleep bool)
service/task_polling_test.go:132
↓ 5 callers
Function
seedToken
(t *testing.T, db *gorm.DB, userID int, name string, rawKey string)
controller/token_test.go:163
↓ 5 callers
Function
setupAuthFlowControllerTest
(t *testing.T)
controller/auth_flow_test.go:50
↓ 5 callers
Function
splitBillingExprAndRequestRules
(expr: string)
web/src/features/pricing/lib/billing-expr.ts:533
↓ 5 callers
Function
stringifyAdvancedCustomConfig
( config: AdvancedCustomConfig )
web/src/features/channels/lib/advanced-custom.ts:492
↓ 5 callers
Function
textRegistryChatResponse
()
service/relayconvert/response_registry_test.go:615
↓ 5 callers
Function
toNumberOrNull
(value: unknown)
web/src/features/system-settings/models/model-pricing-core.ts:153
↓ 5 callers
Function
updateChannel
( id: number, data: Partial<Channel> )
web/src/features/channels/api.ts:130
↓ 5 callers
Function
updateUserCache
updateUserCache refreshes non-quota user cache fields. Quota is maintained by atomic quota delta paths and must not be overwritten by stale user snaps
model/user_cache.go:86
↓ 5 callers
Function
useBranch
()
web/src/components/ai-elements/branch.tsx:49
↓ 5 callers
Function
useLogsViewScope
()
web/src/features/usage-logs/components/usage-logs-provider.tsx:94
↓ 5 callers
Function
validateAdvancedCustomConfig
( config: AdvancedCustomConfig | null )
web/src/features/channels/lib/advanced-custom.ts:533
↓ 5 callers
Function
writeUserCache
(user *UserBase, includeQuota bool)
model/user_auth_cache.go:48
↓ 4 callers
Method
AddAll
(other map[K]V)
types/rw_map.go:46
↓ 4 callers
Function
AdminResetUserSubscriptionsByPlan
(userId int, planId int, advanceResetTime bool)
model/subscription.go:1081
↓ 4 callers
Function
ApiSuccessI18n
ApiSuccessI18n returns a translated success message based on the user's language preference
common/gin.go:232
↓ 4 callers
Method
ApplyOtherRatiosToFloat
(value float64)
types/price_data.go:84
↓ 4 callers
Function
CallID
(item map[string]any)
service/relayconvert/internal/oai_responses/to_oai_chat_req.go:495
↓ 4 callers
Function
ClaimExternalAuthAssertion
ClaimExternalAuthAssertion records a signed provider assertion as consumed. The assertion is HMACed before storage and the unique token_hash index mak
model/auth_flow.go:124
↓ 4 callers
Function
CommonClaudeHeadersOperation
(c *gin.Context, req *http.Header, info *relaycommon.RelayInfo)
relay/channel/claude/adaptor.go:74
↓ 4 callers
Method
ConvertImageRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.ImageRequest)
relay/channel/adapter.go:24
↓ 4 callers
Function
ConvertRequestByID
(c *gin.Context, info *relaycommon.RelayInfo, converter string, request any)
service/request_converter.go:24
↓ 4 callers
Function
ConvertStreamResponse
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, response any)
service/relayconvert/response_registry.go:245
↓ 4 callers
Function
CountUserSubscriptionsByPlan
(userId int, planId int)
model/subscription.go:413
↓ 4 callers
Function
CovertMjpActionToModelName
(mjAction string)
service/midjourney.go:22
↓ 4 callers
Function
CreateUserSubscriptionFromPlanTx
(tx *gorm.DB, userId int, plan *SubscriptionPlan, source string)
model/subscription.go:484
↓ 4 callers
Function
DecodeLocalTaskID
DecodeLocalTaskID decodes a base64-encoded upstream operation name.
relay/channel/task/taskcommon/helpers.go:55
↓ 4 callers
Method
DecodePayload
(v any)
model/system_task.go:408
↓ 4 callers
Function
DecreaseTokenQuota
(id int, key string, quota int)
model/token.go:412
↓ 4 callers
Function
DecrementDiskFiles
DecrementDiskFiles 减少磁盘文件计数
common/disk_cache_config.go:115
↓ 4 callers
Function
DoDownloadRequest
(originUrl string, reason ...string)
service/download.go:52
↓ 4 callers
Function
DoWorkerRequest
DoWorkerRequest 通过Worker发送请求
service/download.go:24
↓ 4 callers
Function
ErrOptionWithNoRecordErrorLog
()
types/error.go:387
↓ 4 callers
Method
FullKey
(key string)
pkg/cachex/hybrid_cache.go:55
↓ 4 callers
Function
GeminiTextGenerationHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini-native.go:20
↓ 4 callers
Function
GenerateHMACWithKey
(key []byte, data string)
common/crypto.go:11
↓ 4 callers
Function
GenerateRandomCharsKey
(length int)
common/utils.go:231
↓ 4 callers
Function
GenerateStopResponse
(id string, createAt int64, model string, finishReason string)
relay/helper/common.go:202
↓ 4 callers
Function
GetChannelAffinityUsageCacheStats
(ruleName, usingGroup, keyFp string)
service/channel_affinity.go:790
↓ 4 callers
Function
GetCheckinSetting
GetCheckinSetting 获取签到配置
setting/operation_setting/checkin_setting.go:25
↓ 4 callers
Function
GetClaudeSettings
GetClaudeSettings 获取Claude配置
setting/model_setting/claude.go:43
↓ 4 callers
Function
GetContextKeyType
(c *gin.Context, key constant.ContextKey)
common/gin.go:189
↓ 4 callers
Function
GetCustomOAuthProviderById
GetCustomOAuthProviderById returns a custom OAuth provider by ID
model/custom_oauth_provider.go:88
↓ 4 callers
Function
GetDiscordSettings
()
setting/system_setting/discord.go:19
↓ 4 callers
Function
GetDiskCacheThresholdBytes
GetDiskCacheThresholdBytes 获取磁盘缓存阈值(字节)
common/disk_cache_config.go:51
↓ 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结构
dto/openai_response.go:401
↓ 4 callers
Method
GetOpenAIError
GetOpenAIError 从动态错误类型中提取OpenAIError结构
dto/openai_response.go:21
↓ 4 callers
Method
GetSetting
()
model/user_cache.go:38
↓ 4 callers
Method
GetText
()
dto/claude.go:43
↓ 4 callers
Function
GetTokenByIds
(id int, userId int)
model/token.go:235
↓ 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:306
↓ 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
Method
IsStringSystem
()
dto/claude.go:465
↓ 4 callers
Method
IsSuccess
()
dto/task.go:28
↓ 4 callers
Function
ListModels
(c *gin.Context, modelType int)
controller/model.go:208
↓ 4 callers
Method
LoadFromDB
LoadFromDB 从数据库加载配置
setting/config/config.go:42
↓ 4 callers
Function
LookupResponseConverter
(converter string)
service/relayconvert/response_registry.go:192
↓ 4 callers
Function
NewChannelError
(channelId int, channelType int, channelName string, isMultiKey bool, usingKey string, autoBan bool)
types/channel_error.go:12
↓ 4 callers
Function
NewEstimatedGeminiChatBillingUsage
(usage *Usage)
dto/billing_usage.go:110
↓ 4 callers
Function
NewNotify
(t string, title string, content string, values []interface{})
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
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
()
dto/embedding.go:58
↓ 4 callers
Function
PreConsumeBilling
PreConsumeBilling 根据用户计费偏好创建 BillingSession 并执行预扣费。 会话存储在 relayInfo.Billing 上,供后续 Settle / Refund 使用。
service/billing.go:20
↓ 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
ResetProxyClientCache
ResetProxyClientCache clears all cached proxy clients.
service/http_client.go:300
↓ 4 callers
Function
ResetUserPasswordByEmail
(email string, password string)
model/user.go:1072
↓ 4 callers
Function
ResponsesResponseToChatCompletionsResponse
(resp *dto.OpenAIResponsesResponse, id string)
service/relayconvert/internal/oai_responses/to_oai_chat_resp.go:58
↓ 4 callers
Function
RouteTag
(tag string)
middleware/logger.go:12
↓ 4 callers
Method
SaveToDB
SaveToDB 将配置保存到数据库
setting/config/config.go:71
↓ 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
← previous
next →
601–700 of 9,195, ranked by callers