MCPcopy Create free account

hub / github.com/QuantumNous/new-api / functions

Functions11,560 in github.com/QuantumNous/new-api

↓ 27 callersMethodStop
Stop records a fatal error and marks the stream to stop after this chunk.
relay/helper/stream_result.go:29
↓ 27 callersFunctionchannelActionConfig
( config: ApiRequestConfig = {} )
web/src/features/channels/api.ts:43
↓ 26 callersFunctionGetJsonType
(data json.RawMessage)
relaykit/relayconvert/kitutil/json.go:30
↓ 26 callersMethodStringContent
()
relaykit/dto/openai_request.go:506
↓ 26 callersFunctionadvancedCustomRelayInfo
(config *dto.AdvancedCustomConfig)
relay/channel/advancedcustom/adaptor_test.go:832
↓ 26 callersMethodcall
( ctx context.Context, admissionTimeout time.Duration, exportName string, members []string, args ...any,
pkg/jsplugin/engine.go:331
↓ 25 callersFunctionGetGlobalSettings
()
setting/model_setting/global.go:76
↓ 25 callersMethodRoutingErrors
()
pkg/jsplugin/registry.go:628
↓ 25 callersFunctionTryTieredSettle
TryTieredSettle checks if the request uses tiered_expr billing and, if so, computes the actual quota using the captured BillingSnapshot. Returns: - ok
service/tiered_settle.go:163
↓ 25 callersFunctionUsingMainDatabase
(databaseType DatabaseType)
common/database.go:36
↓ 25 callersFunctionWithOpenAIError
(openAIError OpenAIError, statusCode int, ops ...NewAPIErrorOptions)
relaykit/types/error.go:317
↓ 25 callersFunctionmustApplyReasoningModelSuffix
(t *testing.T, info *relaycommon.RelayInfo, outbound ...dto.Request)
relay/helper/reasoning_suffix_test.go:22
↓ 24 callersFunctionDecodeJson
(reader io.Reader, v any)
common/json.go:17
↓ 24 callersMethodGetBaseURL
()
model/channel.go:521
↓ 24 callersFunctionGetResponseID
(c *gin.Context)
relay/helper/common.go:174
↓ 24 callersFunctionIOCopyBytesGracefully
(c *gin.Context, src *http.Response, data []byte)
service/http.go:44
↓ 24 callersMethodRegisterFactory
(source string, options Options)
pkg/jsplugin/registry.go:205
↓ 24 callersMethodaddEventListener
( type: string, listener: (event: Event & { data?: string; readyState?: number }) => void )
web/src/features/playground/hooks/use-stream-request.test.ts:41
↓ 24 callersFunctionformatQuota
(quota: number)
web/src/lib/format.ts:73
↓ 24 callersFunctionsetupTaskPluginControllerTest
(t *testing.T)
controller/task_plugin_test.go:25
↓ 23 callersMethodError
()
relaykit/relayconvert/reasoning/intent.go:35
↓ 23 callersMethodGetPageSize
()
common/page_info.go:25
↓ 23 callersFunctionNewErrorWithStatusCode
(err error, errorCode ErrorCode, statusCode int, ops ...NewAPIErrorOptions)
relaykit/types/error.go:299
↓ 23 callersFunctionSetContextKey
(c *gin.Context, key constant.ContextKey, value any)
common/gin.go:157
↓ 23 callersMethodValue
()
model/task.go:98
↓ 23 callersMethodmakeRequest
makeRequest performs an HTTP request and handles common response processing
pkg/ionet/client.go:99
↓ 23 callersMethodmatch
(response *dto.GeminiFunctionResponse)
relaykit/relayconvert/internal/gemini_chat/to_oai_chat_req.go:241
↓ 23 callersFunctionpluginProtocolTestDeps
()
controller/plugin_protocol_test.go:1485
↓ 23 callersFunctionseedToken
(t *testing.T, id int, userId int, key string, remainQuota int)
service/task_billing_test.go:91
↓ 23 callersFunctionuseStatus
()
web/src/hooks/use-status.ts:40
↓ 22 callersFunctionCompilePlugin
CompilePlugin validates a plugin without publishing it. Callers that refresh multiple plugins use this together with ReplaceOverrides so readers obser
pkg/jsplugin/registry.go:243
↓ 22 callersFunctionGetUserCache
GetUserCache gets complete user cache from hash
model/user_cache.go:88
↓ 22 callersFunctioncompileRouterPlugin
(t *testing.T, key, version, routes string)
router/plugin_router_test.go:842
↓ 22 callersFunctioncopyToClipboard
(text: string)
web/src/lib/copy-to-clipboard.ts:82
↓ 22 callersFunctionformatTimestampToDate
( timestamp?: number, unit: 'seconds' | 'milliseconds' = 'seconds' )
web/src/lib/format.ts:167
↓ 22 callersFunctionseedChannel
(t *testing.T, id int)
service/task_billing_test.go:119
↓ 21 callersMethodAddOtherRatio
(key string, ratio float64)
types/price_data.go:35
↓ 21 callersMethodDecode
(s string)
pkg/cachex/codec.go:12
↓ 21 callersFunctionGetEnvOrDefault
(env string, defaultValue int)
common/env.go:9
↓ 21 callersFunctionGetPointer
(v T)
relaykit/relayconvert/kitutil/value.go:12
↓ 21 callersMethodGetStartIdx
()
common/page_info.go:17
↓ 21 callersFunctionResponseText2Usage
func GetPromptTokens(textRequest dto.GeneralOpenAIRequest, relayMode int) (int, error) { switch relayMode { case constant.RelayModeChatCompletions:
service/usage_helpr.go:22
↓ 21 callersMethodValidate
()
relaykit/dto/channel_settings.go:389
↓ 21 callersFunctioncalculateTextQuotaSummary
calculateTextQuotaSummary expects a usage already remapped by effectiveBillingUsage; PostTextConsumeQuota performs that remap once and shares the resu
service/text_quota.go:231
↓ 21 callersFunctiongetTokenRemainQuota
(t *testing.T, id int)
service/task_billing_test.go:475
↓ 21 callersFunctionperformPluginRequest
(handler http.Handler, method, path string)
router/plugin_router_test.go:879
↓ 21 callersFunctionserveTaskPluginProtocol
( c *gin.Context, pinned pluginruntime.PinnedEndpoint, deps pluginProtocolBridgeDeps, )
controller/plugin_protocol.go:140
↓ 21 callersFunctiontestPluginRouteHandlers
( handler func(*gin.Context, *jsplugin.RoutingGeneration, jsplugin.RouteBinding), )
router/plugin_router_test.go:823
↓ 20 callersFunctionCreateSystemTask
(taskType string, payload any, state any)
model/system_task.go:92
↓ 20 callersMethodEncode
(v V)
pkg/cachex/codec.go:11
↓ 20 callersMethodError
Error lets the same typed value serve both as the settlement audit marker and as the fail-fast error returned by strict pre-consume conversions.
common/quota_math.go:52
↓ 20 callersFunctionSaveTaskPlugin
(plugin *TaskPlugin)
model/task_plugin.go:50
↓ 20 callersFunctioncompilePluginProtocolTestEndpoint
(t *testing.T, key, source string)
controller/plugin_protocol_test.go:1420
↓ 20 callersFunctioncompileTaskRoutePlugin
(t *testing.T, source string)
middleware/task_plugin_test.go:1587
↓ 20 callersFunctiongetLastLog
(t *testing.T)
service/task_billing_test.go:510
↓ 20 callersFunctionrecordManageAudit
recordManageAudit 记录一条由操作者本人归属的管理/高危审计日志(资源类操作: 渠道 / 系统设置 / 兑换码等)。content 由 action+params 自动渲染。
controller/audit.go:93
↓ 20 callersFunctionrender
()
web/src/components/turnstile.tsx:45
↓ 20 callersFunctionuseUserCacheMiniRedis
(t *testing.T)
model/user_cache_auth_version_test.go:17
↓ 19 callersMethodClose
()
relaykit/types/file_source.go:209
↓ 19 callersFunctionNewLogOther
()
model/log_other.go:44
↓ 19 callersFunctionPrepareTaskPluginRoute
PrepareTaskPluginRoute resolves and executes the pinned declarative route. Query requests terminate here so channel distribution and billing are never
middleware/task_plugin.go:50
↓ 19 callersFunctionnewPluginProtocolTestContext
(stream, requestBodyStream bool)
controller/plugin_protocol_test.go:1456
↓ 18 callersFunctionCloneBillingUsage
(usage *BillingUsage)
relaykit/dto/billing_usage.go:225
↓ 18 callersMethodCommit
Commit writes the capped completed-output count into RelayInfo once. Request tool declarations alone must not become billable calls.
relay/common/tool_usage.go:147
↓ 18 callersFunctionGetPageQuery
(c *gin.Context)
common/page_info.go:41
↓ 18 callersMethodInitChannelMeta
(c *gin.Context)
relay/common/relay_info.go:207
↓ 18 callersMethodSetItems
(items any)
common/page_info.go:37
↓ 18 callersMethodSetTotal
(total int)
common/page_info.go:33
↓ 18 callersFunctionUnmarshalBodyReusable
(c *gin.Context, v any)
common/gin.go:108
↓ 18 callersFunctiongetCurrencyDisplay
()
web/src/lib/currency.ts:365
↓ 18 callersFunctionroutingTestPluginSource
(key string, channelType int, models, metaFields, exports string)
pkg/jsplugin/routing_test.go:1015
↓ 18 callersFunctionsafeJsonParseWithValidation
( value: string | undefined | null, options: SafeJsonParseWithValidationOptions<T> )
web/src/features/system-settings/utils/json-parser.ts:141
↓ 18 callersFunctionuseChannels
()
web/src/features/channels/components/channels-provider.tsx:145
↓ 17 callersMethodDoRequest
(c *gin.Context, info *relaycommon.RelayInfo, requestBody io.Reader)
relay/channel/adapter.go:28
↓ 17 callersMethodGetOtherSettings
()
model/channel.go:1035
↓ 17 callersMethodGetUpstreamTaskID
GetUpstreamTaskID 获取上游真实 task ID(用于与 provider 通信) 旧数据没有 UpstreamTaskID 时,TaskID 本身就是上游 ID
model/task.go:171
↓ 17 callersMethodParseContent
()
relaykit/dto/claude.go:182
↓ 17 callersMethodParseToolCalls
()
relaykit/dto/openai_request.go:490
↓ 17 callersMethodSource
Source 返回资金来源标识:"wallet" 或 "subscription"
service/funding_source.go:17
↓ 17 callersFunctionmustCompileRoutingPlugin
(t *testing.T, key string, channelType int, models, metaFields, exports string)
pkg/jsplugin/routing_test.go:1008
↓ 17 callersFunctionpinTaskPluginRoute
(plugin *jsplugin.LoadedPlugin, routeIndex int)
middleware/task_plugin_test.go:1675
↓ 17 callersFunctionsemanticLoss
(path string, code string, message string)
relaykit/relayconvert/internal/toolconv/encode.go:1298
↓ 17 callersFunctionsetupModelListControllerTestDB
(t *testing.T)
controller/model_list_test.go:37
↓ 17 callersFunctionsetupUserSessionTest
(t *testing.T)
model/user_session_test.go:43
↓ 16 callersFunctionConvertRequest
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, request any)
service/request_converter.go:26
↓ 16 callersFunctionConvertRequest
(c context.Context, info convmeta.Meta, target types.RelayFormat, request any)
relaykit/relayconvert/request_registry.go:155
↓ 16 callersFunctionFinishSystemTask
(taskID string, lockedBy string, status SystemTaskStatus, resultPayload any, errorMessage string)
model/system_task.go:399
↓ 16 callersFunctionGetChannelConstraints
(c *gin.Context)
service/channel_select.go:15
↓ 16 callersFunctionGetQuotaDisplayType
GetQuotaDisplayType 返回额度展示类型
setting/operation_setting/general_setting.go:55
↓ 16 callersFunctionMainDatabaseType
()
common/database.go:15
↓ 16 callersFunctionPinTaskPluginEndpoint
PinTaskPluginEndpoint decides shared-endpoint ownership without executing plugin code. Invalid or unidentifiable ordinary requests deliberately fall t
middleware/task_plugin.go:318
↓ 16 callersFunctionPrepareTaskPluginEndpoint
PrepareTaskPluginEndpoint normalizes a claimed shared request through the deterministic parser pinned before distribution. A shared-model request can
middleware/task_plugin.go:506
↓ 16 callersFunctionRelayErrorHandler
(ctx context.Context, resp *http.Response, showBodyWhenFail bool)
service/error.go:87
↓ 16 callersMethodRemove
(item T)
types/set.go:17
↓ 16 callersMethodSetReasoningEffort
SetReasoningEffort records the effort level a converter derived from a model-name suffix so downstream billing/logging can see it.
relaykit/relayconvert/convmeta/meta.go:30
↓ 16 callersMethodSnapshot
()
model/task.go:500
↓ 16 callersMethodString
()
service/http_transport_policy.go:89
↓ 16 callersFunctioncountLogs
(t *testing.T)
service/task_billing_test.go:520
↓ 16 callersFunctionnewPluginRouterTest
( t *testing.T, plugins []*jsplugin.LoadedPlugin, handlers pluginRouteHandlers, )
router/plugin_router_test.go:780
↓ 16 callersFunctionnormalizeAdvancedCustomConfig
( config: AdvancedCustomConfig )
web/src/features/channels/lib/advanced-custom.ts:552
← previousnext →101–200 of 11,560, ranked by callers