MCPcopy Create free account

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

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

↓ 11 callersMethodGetText
()
relaykit/dto/claude.go:56
↓ 11 callersFunctionGetTwoFAByUserId
GetTwoFAByUserId 根据用户ID获取2FA设置
model/twofa.go:39
↓ 11 callersFunctionGetUUID
()
relaykit/relayconvert/kitutil/value.go:44
↓ 11 callersFunctionGetUserGroup
GetUserGroup gets group from Redis first, falls back to DB if needed
model/user.go:1205
↓ 11 callersMethodHasErrors
()
relay/common/stream_status.go:70
↓ 11 callersMethodIsStringContent
()
relaykit/dto/claude.go:140
↓ 11 callersFunctionNewGeminiChatBillingUsage
(metadata *GeminiUsageMetadata)
relaykit/dto/billing_usage.go:116
↓ 11 callersFunctionObjectData
(c *gin.Context, object interface{})
relay/helper/common.go:125
↓ 11 callersFunctionPublishUserAuthCache
PublishUserAuthCache refreshes the current database state after a successful auth-sensitive transaction without touching the cached quota field.
model/user_auth_cache.go:229
↓ 11 callersMethodRecordConversionDiagnostics
RecordConversionDiagnostics retains conversion losses for the consume log and emits one request-correlated warning per distinct diagnostic. The cap pr
relay/common/conversion_diagnostics.go:25
↓ 11 callersMethodRender
(w http.ResponseWriter)
common/custom-event.go:72
↓ 11 callersFunctionSendEmail
(subject string, receiver string, content string)
common/email.go:78
↓ 11 callersFunctionSetDatabaseTypes
(mainType DatabaseType, logType DatabaseType)
common/database.go:31
↓ 11 callersMethodSetDisabledFactoryKeys
(keys []string)
pkg/jsplugin/registry.go:496
↓ 11 callersMethodSetEndReason
(reason StreamEndReason, err error)
relay/common/stream_status.go:45
↓ 11 callersMethodTotalErrorCount
()
relay/common/stream_status.go:79
↓ 11 callersMethodUpdateBalance
(balance float64)
model/channel.go:615
↓ 11 callersFunctionUpdateChannelUsedQuota
(id int, quota int)
model/channel.go:886
↓ 11 callersMethodWriteString
(s string)
middleware/audit.go:36
↓ 11 callersFunctioncleanupTaskPluginControllerRuntime
(t *testing.T, key string)
controller/task_plugin_test.go:63
↓ 11 callersMethodclose
()
common/email_test.go:97
↓ 11 callersMethodevent
(eventType string, payload dto.ResponsesStreamResponse)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_stream_resp.go:855
↓ 11 callersFunctionformatCurrencyFromUSD
( amountUSD: number | null | undefined, options?: CurrencyFormatOptions )
web/src/lib/currency.ts:408
↓ 11 callersFunctiongetUserCacheKey
getUserCacheKey returns the key for user cache
model/user_cache.go:50
↓ 11 callersFunctionnewAPIErrorFromParamOverride
(err error)
relay/param_override_error.go:8
↓ 11 callersFunctionnormalizeIntent
(intent Intent)
relaykit/relayconvert/reasoning/intent.go:136
↓ 11 callersFunctionregisterTestPlugin
(registry *Registry, version string, factory bool)
pkg/jsplugin/registry_test.go:492
↓ 11 callersFunctionrequirePaymentCompliance
(c *gin.Context)
controller/payment_compliance.go:22
↓ 11 callersMethodresolve
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:367
↓ 11 callersFunctionresponseSemanticLoss
(path string, code string, message string)
relaykit/relayconvert/internal/toolconv/response.go:509
↓ 11 callersFunctionsetupAuthSessionTestDB
(t *testing.T)
service/auth_session_test.go:22
↓ 11 callersFunctionsetupOriginTaskDB
(t *testing.T)
middleware/task_plugin_origin_task_test.go:28
↓ 11 callersFunctiontaskProtocolPluginSource
(key, version, models, endpoint, parseRequestBody string)
middleware/task_plugin_test.go:1630
↓ 11 callersFunctionuseSidebar
()
web/src/components/ui/sidebar.tsx:67
↓ 11 callersFunctionuseTheme
()
web/src/context/theme-provider.tsx:141
↓ 11 callersFunctionwithHeaderNavModules
(t *testing.T, raw string)
middleware/header_nav_test.go:17
↓ 11 callersFunctionwithSMTPSettings
(t *testing.T)
common/email_test.go:243
↓ 10 callersMethodAddPin
(p ChannelPin)
dto/channel_constraints.go:55
↓ 10 callersFunctionApplyParamOverrideWithRelayInfo
(jsonData []byte, info *RelayInfo)
relay/common/override.go:184
↓ 10 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
↓ 10 callersFunctionCreateLoginSession
(userID int, loginMethod, ip, userAgent string)
service/auth_session.go:52
↓ 10 callersFunctionCreateUserSession
(session *UserSession)
model/user_session.go:133
↓ 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 callersMethodGetFinalRequestRelayFormat
()
relay/common/relay_info.go:708
↓ 10 callersMethodGetOriginModelName
()
relaykit/relayconvert/convmeta/meta.go:19
↓ 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 callersMethodJSONString
JSONString returns the complete stored representation, including all privileged scopes. API projections must use the role-specific formatter.
model/log_other.go:170
↓ 10 callersMethodLoadFromDB
LoadFromDB 从数据库加载配置
setting/config/config.go:42
↓ 10 callersFunctionLockOrder
LockOrder 尝试对给定订单号加锁
controller/topup.go:363
↓ 10 callersFunctionLogQuota
(quota int)
logger/logger.go:125
↓ 10 callersMethodMarshalJSONString
()
types/rw_map.go:94
↓ 10 callersFunctionMergeUsageNonZero
MergeUsageNonZero overlays usage snapshots: a later non-zero field overwrites the current value, while a later zero value never erases an earlier posi
relaykit/dto/usage_merge.go:12
↓ 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 callersFunctionNewStreamStatus
()
relay/common/stream_status.go:41
↓ 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 callersFunctionRefundTaskQuota
RefundTaskQuota 统一的任务失败退款逻辑。 当异步任务失败时,退还资金与令牌额度,并回减用户和渠道用量。 返回资金来源是否已成功退还;失败时保留 quota,供显式重试或人工对账。
service/task_billing.go:213
↓ 10 callersFunctionResponsesRequestToChatCompletionsRequest
(req *dto.OpenAIResponsesRequest)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:28
↓ 10 callersMethodSetAdmin
(key string, value any)
model/log_other.go:77
↓ 10 callersMethodSetData
(data any)
model/task.go:74
↓ 10 callersMethodSetEnabled
(enabled bool)
pkg/jsplugin/registry.go:455
↓ 10 callersMethodSetGenerationPreparer
(preparer RoutingGenerationPreparer)
pkg/jsplugin/registry.go:607
↓ 10 callersMethodSetOverrideEnabled
(enabled bool)
pkg/jsplugin/registry.go:477
↓ 10 callersFunctionShouldPreserveThinkingSuffix
ShouldPreserveThinkingSuffix reports whether the full model name is exempt from host thinking-suffix and @-modifier parsing. Exact blacklist entries m
setting/model_setting/global.go:146
↓ 10 callersMethodSize
Size 获取数据大小
common/body_storage.go:20
↓ 10 callersFunctionT
T translates a message key using the language from gin context
i18n/i18n.go:90
↓ 10 callersFunctionTaskErrorWrapperLocal
(err error, code string, statusCode int)
service/error.go:194
↓ 10 callersFunctionUnlockOrder
UnlockOrder 释放给定订单号的锁
controller/topup.go:378
↓ 10 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
↓ 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:590
↓ 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 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:564
↓ 10 callersFunctionresetPricingEndpointTestTables
(t *testing.T)
model/pricing_endpoint_test.go:14
↓ 10 callersFunctionroutingProtocolExport
(name string)
pkg/jsplugin/routing_test.go:1040
↓ 10 callersFunctionseedTaskPollingChannel
(t *testing.T, id int, disableSleep bool)
service/task_polling_test.go:163
↓ 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 callersMethodBuildRequestBody
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/adapter.go:69
↓ 9 callersMethodCloseIdleConnections
()
service/http_transport_sharded.go:97
↓ 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
← previousnext →301–400 of 11,560, ranked by callers