Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
15,592 in github.com/QuantumNous/new-api
⨍
Functions
15,592
◇
Types & classes
2,267
↓ 5 callers
Function
tokenAuditParams
(c *gin.Context)
controller/audit.go:187
↓ 5 callers
Function
triggerRefresh
()
web/src/features/redemption-codes/components/redemptions-provider.tsx:47
↓ 5 callers
Function
trimmed
(value)
plugins/tasks/jimeng/plugin.js:54
↓ 5 callers
Function
tryParseRequestRuleExpr
( expr: string )
web/src/features/pricing/lib/billing-expr.ts:588
↓ 5 callers
Function
updateChannel
( id: number, data: Partial<Channel> )
web/src/features/channels/api.ts:261
↓ 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:92
↓ 5 callers
Function
useAuthRedirect
()
web/src/features/auth/hooks/use-auth-redirect.ts:36
↓ 5 callers
Function
useBranch
()
web/src/components/ai-elements/branch.tsx:49
↓ 5 callers
Function
useCommonLogsColumns
( isAdmin: boolean, isRoot: boolean, showBillingSource = false )
web/src/features/usage-logs/components/columns/common-logs-columns.tsx:352
↓ 5 callers
Function
useScheduledChannelDatabase
useScheduledChannelDatabase isolates these locked-update tests on each real dialect selected through TEST_TASK_DB_DIALECT and the standard test DSNs.
model/channel_plugin_credential_test.go:290
↓ 5 callers
Function
validateAdvancedCustomConfig
( config: AdvancedCustomConfig | null )
web/src/features/channels/lib/advanced-custom.ts:623
↓ 5 callers
Function
validateOptionValue
(key string, value string)
model/option.go:239
↓ 5 callers
Function
valueMap
(value any)
controller/ratio_sync.go:94
↓ 5 callers
Function
viaGateway
(ctx)
plugins/tasks/vertex-ai/plugin.js:128
↓ 5 callers
Function
visualNodeId
()
web/src/features/pricing/lib/billing-expression/visual.ts:79
↓ 5 callers
Function
writeAccountStatusError
writeAccountStatusError responds with a web console message under a non-200 status.
controller/secure_verification.go:140
↓ 5 callers
Function
writeChat
(w http.ResponseWriter, request capturedRequest)
router/provider_plugin_relay_test.go:100
↓ 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
Method
AddPolicy
(_ string, ptype string, rule []string)
service/authz/adapter.go:79
↓ 4 callers
Function
AddToken
(c *gin.Context)
controller/token.go:299
↓ 4 callers
Function
AdminResetUserSubscriptionsByPlan
(userId int, planId int, advanceResetTime bool)
model/subscription.go:1109
↓ 4 callers
Method
AppendRequestConversion
AppendRequestConversion records a hop in the request format chain.
relaykit/relayconvert/convmeta/meta.go:60
↓ 4 callers
Function
AppendUsedChannel
AppendUsedChannel records an attempted channel in the request's channel trail, which the retry log and the consume log's admin_info both read.
service/channel_select.go:423
↓ 4 callers
Method
Apply
Apply accepts a bounded batch of set, append and appendText operations. Failure invalidates the stream: callers must discard the state rather than con
pluginkit/json_state.go:259
↓ 4 callers
Function
ApplyToOpenAIResponses
ApplyToOpenAIResponses writes the portable portion of an intent directly to a Responses request. The JSON-excluded state retains exact provider-native
relaykit/relayconvert/reasoning/intent.go:480
↓ 4 callers
Function
BodyStorageCleanup
BodyStorageCleanup 请求体存储清理中间件 在请求处理完成后自动清理磁盘/内存缓存
middleware/body_cleanup.go:11
↓ 4 callers
Function
BuildTaskArtifactContentURL
BuildTaskArtifactContentURL returns an absolute, long-lived capability URL. TaskPublicAddress wins when configured; ServerAddress is the only fallback
service/task_artifact_access.go:98
↓ 4 callers
Function
CacheUpdateChannelKey
CacheUpdateChannelKey publishes a new key for a cached channel. The cached channel is replaced by a copy, so a request holding the previous one keeps
model/channel_plugin_credential.go:201
↓ 4 callers
Method
CacheWrite12hTokens
CacheWrite12hTokens returns the 12-hour subset of the cache writes, bounded by CacheCreationTokensTotal so it never bills more writes than reported.
relaykit/dto/openai_response.go:348
↓ 4 callers
Method
CallConvertRequest
CallConvertRequest runs convertRequest(ctx, {body, model, stream}), or convertRequest(ctx, {form, model, stream}) for a multipart client request.
pluginkit/provider.go:664
↓ 4 callers
Method
CallConvertStreamEvent
CallConvertStreamEvent runs convertStreamEvent(ctx, {event?, data}) on the stream of the route at hookCtx.Path, {dataBase64} for a binary frame, or wi
pluginkit/provider.go:1272
↓ 4 callers
Function
CallID
(item map[string]any)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:589
↓ 4 callers
Method
CallPrepareRequest
CallPrepareRequest runs prepareRequest(ctx, req).
pluginkit/provider.go:495
↓ 4 callers
Method
CallReply
CallReply runs the reply hook with tctx.Stage "reply" on outputs and checks the result: each mask names an output of the call and lies within its text
pluginkit/transform.go:556
↓ 4 callers
Method
CallRequestDescriptor
CallRequestDescriptor runs a request-building hook. A plugin that preserves JSON order has its descriptor decoded from the JSON.stringify text of the
pluginkit/task.go:93
↓ 4 callers
Method
CallScheduled
CallScheduled runs scheduled(ctx). The caller checks the stored credential line's size and applies the result while holding the channel lock.
pluginkit/provider.go:368
↓ 4 callers
Function
Catalog
Catalog returns a copy of the registered resource definitions.
service/authz/registry.go:29
↓ 4 callers
Function
ClassifyRelayOutcome
ClassifyRelayOutcome decides whether one finished relay counts as a health sample. Business rejections and cancellations during generation are not sam
pkg/perf_metrics/outcome.go:26
↓ 4 callers
Function
ClaudeData
(c *gin.Context, resp dto.ClaudeResponse)
relay/helper/common.go:214
↓ 4 callers
Function
CleanupBodyStorage
CleanupBodyStorage 清理请求体存储(应在请求结束时调用)
common/gin.go:110
↓ 4 callers
Function
ClearRefreshCookie
(c *gin.Context)
service/auth_session.go:346
↓ 4 callers
Function
CloseActiveWebSocketsForChannel
(channelID int, reason string)
service/ws_close.go:7
↓ 4 callers
Function
CloseChannel
(channelID int, reason string)
pkg/wsmanager/wsmanager.go:89
↓ 4 callers
Function
ContentPartToFileSource
(part map[string]any)
relaykit/relayconvert/internal/oai_responses/req_helpers.go:241
↓ 4 callers
Method
ConvertOpenAIResponsesRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.OpenAIResponsesRequest)
relay/channel/advancedcustom/adaptor.go:111
↓ 4 callers
Function
ConvertStreamResponse
(c context.Context, info convmeta.Meta, target types.RelayFormat, response any)
relaykit/relayconvert/response_registry.go:272
↓ 4 callers
Function
CountUserSubscriptionsByPlan
(userId int, planId int)
model/subscription.go:425
↓ 4 callers
Function
CovertMjpActionToModelName
(mjAction string)
service/midjourney.go:25
↓ 4 callers
Function
CreateUserSubscriptionFromPlanTx
(tx *gorm.DB, userId int, plan *SubscriptionPlan, source string)
model/subscription.go:496
↓ 4 callers
Function
DecreaseTokenQuota
(id int, key string, quota int)
model/token.go:413
↓ 4 callers
Function
DecrementDiskFiles
DecrementDiskFiles 减少磁盘文件计数
common/disk_cache_config.go:115
↓ 4 callers
Function
DeleteJSONMember
DeleteJSONMember removes every copy of the member at path. A client body may repeat a key, and most upstream parsers read the last copy, so a survivin
relay/common/relay_info.go:1165
↓ 4 callers
Function
DeleteModelMetadata
DeleteModelMetadata optionally removes exact model names from every channel. Channel removal requires exact-match metadata records. Pricing removal cl
model/model_meta.go:285
↓ 4 callers
Function
DoDownloadRequest
(originUrl string, reason ...string)
service/download.go:52
↓ 4 callers
Method
DoRequest
(c *gin.Context, info *relaycommon.RelayInfo, requestBody io.Reader)
relay/channel/aws/adaptor.go:139
↓ 4 callers
Function
DoWorkerRequest
DoWorkerRequest 通过Worker发送请求
service/download.go:24
↓ 4 callers
Method
EffectiveRPID
EffectiveRPID preserves the existing default and port handling for settings created before explicit Passkey domains were introduced.
setting/system_setting/passkey.go:41
↓ 4 callers
Method
Enabled
()
service/task_artifact_store.go:27
↓ 4 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:202
↓ 4 callers
Function
ExprVersion
ExprVersion returns the version of a cached expression. Returns DefaultExprVersion if the expression hasn't been compiled yet or is empty.
pkg/billingexpr/compile.go:242
↓ 4 callers
Method
Finalize
(state *ResponseStreamState)
relaykit/relayconvert/response_compat.go:73
↓ 4 callers
Function
FindUserAccessTokenByHash
(hash string)
model/user_access_token.go:85
↓ 4 callers
Function
FinishEmailBinding
(identity AuthIdentity, token, newCode, oldCode string)
service/email_binding.go:129
↓ 4 callers
Function
FinishTwoFASetup
(identity AuthIdentity, flowToken, code string)
service/twofa.go:43
↓ 4 callers
Method
Flush
()
router/plugin-router.go:560
↓ 4 callers
Method
FullKey
(key string)
pkg/cachex/hybrid_cache.go:55
↓ 4 callers
Function
GenerateSystemTaskID
()
model/system_task.go:94
↓ 4 callers
Function
GenerateVerificationCode
(length int)
common/verification.go:27
↓ 4 callers
Function
GetAdvancedCustomPreset
GetAdvancedCustomPreset returns fresh defaults.
common/advanced_custom_presets.go:9
↓ 4 callers
Function
GetChannelAffinityUsageCacheStats
(ruleName, usingGroup, keyFp string)
service/channel_affinity.go:809
↓ 4 callers
Method
GetChannelType
()
relaykit/relayconvert/convmeta/meta.go:27
↓ 4 callers
Function
GetCheckinSetting
GetCheckinSetting 获取签到配置
setting/operation_setting/checkin_setting.go:25
↓ 4 callers
Function
GetCustomOAuthProviderById
GetCustomOAuthProviderById returns a custom OAuth provider by ID
model/custom_oauth_provider.go:90
↓ 4 callers
Function
GetDiscordSettings
()
setting/system_setting/discord.go:19
↓ 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
GetEnabledModels
()
model/ability.go:62
↓ 4 callers
Function
GetEnvOrDefaultBool
(env string, defaultValue bool)
common/env.go:27
↓ 4 callers
Method
GetFullKey
()
model/token.go:80
↓ 4 callers
Function
GetGroupRatio
(name string)
setting/ratio_setting/group_ratio.go:79
↓ 4 callers
Function
GetLatestSyncRevisions
GetLatestSyncRevisions returns the id of the newest sync task of every topic that has one. A node reads it before its startup loads, before it knows w
model/system_sync_task.go:83
↓ 4 callers
Function
GetLogSetting
()
setting/operation_setting/log_setting.go:31
↓ 4 callers
Function
GetOpenAIError
GetOpenAIError 从动态错误类型中提取OpenAIError结构
relaykit/dto/openai_response.go:636
↓ 4 callers
Function
GetOptions
(c *gin.Context)
controller/option.go:84
↓ 4 callers
Method
GetPage
()
common/page_info.go:29
↓ 4 callers
Method
GetPreConsumedQuota
GetPreConsumedQuota 返回实际预扣的额度值(信任用户可能为 0)。
relay/common/billing.go:20
↓ 4 callers
Function
GetProvider
GetProvider returns the OAuth provider for the given name
oauth/registry.go:63
↓ 4 callers
Method
GetProviderId
GetProviderId returns the provider ID for binding purposes
oauth/generic.go:316
↓ 4 callers
Method
GetSetting
()
model/user_cache.go:50
↓ 4 callers
Function
GetTimestamp
()
relaykit/relayconvert/kitutil/value.go:50
↓ 4 callers
Function
GetToolPrice
GetToolPrice is a convenience wrapper when no model name is needed.
setting/operation_setting/tools.go:279
↓ 4 callers
Function
GetUniqueUserByEmail
(email string)
model/user.go:1157
↓ 4 callers
Function
GetUnusedBackupCodeCount
GetUnusedBackupCodeCount 获取未使用的备用码数量
model/twofa.go:231
↓ 4 callers
Function
GetUserAutoGroup
GetUserAutoGroup 根据用户分组获取自动分组设置
service/group.go:57
↓ 4 callers
Function
GetUserSetting
GetUserSetting gets setting from Redis first, falls back to DB if needed
model/user.go:1319
↓ 4 callers
Function
GetVendors
GetVendors 返回当前定价接口使用到的供应商信息
model/pricing.go:108
↓ 4 callers
Function
HandleStreamResponseData
(c *gin.Context, info *relaycommon.RelayInfo, claudeInfo *ClaudeResponseInfo, data string)
relay/channel/claude/relay-claude.go:89
↓ 4 callers
Method
HasIcon
HasIcon reports whether this version ships a logo.
model/task_plugin.go:103
↓ 4 callers
Method
HasOtherRatio
(key string)
types/price_data.go:62
← previous
next →
1,601–1,700 of 15,592, ranked by callers