MCPcopy Create free account

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

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

↓ 20 callersFunctionlockForUpdate
lockForUpdate makes the next query emit SELECT ... FOR UPDATE so the matched rows stay locked until the surrounding transaction ends. GORM v2 silentl
model/locking.go:20
↓ 20 callersFunctionrecordManageAudit
recordManageAudit 记录一条由操作者本人归属的管理/高危审计日志(资源类操作: 渠道 / 系统设置 / 兑换码等)。content 由 action+params 自动渲染。
controller/audit.go:93
↓ 19 callersFunctionCreateSystemTask
(taskType string, payload any, state any)
model/system_task.go:92
↓ 19 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:42
↓ 19 callersMethodExists
(prefix string, path string)
common/embed-file-system.go:18
↓ 19 callersFunctionadvancedCustomRelayInfo
(config *dto.AdvancedCustomConfig)
relay/channel/advancedcustom/adaptor_test.go:651
↓ 19 callersFunctioncompareObjects
(oldObject, newObject)
web/classic/src/helpers/utils.jsx:314
↓ 19 callersFunctiongetCurrencyConfig
()
web/classic/src/helpers/render.jsx:1087
↓ 18 callersMethodAddOtherRatio
(key string, ratio float64)
types/price_data.go:35
↓ 18 callersFunctionGetEnvOrDefault
(env string, defaultValue int)
common/env.go:9
↓ 18 callersMethodSetItems
(items any)
common/page_info.go:37
↓ 18 callersMethodSetTotal
(total int)
common/page_info.go:33
↓ 18 callersFunctionTaskErrorWrapper
(err error, code string, statusCode int)
service/error.go:193
↓ 18 callersFunctionUnmarshalBodyReusable
(c *gin.Context, v any)
common/gin.go:108
↓ 18 callersFunctionsafeJsonParseWithValidation
( value: string | undefined | null, options: SafeJsonParseWithValidationOptions<T> )
web/default/src/features/system-settings/utils/json-parser.ts:141
↓ 18 callersFunctionuseChannels
()
web/default/src/features/channels/components/channels-provider.tsx:145
↓ 17 callersMethodCopy
()
dto/openai_response.go:186
↓ 17 callersMethodDone
Done signals that the handler has finished processing normally (e.g., Dify "message_end"). The stream stops after this chunk.
relay/helper/stream_result.go:39
↓ 17 callersMethodWrite
(b []byte)
middleware/audit.go:24
↓ 17 callersFunctionmakeTask
(userId, channelId, quota, tokenId int, billingSource string, subscriptionId int)
service/task_billing_test.go:118
↓ 17 callersFunctionstringToColor
(str)
web/classic/src/helpers/render.jsx:729
↓ 16 callersFunctionNewOpenAIVideo
()
dto/openai_video.go:43
↓ 16 callersMethodParseContent
()
dto/claude.go:169
↓ 16 callersMethodParseToolCalls
()
dto/openai_request.go:465
↓ 16 callersMethodStop
Stop records a fatal error and marks the stream to stop after this chunk.
relay/helper/stream_result.go:29
↓ 16 callersFunctioncalculateTextQuotaSummary
calculateTextQuotaSummary expects a usage already remapped by effectiveBillingUsage; PostTextConsumeQuota performs that remap once and shares the resu
service/text_quota.go:181
↓ 16 callersFunctiongetCurrencyDisplay
()
web/default/src/lib/currency.ts:345
↓ 16 callersFunctionseedUser
(t *testing.T, id int, quota int)
service/task_billing_test.go:78
↓ 16 callersFunctionsetupStreamTest
(t *testing.T, body io.Reader)
relay/helper/stream_scanner_test.go:31
↓ 16 callersFunctionsideDrawerContentClassName
(className?: string)
web/default/src/components/drawer-layout.ts:24
↓ 16 callersFunctionupdateOptions
(options)
web/classic/src/components/settings/SystemSetting.jsx:245
↓ 16 callersFunctionuseCopyToClipboard
(options?: UseCopyToClipboardOptions)
web/default/src/hooks/use-copy-to-clipboard.ts:36
↓ 15 callersMethodDoResponse
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo)
relay/channel/adapter.go:27
↓ 15 callersMethodError
Error records a soft error. The stream continues processing. Can be called multiple times per chunk.
relay/helper/stream_result.go:21
↓ 15 callersFunctionFinishSystemTask
(taskID string, lockedBy string, status SystemTaskStatus, resultPayload any, errorMessage string)
model/system_task.go:383
↓ 15 callersFunctionGetHttpClient
GetHttpClient returns the general outbound client used by relay/provider integrations. Do not attach the SSRF-protected dialer here: provider base URL
service/http_client.go:90
↓ 15 callersFunctionNormalizeEmail
(email string)
model/user.go:204
↓ 15 callersMethodOtherRatios
()
types/price_data.go:58
↓ 15 callersFunctionRelayErrorHandler
(ctx context.Context, resp *http.Response, showBodyWhenFail bool)
service/error.go:86
↓ 15 callersMethodSeek
(offset int64, whence int)
common/body_storage.go:178
↓ 15 callersMethodUpdate
(updatePassword bool)
model/user.go:647
↓ 15 callersMethodValidate
()
dto/channel_settings.go:301
↓ 15 callersMethodWriteString
(s string)
relay/channel/openai/image_stream_test.go:196
↓ 15 callersMethodresolve
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:305
↓ 14 callersFunctionClaimSystemTask
(id int64, taskType string, runnerID string, lockUntil int64)
model/system_task.go:225
↓ 14 callersFunctionConvertRequest
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, request any)
service/relayconvert/request_registry.go:151
↓ 14 callersMethodGetOtherSettings
()
model/channel.go:990
↓ 14 callersFunctionGetQuotaDisplayType
GetQuotaDisplayType 返回额度展示类型
setting/operation_setting/general_setting.go:55
↓ 14 callersMethodInitChannelMeta
(c *gin.Context)
relay/common/relay_info.go:196
↓ 14 callersFunctionSetEventStreamHeaders
(c *gin.Context)
relay/helper/common.go:45
↓ 14 callersFunctionUnmarshalJsonStr
(data string, v any)
common/json.go:13
↓ 14 callersFunctiongetIoEnterpriseClient
(c *gin.Context)
controller/deployment.go:50
↓ 14 callersFunctiongetUserQuota
--------------------------------------------------------------------------- Read-back helpers --------------------------------------------------------
service/task_billing_test.go:245
↓ 14 callersFunctionsetOperationLoading
(operation, deploymentId, isLoading)
web/classic/src/hooks/model-deployments/useEnhancedDeploymentActions.jsx:27
↓ 14 callersFunctionsideDrawerFormClassName
(className?: string)
web/default/src/components/drawer-layout.ts:36
↓ 14 callersFunctionsideDrawerHeaderClassName
(className?: string)
web/default/src/components/drawer-layout.ts:30
↓ 14 callersFunctionuseDataTable
(options: UseDataTableOptions<TData>)
web/default/src/components/data-table/hooks/use-data-table.ts:277
↓ 13 callersFunctionComputeTieredQuota
ComputeTieredQuota runs the Expr from a frozen BillingSnapshot against actual token counts and returns the settlement result.
pkg/billingexpr/settle.go:17
↓ 13 callersFunctionConvertResponse
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, response any)
service/relayconvert/response_registry.go:204
↓ 13 callersMethodDoRequest
(c *gin.Context, info *relaycommon.RelayInfo, requestBody io.Reader)
relay/channel/adapter.go:26
↓ 13 callersMethodEncode
(v V)
pkg/cachex/codec.go:11
↓ 13 callersFunctionGetAdaptor
(apiType int)
relay/relay_adaptor.go:54
↓ 13 callersFunctionGetHttpClientWithProxy
GetHttpClientWithProxy returns the default client or a proxy-enabled one when proxyURL is provided.
service/http_client.go:104
↓ 13 callersFunctionGetJsonType
(data json.RawMessage)
common/json.go:25
↓ 13 callersMethodGetUpstreamTaskID
GetUpstreamTaskID 获取上游真实 task ID(用于与 provider 通信) 旧数据没有 UpstreamTaskID 时,TaskID 本身就是上游 ID
model/task.go:123
↓ 13 callersFunctionGetUserCache
GetUserCache gets complete user cache from hash
model/user_cache.go:101
↓ 13 callersFunctionResetStatusCode
(newApiErr *types.NewAPIError, statusCodeMappingStr string)
service/error.go:133
↓ 13 callersFunctionclose
()
web/default/src/features/channels/components/dialogs/ollama-models-dialog.tsx:364
↓ 13 callersFunctionnormalizeAdvancedCustomConfig
( config: AdvancedCustomConfig )
web/default/src/features/channels/lib/advanced-custom.ts:486
↓ 13 callersFunctionnormalizeModelNames
(models []string)
controller/channel_upstream_update.go:93
↓ 13 callersFunctionseedChannel
(t *testing.T, id int)
service/task_billing_test.go:112
↓ 13 callersFunctiontoBoolean
(value)
web/classic/src/helpers/boolean.js:20
↓ 12 callersFunctionCacheGetChannel
(id int)
model/channel_cache.go:239
↓ 12 callersFunctionCloneBillingUsage
(usage *BillingUsage)
dto/billing_usage.go:138
↓ 12 callersFunctionDecodeJson
(reader io.Reader, v any)
common/json.go:17
↓ 12 callersFunctionFormatMatchingModelName
转换模型名,减少渠道必须配置各种带参数模型
setting/ratio_setting/model_ratio.go:719
↓ 12 callersFunctionFormatQuota
(quota int)
logger/logger.go:149
↓ 12 callersFunctionGetGlobalSettings
()
setting/model_setting/global.go:62
↓ 12 callersFunctionGetTwoFAByUserId
GetTwoFAByUserId 根据用户ID获取2FA设置
model/twofa.go:39
↓ 12 callersFunctionIncreaseUserQuota
(id int, quota int, db bool)
model/user.go:1053
↓ 12 callersFunctionRecordLog
(userId int, logType int, content string)
model/log.go:144
↓ 12 callersMethodSetContentString
(s string)
dto/openai_response.go:96
↓ 12 callersFunctionSetContextKey
(c *gin.Context, key constant.ContextKey, value any)
common/gin.go:157
↓ 12 callersMethodSetToolCalls
(toolCalls any)
dto/openai_request.go:476
↓ 12 callersFunctionbuildSSEBody
(n int)
relay/helper/stream_scanner_test.go:49
↓ 12 callersFunctiongetLobeIcon
( iconName: string | undefined | null, size: number = 20 )
web/default/src/lib/lobe-icon.tsx:75
↓ 12 callersFunctionhasValue
(value)
web/classic/src/pages/Setting/Ratio/hooks/useModelPricingEditorState.js:59
↓ 12 callersFunctionmakeRelayInfo
(expr string, groupRatio float64, estPrompt, estCompletion int)
service/tiered_settle_test.go:40
↓ 11 callersFunctionCan
Can reports whether the subject may perform the permission. A superuser role short-circuits to allow. Otherwise a per-user override wins, then the uni
service/authz/resolver.go:8
↓ 11 callersMethodGetContentString
()
dto/openai_response.go:100
↓ 11 callersFunctionGetDBTimestamp
GetDBTimestamp returns a UNIX timestamp from database time. Falls back to application time on error.
model/db_time.go:7
↓ 11 callersFunctionGetGeminiSettings
GetGeminiSettings 获取Gemini配置
setting/model_setting/gemini.go:49
↓ 11 callersMethodGetMaxTokens
()
dto/openai_request.go:260
↓ 11 callersFunctionGetPointer
(v T)
common/utils.go:302
↓ 11 callersFunctionGetPricing
()
model/pricing.go:66
↓ 11 callersFunctionGetRandomString
(length int)
common/str.go:41
↓ 11 callersFunctionGetResponseBody
(method, url string, channel *model.Channel, headers http.Header)
controller/channel-billing.go:139
↓ 11 callersFunctionModelMappedHelper
(c *gin.Context, info *common.RelayInfo, request dto.Request)
relay/helper/model_mapped.go:16
↓ 11 callersFunctionNewClaudeMessagesBillingUsage
(usage *ClaudeUsage)
dto/billing_usage.go:23
↓ 11 callersFunctionObjectData
(c *gin.Context, object interface{})
relay/helper/common.go:125
← previousnext →101–200 of 10,602, ranked by callers