Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
15,409 in github.com/QuantumNous/new-api
⨍
Functions
15,409
◇
Types & classes
2,241
↓ 25 callers
Function
resolveLocalizedText
( value: LocalizedTextValue | undefined | null, language: string )
web/src/lib/localized-text.ts:36
↓ 25 callers
Function
seedChannel
(t *testing.T, id int)
service/task_billing_test.go:124
↓ 24 callers
Function
CacheGetChannel
(id int)
model/channel_cache.go:225
↓ 24 callers
Function
ConvertRequest
(c context.Context, info convmeta.Meta, target types.RelayFormat, request any)
relaykit/relayconvert/request_registry.go:157
↓ 24 callers
Method
Error
()
relaykit/relayconvert/reasoning/intent.go:36
↓ 24 callers
Function
GetHttpClientWithProxySettings
GetHttpClientWithProxySettings returns a cached HTTP client for the proxy URL and channel transport settings. Default auto + 1 shard shares the same c
service/http_client.go:400
↓ 24 callers
Function
GetResponseID
(c *gin.Context)
relay/helper/common.go:333
↓ 24 callers
Function
GetUserCache
GetUserCache gets complete user cache from hash
model/user_cache.go:100
↓ 24 callers
Method
HasProviderHook
HasProviderHook reports whether the plugin exports a provider hook. It runs no JavaScript.
pkg/jsplugin/provider.go:163
↓ 24 callers
Function
PrepareTaskPluginRoute
PrepareTaskPluginRoute resolves and executes the pinned declarative route. Query requests terminate here so channel distribution and billing are never
middleware/task_plugin.go:113
↓ 24 callers
Function
RequestPolicy
(c *gin.Context)
service/request_policy.go:55
↓ 24 callers
Function
SetDatabaseTypes
(mainType DatabaseType, logType DatabaseType)
common/database.go:33
↓ 24 callers
Method
WriteString
(s string)
relay/channel/openai/image_stream_test.go:306
↓ 24 callers
Function
getCurrencyDisplay
()
web/src/lib/currency.ts:365
↓ 24 callers
Function
recordUserSecurityAudit
recordUserSecurityAudit 记录普通用户自己的安全敏感操作(如 passkey 绑定/解绑)。 这类日志没有管理员操作者,不写 admin_info;同时不依赖 AdminAuth/RootAuth 的兜底。
controller/audit.go:164
↓ 24 callers
Function
seedToken
(t *testing.T, id int, userId int, key string, remainQuota int)
service/task_billing_test.go:96
↓ 24 callers
Method
start
()
web/src/components/ai-elements/prompt-input.tsx:1051
↓ 23 callers
Function
GetAuthFlow
GetAuthFlow validates a flow without consuming it. Callers must still use ConsumeAuthFlow with all identity-bound fields before performing the action.
model/auth_flow.go:217
↓ 23 callers
Method
InitChannelMeta
(c *gin.Context)
relay/common/relay_info.go:281
↓ 23 callers
Method
Insert
()
model/channel.go:608
↓ 23 callers
Function
LogDatabaseType
()
common/database.go:21
↓ 23 callers
Function
ModelPriceHelper
(c *gin.Context, info *relaycommon.RelayInfo, promptTokens int, meta *types.TokenCountMeta)
relay/helper/price.go:65
↓ 23 callers
Method
ParseToolCalls
()
relaykit/dto/openai_request.go:680
↓ 23 callers
Function
RunExprWithRequest
(exprStr string, params TokenParams, request RequestInput)
pkg/billingexpr/run.go:30
↓ 23 callers
Method
WriteHeader
(status int)
controller/responses_websocket.go:65
↓ 23 callers
Function
calculateTextQuotaSummary
calculateTextQuotaSummary expects a usage already remapped by effectiveBillingUsage; PostTextConsumeQuota performs that remap once and shares the resu
service/text_quota.go:229
↓ 23 callers
Function
getLastLog
(t *testing.T)
service/task_billing_test.go:576
↓ 23 callers
Method
makeRequest
makeRequest performs an HTTP request and handles common response processing
pkg/ionet/client.go:99
↓ 23 callers
Function
newLoginFixture
(t *testing.T, key, mode string)
service/provider_plugin_login_test.go:63
↓ 23 callers
Function
performPluginRequest
(handler http.Handler, method, path string)
router/plugin_router_test.go:1109
↓ 23 callers
Function
setupReplyPlugins
(t *testing.T, instances string)
relay/requestplugin/requestplugin_test.go:974
↓ 22 callers
Function
CreateSystemTask
(taskType string, payload any, state any)
model/system_task.go:102
↓ 22 callers
Method
Error
Error implements the error interface
pkg/ionet/types.go:274
↓ 22 callers
Method
Error
()
pkg/jsplugin/engine.go:56
↓ 22 callers
Function
FormatQuota
(quota int)
logger/logger.go:152
↓ 22 callers
Function
GetEnvOrDefault
(env string, defaultValue int)
common/env.go:8
↓ 22 callers
Function
GetGeneralSetting
()
setting/operation_setting/general_setting.go:40
↓ 22 callers
Method
GetPageSize
()
common/page_info.go:25
↓ 22 callers
Method
GetUpstreamTaskID
GetUpstreamTaskID 获取上游真实 task ID(用于与 provider 通信) 旧数据没有 UpstreamTaskID 时,TaskID 本身就是上游 ID
model/task.go:210
↓ 22 callers
Function
ParseAccessToken
(raw string)
service/auth_token.go:85
↓ 22 callers
Method
ParseContent
()
relaykit/dto/claude.go:186
↓ 22 callers
Function
PublishUserAuthCache
PublishUserAuthCache refreshes user metadata from the database. Quota stays under the atomic quota-delta paths.
model/user_auth_cache.go:233
↓ 22 callers
Function
Register
Register registers an OAuth provider with the given name
oauth/registry.go:24
↓ 22 callers
Method
Snapshot
()
model/task.go:557
↓ 22 callers
Function
compileBillingExpression
(source: string)
web/src/features/pricing/lib/billing-expression/parser.ts:487
↓ 22 callers
Function
paymentError
paymentError answers payment endpoints in their {"message": "error", "data": text} shape. When err is or wraps a *common.Message, the response also ca
controller/topup.go:258
↓ 22 callers
Function
useUserCacheMiniRedis
(t *testing.T)
model/user_cache_auth_version_test.go:40
↓ 21 callers
Method
AddOtherRatio
(key string, ratio float64)
types/price_data.go:44
↓ 21 callers
Method
DoResponse
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo)
relay/channel/adapter.go:30
↓ 21 callers
Method
GetOtherInfo
()
model/channel.go:327
↓ 21 callers
Function
GetPointer
(v T)
relaykit/relayconvert/kitutil/value.go:12
↓ 21 callers
Function
GetStepUpIdentity
GetStepUpIdentity returns the identity that may request and consume security verification proofs: a browser session, or a scoped access token bound to
middleware/auth.go:182
↓ 21 callers
Function
GetTaskPluginVersion
(key, version string)
model/task_plugin.go:161
↓ 21 callers
Function
ModelRatio2JSONString
()
setting/ratio_setting/model_ratio.go:639
↓ 21 callers
Method
ObserveResponseModel
ObserveResponseModel retains the first differing model for inspection, with mismatches taking priority over provider-path, prefix, or case-only differ
relay/common/response_model.go:40
↓ 21 callers
Function
ResponseText2Usage
func GetPromptTokens(textRequest dto.GeneralOpenAIRequest, relayMode int) (int, error) { switch relayMode { case constant.RelayModeChatCompletions:
service/usage_helpr.go:23
↓ 21 callers
Method
SetSetting
(setting dto.ChannelSettings)
model/channel.go:1220
↓ 21 callers
Method
String
()
service/http_transport_policy.go:92
↓ 21 callers
Method
ToOpenAIError
ToOpenAIError masks the upstream addresses in the message; pass those of the channel that produced the error, or none when no channel did.
relaykit/types/error.go:187
↓ 21 callers
Function
UpdateChannelStatus
(channelId int, usingKey string, status int, reason string)
model/channel.go:861
↓ 21 callers
Function
UpdateModelRatioByJSONString
(jsonStr string)
setting/ratio_setting/model_ratio.go:373
↓ 21 callers
Method
Written
()
relay/requestplugin/reply.go:877
↓ 21 callers
Method
abort
()
web/src/features/auth/secure-verification/__tests__/verification-api.test.ts:192
↓ 21 callers
Function
compileRouterPlugin
(t *testing.T, key, version, routes string)
router/plugin_router_test.go:1072
↓ 21 callers
Function
formatQuota
(quota: number)
web/src/lib/format.ts:89
↓ 21 callers
Function
getTokenRemainQuota
(t *testing.T, id int)
service/task_billing_test.go:541
↓ 21 callers
Function
registerScheduledPlugin
(t *testing.T, hooks string)
service/provider_plugin_test.go:794
↓ 21 callers
Function
serveTaskPluginProtocol
( c *gin.Context, pinned pluginruntime.PinnedEndpoint, deps pluginProtocolBridgeDeps, )
controller/plugin_protocol.go:163
↓ 21 callers
Function
testPluginRouteHandlers
( handler func(*gin.Context, *jsplugin.RoutingGeneration, jsplugin.RouteBinding), )
router/plugin_router_test.go:1051
↓ 21 callers
Function
useChannels
()
web/src/features/channels/components/channels-provider.tsx:164
↓ 21 callers
Function
useMediaQuery
(query: string)
web/src/hooks/use-media-query.ts:26
↓ 20 callers
Function
ApiSuccessT
ApiSuccessT is the success counterpart of ApiErrorT.
common/gin.go:307
↓ 20 callers
Method
Decode
(s string)
pkg/cachex/codec.go:12
↓ 20 callers
Method
GetStartIdx
()
common/page_info.go:17
↓ 20 callers
Function
NewPlan
NewPlan takes the plan of a new request: nil when no enabled instance has an available plugin. The instances of a plugin that is missing, disabled or
relay/requestplugin/plan.go:102
↓ 20 callers
Function
PrepareTaskPluginEndpoint
PrepareTaskPluginEndpoint normalizes a claimed shared request through the candidates pinned before distribution, retaining only plugins that accept it
middleware/task_plugin.go:757
↓ 20 callers
Function
SaveTaskPlugin
(plugin *TaskPlugin)
model/task_plugin.go:107
↓ 20 callers
Function
Source
Source returns the embedded factory source for a task plugin key.
plugins/embed.go:41
↓ 20 callers
Function
Translate
Translate translates a message key for the specified language. An empty language means the reader stated none and gets common.DefaultLanguage.
i18n/i18n.go:97
↓ 20 callers
Function
allowMembers
(object map[string]any, subject string, names ...string)
pkg/jsplugin/provider.go:1722
↓ 20 callers
Function
cleanupTaskPluginControllerRuntime
(t *testing.T, key string)
controller/task_plugin_test.go:72
↓ 20 callers
Function
compilePluginProtocolTestEndpoint
(t *testing.T, key, source string)
controller/plugin_protocol_test.go:1444
↓ 20 callers
Function
copyToClipboard
(text: string)
web/src/lib/copy-to-clipboard.ts:82
↓ 20 callers
Function
expiringLine
(t *testing.T, plugin, refresh, account string, expiresAt int64)
service/provider_plugin_test.go:299
↓ 20 callers
Function
replyInfo
(format types.RelayFormat, mode int)
relay/requestplugin/requestplugin_test.go:1003
↓ 20 callers
Function
trimmed
(value)
plugins/tasks/doubao/plugin.js:335
↓ 19 callers
Function
AccessTokenFingerprint
(token string)
model/audit_log.go:61
↓ 19 callers
Function
ApiErrorStatus
ApiErrorStatus is ApiError with another HTTP status. fields adds response fields such as a stable error code or data.
common/gin.go:285
↓ 19 callers
Function
ApplyReasoningModelSuffix
ApplyReasoningModelSuffix parses host-private reasoning suffixes from the origin and mapped model names, attaches the resulting intent to RelayInfo, a
relay/helper/reasoning_suffix.go:28
↓ 19 callers
Method
Commit
Commit writes the capped completed-output count into RelayInfo once. Request tool declarations alone must not become billable calls.
relay/common/tool_usage.go:197
↓ 19 callers
Function
GetPasskeyByUserID
(userID int)
model/passkey.go:124
↓ 19 callers
Function
Ingress
Ingress takes the execution plan of a relay request and runs the ingress stage on the stored client body, before the body is parsed. Patched bytes rep
relay/requestplugin/relay.go:48
↓ 19 callers
Function
ModelMappedHelper
(c *gin.Context, info *relaycommon.RelayInfo, request dto.Request)
relay/helper/model_mapped.go:14
↓ 19 callers
Function
NewLogOther
()
model/log_other.go:46
↓ 19 callers
Function
Outbound
Outbound runs the late ingress hooks and the outbound stage on the upstream JSON body of a channel attempt, before the channel param override, which h
relay/requestplugin/relay.go:353
↓ 19 callers
Function
PinTaskPluginEndpoint
PinTaskPluginEndpoint decides shared-endpoint ownership without executing plugin code. Invalid or unidentifiable ordinary requests deliberately fall t
middleware/task_plugin.go:596
↓ 19 callers
Function
SetEventStreamHeaders
(c *gin.Context)
relay/helper/common.go:197
↓ 19 callers
Function
UsedVars
UsedVars returns the set of identifier names referenced by an expression. The result is cached alongside the compiled program. Returns nil for empty i
pkg/billingexpr/compile.go:296
↓ 19 callers
Method
Value
()
model/task.go:99
↓ 19 callers
Method
array
array reads the tokens up to the matching ']' as one 'a' token: strings and numbers kept, at most maxPDFArrayItems, nested arrays skipped.
relay/requestplugin/pdf.go:736
← previous
next →
201–300 of 15,409, ranked by callers