MCPcopy Create free account

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

Functions10,934 in github.com/QuantumNous/new-api

↓ 10 callersFunctionCreateLoginSession
(userID int, loginMethod, ip, userAgent string)
service/auth_session.go:45
↓ 10 callersFunctionCreateUserSession
(session *UserSession)
model/user_session.go:133
↓ 10 callersFunctionDeleteToolPriceForTest
DeleteToolPriceForTest removes an injected tool price and rebuilds the index. Tests only.
setting/operation_setting/tools.go:231
↓ 10 callersFunctionDone
(c *gin.Context)
relay/helper/common.go:136
↓ 10 callersFunctionFlushWriter
(c *gin.Context)
relay/helper/common.go:17
↓ 10 callersFunctionGetAuthHeader
GetAuthHeader get auth header
controller/channel-billing.go:138
↓ 10 callersMethodGetErrorCode
()
relaykit/types/error.go:109
↓ 10 callersMethodGetFinalRequestRelayFormat
()
relay/common/relay_info.go:671
↓ 10 callersMethodGetRequestURL
(info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:189
↓ 10 callersFunctionGetResponseBody
(method, url string, channel *model.Channel, headers http.Header)
controller/channel-billing.go:152
↓ 10 callersFunctionGetTaskAdaptor
(platform constant.TaskPlatform)
relay/relay_adaptor.go:188
↓ 10 callersFunctionGetTaskPluginVersion
(key, version string)
model/task_plugin.go:95
↓ 10 callersMethodHasErrors
()
relay/common/stream_status.go:70
↓ 10 callersFunctionInitHttpClient
()
service/http_client.go:139
↓ 10 callersFunctionLockOrder
LockOrder 尝试对给定订单号加锁
controller/topup.go:363
↓ 10 callersFunctionLogQuota
(quota int)
logger/logger.go:125
↓ 10 callersMethodMarshalJSONString
()
types/rw_map.go:94
↓ 10 callersFunctionNewOAuthError
NewOAuthError creates a new OAuth error with the given message key
oauth/types.go:45
↓ 10 callersFunctionNewOAuthErrorWithRaw
NewOAuthErrorWithRaw creates a new OAuth error with raw error message for logging
oauth/types.go:53
↓ 10 callersFunctionNewStreamScanner
(reader io.Reader)
relay/helper/stream_scanner.go:43
↓ 10 callersFunctionPostTextConsumeQuota
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.Usage, extraContent []string)
service/text_quota.go:397
↓ 10 callersFunctionRebuildToolPriceIndex
RebuildToolPriceIndex rebuilds the lookup index from the current config. Called on init and after config updates. Not on the billing hot path.
setting/operation_setting/tools.go:149
↓ 10 callersFunctionResponsesRequestToChatCompletionsRequest
(req *dto.OpenAIResponsesRequest)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:27
↓ 10 callersMethodSetData
(data any)
model/task.go:74
↓ 10 callersFunctionSetDatabaseTypes
(mainType DatabaseType, logType DatabaseType)
common/database.go:31
↓ 10 callersMethodSetEnabled
(enabled bool)
pkg/jsplugin/registry.go:455
↓ 10 callersMethodSetEndReason
(reason StreamEndReason, err error)
relay/common/stream_status.go:45
↓ 10 callersMethodSetGenerationPreparer
(preparer RoutingGenerationPreparer)
pkg/jsplugin/registry.go:607
↓ 10 callersMethodSetOverrideEnabled
(enabled bool)
pkg/jsplugin/registry.go:477
↓ 10 callersMethodSize
Size 获取数据大小
common/body_storage.go:20
↓ 10 callersMethodSnapshot
()
model/task.go:488
↓ 10 callersFunctionTaskErrorWrapperLocal
(err error, code string, statusCode int)
service/error.go:194
↓ 10 callersMethodTotalErrorCount
()
relay/common/stream_status.go:79
↓ 10 callersFunctionUnlockOrder
UnlockOrder 释放给定订单号的锁
controller/topup.go:378
↓ 10 callersFunctionaddNewRecord
(type_ int, id int, value int)
model/utils.go:44
↓ 10 callersFunctionadvancedCustomGinContext
(path string)
relay/channel/advancedcustom/adaptor_test.go:850
↓ 10 callersMethodclose
()
web/src/features/playground/hooks/use-stream-request.test.ts:50
↓ 10 callersFunctioncreateSectionRegistry
(config: SectionRegistryConfig<TSectionId, TSettings, TExtraArgs>)
web/src/features/system-settings/utils/section-registry.ts:49
↓ 10 callersFunctiondecodeAPIResponse
(t *testing.T, recorder *httptest.ResponseRecorder)
controller/token_test.go:208
↓ 10 callersFunctionexecuteTaskSubmissionWith
( c *gin.Context, relayInfo *relaycommon.RelayInfo, submit taskSubmitAttempt, )
controller/relay.go:570
↓ 10 callersFunctiongetServerErrorMessageKey
(value: unknown)
web/src/lib/server-error-message.ts:51
↓ 10 callersFunctioninsertUserForPaymentGuardTest
(t *testing.T, id int, quota int)
model/payment_method_guard_test.go:12
↓ 10 callersFunctionmustRawMessage
(t *testing.T, value any)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req_test.go:353
↓ 10 callersFunctionnewAPIErrorFromParamOverride
(err error)
relay/param_override_error.go:8
↓ 10 callersFunctionperformHeaderNavRequest
(t *testing.T, handler gin.HandlerFunc, authenticated bool)
middleware/header_nav_test.go:39
↓ 10 callersFunctionprocessHeaderOverride
processHeaderOverride applies channel header overrides, with placeholder substitution. Supported placeholders: - {api_key}: resolved to the channel AP
relay/channel/api_request.go:196
↓ 10 callersFunctionrawJSONPresent
(raw json.RawMessage)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:561
↓ 10 callersFunctionresetPricingEndpointTestTables
(t *testing.T)
model/pricing_endpoint_test.go:14
↓ 10 callersFunctionroutingProtocolExport
(name string)
pkg/jsplugin/routing_test.go:1040
↓ 10 callersFunctionsetupUserUpdateTestState
(t *testing.T)
model/user_update_test.go:15
↓ 10 callersFunctionsideDrawerFooterClassName
(className?: string)
web/src/components/drawer-layout.ts:42
↓ 10 callersFunctiontriggerRefresh
()
web/src/features/users/components/users-provider.tsx:41
↓ 10 callersFunctionuseSearch
()
web/src/context/search-provider.tsx:57
↓ 9 callersFunctionBuildTieredTokenParams
BuildTieredTokenParams constructs billingexpr.TokenParams from a dto.Usage, normalizing P and C so they mean "tokens not separately priced by the expr
service/tiered_settle.go:25
↓ 9 callersMethodCloseIdleConnections
()
service/http_transport_sharded.go:97
↓ 9 callersFunctionConvertRequest
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, request any)
service/request_converter.go:26
↓ 9 callersFunctionDefaultPluginProtocolLimits
()
relay/plugin_protocol.go:41
↓ 9 callersMethodDialContext
(ctx context.Context, network, addr string)
service/protected_fetch_client.go:170
↓ 9 callersFunctionDistribute
()
middleware/distributor.go:34
↓ 9 callersFunctionGetBodyStorage
GetBodyStorage 获取请求体存储对象(用于需要多次读取的场景)
common/gin.go:86
↓ 9 callersMethodGetByChannelType
(channelType int)
pkg/jsplugin/registry.go:445
↓ 9 callersFunctionGetChannelAffinitySetting
()
setting/operation_setting/channel_affinity_setting.go:156
↓ 9 callersFunctionGetJsonString
(data any)
common/str.go:103
↓ 9 callersFunctionGetPasskeySettings
()
setting/system_setting/passkey.go:35
↓ 9 callersMethodGetReasoningContent
()
relaykit/dto/openai_request.go:462
↓ 9 callersFunctionGetTokenByKey
(key string, fromDB bool)
model/token.go:280
↓ 9 callersFunctionGetUserQuota
GetUserQuota gets quota from Redis first, falls back to DB if needed
model/user.go:1182
↓ 9 callersFunctionInitSessionCookieSettings
()
common/session_cookie.go:44
↓ 9 callersFunctionIsPaymentComplianceConfirmed
()
setting/operation_setting/payment_setting.go:33
↓ 9 callersMethodIsStringContent
()
relaykit/dto/claude.go:126
↓ 9 callersMethodJSValue
()
pkg/jsplugin/routing.go:244
↓ 9 callersMethodKeys
Keys returns keys with valid values. In Redis, it returns all matching keys.
pkg/cachex/hybrid_cache.go:132
↓ 9 callersMethodLoadFromDB
LoadFromDB 从数据库加载配置
setting/config/config.go:42
↓ 9 callersMethodLookupEndpointCandidates
LookupEndpointCandidates returns every legacy provider implementation that can serve one shared model endpoint. Candidate order is deterministic and t
pkg/jsplugin/routing.go:471
↓ 9 callersFunctionNewStreamStatus
()
relay/common/stream_status.go:41
↓ 9 callersFunctionPassword2Hash
(password string)
common/crypto.go:23
↓ 9 callersFunctionRecalculateTaskQuota
RecalculateTaskQuota 通用的异步差额结算。 actualQuota 是任务完成后的实际应扣额度,与预扣额度 (task.Quota) 做差额结算。 reason 用于日志记录(例如 "token重算" 或 "adaptor调整")。 clamps 可选:若计算 actualQuo
service/task_billing.go:264
↓ 9 callersFunctionRefundTaskQuota
RefundTaskQuota 统一的任务失败退款逻辑。 当异步任务失败时,退还资金与令牌额度,并回减用户和渠道用量。 返回资金来源是否已成功退还;失败时保留 quota,供显式重试或人工对账。
service/task_billing.go:216
↓ 9 callersFunctionRevokeAllUserSessions
(userID int, reason string)
model/user_session.go:708
↓ 9 callersFunctionRouteTag
(tag string)
middleware/logger.go:12
↓ 9 callersFunctionStringData
(c *gin.Context, str string)
relay/helper/common.go:97
↓ 9 callersFunctionT
T translates a message key using the language from gin context
i18n/i18n.go:90
↓ 9 callersMethodToOpenAIError
()
relaykit/types/error.go:180
↓ 9 callersFunctionTokenAuth
()
middleware/auth.go:354
↓ 9 callersMethodType
()
service/system_task.go:35
↓ 9 callersFunctionUpdateMaxTokenAutoGroups
(value string)
setting/auto_group.go:63
↓ 9 callersMethodUpdateWithStatus
UpdateWithStatus performs a conditional UPDATE guarded by fromStatus (CAS). Returns (true, nil) if this caller won the update, (false, nil) if another
model/task.go:519
↓ 9 callersFunctionUsedVars
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:273
↓ 9 callersFunctionUserSubject
UserSubject is the casbin subject string for a single user.
service/authz/permission.go:20
↓ 9 callersFunctionValidateV1Meta
ValidateV1Meta applies the metadata constraints published in docs/plugin-api/v1.schema.json to administrator uploads.
pkg/jsplugin/registry.go:1081
↓ 9 callersFunctionfetchChannelUpstreamModelIDs
(channel *model.Channel)
controller/channel_upstream_update.go:364
↓ 9 callersFunctiongetChannelAffinityCache
()
service/channel_affinity.go:81
↓ 9 callersFunctiongetUserAuthFenceKey
(userId int)
model/user_auth_cache.go:26
↓ 9 callersFunctioninsertPricingEndpointAbility
(t *testing.T, channelID int, modelName string)
model/pricing_endpoint_test.go:49
↓ 9 callersFunctionisAuthBundle
(value: unknown)
web/src/lib/auth-session.ts:129
↓ 9 callersFunctionnewPluginGenerationBuilder
(staticRoutes []gin.RouteInfo, trustedProxies []string, handlers pluginRouteHandlers)
router/plugin-router.go:68
↓ 9 callersFunctionparseQuotaFromDollars
(amount: number)
web/src/lib/format.ts:84
↓ 9 callersFunctionpopulateUserCache
(user User)
model/user_cache.go:70
↓ 9 callersFunctionrecordManageAuditFor
recordManageAuditFor 记录一条管理审计日志,日志归属于操作者;targetUserId 只表示被操作用户,用于在结构化参数中保留目标上下文。
controller/audit.go:99
↓ 9 callersFunctionretrieveTaskPluginResponse
(c *gin.Context, deps pluginProtocolBridgeDeps)
controller/plugin_protocol.go:929
← previousnext →301–400 of 10,934, ranked by callers