MCPcopy Create free account

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

Functions9,195 in github.com/QuantumNous/new-api

↓ 20 callersFunctionGetPageQuery
(c *gin.Context)
common/page_info.go:41
↓ 20 callersFunctionGetUserCache
GetUserCache gets complete user cache from hash
model/user_cache.go:94
↓ 20 callersFunctionUnmarshalJsonStr
(data string, v any)
common/json.go:13
↓ 20 callersFunctionrecordManageAudit
recordManageAudit 记录一条由操作者本人归属的管理/高危审计日志(资源类操作: 渠道 / 系统设置 / 兑换码等)。content 由 action+params 自动渲染。
controller/audit.go:93
↓ 20 callersFunctionseedUser
(t *testing.T, id int, quota int)
service/task_billing_test.go:78
↓ 19 callersMethodAddOtherRatio
(key string, ratio float64)
types/price_data.go:35
↓ 19 callersFunctionCreateSystemTask
(taskType string, payload any, state any)
model/system_task.go:92
↓ 19 callersMethodDecode
(s string)
pkg/cachex/codec.go:12
↓ 19 callersFunctionUnmarshalBodyReusable
(c *gin.Context, v any)
common/gin.go:108
↓ 19 callersMethodValidate
()
dto/channel_settings.go:321
↓ 19 callersFunctioncalculateTextQuotaSummary
calculateTextQuotaSummary expects a usage already remapped by effectiveBillingUsage; PostTextConsumeQuota performs that remap once and shares the resu
service/text_quota.go:231
↓ 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 callersMethodCopy
()
dto/openai_response.go:186
↓ 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:199
↓ 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 callersMethodGetOtherSettings
()
model/channel.go:1004
↓ 17 callersMethodParseToolCalls
()
dto/openai_request.go:465
↓ 17 callersMethodStop
Stop records a fatal error and marks the stream to stop after this chunk.
relay/helper/stream_result.go:29
↓ 17 callersFunctionclose
()
web/src/features/channels/components/dialogs/ollama-models-dialog.tsx:365
↓ 17 callersFunctiongetUserQuota
--------------------------------------------------------------------------- Read-back helpers --------------------------------------------------------
service/task_billing_test.go:245
↓ 17 callersFunctionsetupUserSessionTest
(t *testing.T)
model/user_session_test.go:43
↓ 16 callersMethodDoResponse
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo)
relay/channel/adapter.go:27
↓ 16 callersMethodEncode
(v V)
pkg/cachex/codec.go:11
↓ 16 callersFunctionNewOpenAIVideo
()
dto/openai_video.go:43
↓ 16 callersMethodParseContent
()
dto/claude.go:169
↓ 16 callersFunctionRelayErrorHandler
(ctx context.Context, resp *http.Response, showBodyWhenFail bool)
service/error.go:86
↓ 16 callersMethodRemove
Remove 从 Set 中移除一个元素
types/set.go:19
↓ 16 callersMethodWriteString
(s string)
relay/channel/openai/image_stream_test.go:196
↓ 16 callersFunctiongetCurrencyDisplay
()
web/src/lib/currency.ts:345
↓ 16 callersFunctionsetupModelListControllerTestDB
(t *testing.T)
controller/model_list_test.go:37
↓ 16 callersFunctionsetupStreamTest
(t *testing.T, body io.Reader)
relay/helper/stream_scanner_test.go:31
↓ 16 callersFunctionsideDrawerContentClassName
(className?: string)
web/src/components/drawer-layout.ts:24
↓ 16 callersFunctionuseCopyToClipboard
(options?: UseCopyToClipboardOptions)
web/src/hooks/use-copy-to-clipboard.ts:36
↓ 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 callersFunctionGetSessionAuthIdentity
GetSessionAuthIdentity returns only identities backed by a live dashboard session. PAT-authenticated requests intentionally fail this check.
middleware/auth.go:123
↓ 15 callersMethodInitChannelMeta
(c *gin.Context)
relay/common/relay_info.go:196
↓ 15 callersFunctionNormalizeEmail
(email string)
model/user.go:264
↓ 15 callersMethodOtherRatios
()
types/price_data.go:58
↓ 15 callersMethodSeek
(offset int64, whence int)
common/body_storage.go:178
↓ 15 callersMethodUpdate
(updatePassword bool)
model/user.go:705
↓ 15 callersFunctionnewTestUserSession
(sid string, userID int, now int64)
model/user_session_test.go:82
↓ 14 callersFunctionClaimSystemTask
(id int64, taskType string, runnerID string, lockUntil int64)
model/system_task.go:225
↓ 14 callersMethodClose
()
common/body_storage.go:187
↓ 14 callersFunctionConvertRequest
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, request any)
service/relayconvert/request_registry.go:151
↓ 14 callersMethodDoRequest
(c *gin.Context, info *relaycommon.RelayInfo, requestBody io.Reader)
relay/channel/adapter.go:26
↓ 14 callersFunctionGetAdaptor
(apiType int)
relay/relay_adaptor.go:55
↓ 14 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:124
↓ 14 callersFunctionGetJsonType
(data json.RawMessage)
common/json.go:25
↓ 14 callersFunctionGetQuotaDisplayType
GetQuotaDisplayType 返回额度展示类型
setting/operation_setting/general_setting.go:55
↓ 14 callersFunctionResetStatusCode
(newApiErr *types.NewAPIError, statusCodeMappingStr string)
service/error.go:139
↓ 14 callersFunctionSetEventStreamHeaders
(c *gin.Context)
relay/helper/common.go:45
↓ 14 callersFunctiongetIoEnterpriseClient
(c *gin.Context)
controller/deployment.go:50
↓ 14 callersFunctionnormalizeAdvancedCustomConfig
( config: AdvancedCustomConfig )
web/src/features/channels/lib/advanced-custom.ts:498
↓ 14 callersFunctionnormalizeModelNames
(models []string)
controller/channel_upstream_update.go:100
↓ 14 callersFunctionsideDrawerFormClassName
(className?: string)
web/src/components/drawer-layout.ts:36
↓ 14 callersFunctionsideDrawerHeaderClassName
(className?: string)
web/src/components/drawer-layout.ts:30
↓ 14 callersFunctionuseDataTable
(options: UseDataTableOptions<TData>)
web/src/components/data-table/hooks/use-data-table.ts:278
↓ 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 callersFunctionCreateAuthFlow
(input AuthFlowCreate)
model/auth_flow.go:96
↓ 13 callersFunctionGetAuthFlow
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:161
↓ 13 callersMethodGetUpstreamTaskID
GetUpstreamTaskID 获取上游真实 task ID(用于与 provider 通信) 旧数据没有 UpstreamTaskID 时,TaskID 本身就是上游 ID
model/task.go:127
↓ 13 callersFunctionIncrementUserAuthVersionWithTx
IncrementUserAuthVersionWithTx locks the user, publishes the next deny fence, then persists the version in the caller's transaction. Unscoped is inten
model/user_auth_cache.go:180
↓ 13 callersMethodcacheEntry
()
model/user_session.go:87
↓ 13 callersMethodclose
()
web/src/features/playground/hooks/use-stream-request.test.ts:51
↓ 13 callersMethodremove
(cacheKey string)
service/http_client.go:208
↓ 13 callersFunctionseedChannel
(t *testing.T, id int)
service/task_billing_test.go:112
↓ 13 callersFunctionuseUserCacheMiniRedis
(t *testing.T)
model/user_cache_auth_version_test.go:17
↓ 13 callersFunctionwriteUserSessionCache
writeUserSessionCache writes a bounded Session snapshot. Active snapshots must carry a deadline captured immediately before their authoritative databa
model/user_session.go:276
↓ 12 callersFunctionCacheGetChannel
(id int)
model/channel_cache.go:239
↓ 12 callersFunctionCloneBillingUsage
(usage *BillingUsage)
dto/billing_usage.go:138
↓ 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 callersFunctionIncreaseUserQuota
(id int, quota int, db bool)
model/user.go:1232
↓ 12 callersFunctionModelMappedHelper
(c *gin.Context, info *common.RelayInfo, request dto.Request)
relay/helper/model_mapped.go:16
↓ 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 callersFunctiongenBaseRelayInfo
(c *gin.Context, request dto.Request)
relay/common/relay_info.go:441
↓ 12 callersFunctiongetLobeIcon
( iconName: string | undefined | null, size: number = 20 )
web/src/lib/lobe-icon.tsx:82
↓ 12 callersFunctiongetTokenRemainQuota
(t *testing.T, id int)
service/task_billing_test.go:252
↓ 12 callersFunctionmakeRelayInfo
(expr string, groupRatio float64, estPrompt, estCompletion int)
service/tiered_settle_test.go:40
↓ 12 callersFunctionsafeJsonParse
( value: string | undefined | null, options: SafeJsonParseOptions<T> = {} )
web/src/features/system-settings/utils/json-parser.ts:113
↓ 12 callersFunctionseedToken
(t *testing.T, id int, userId int, key string, remainQuota int)
service/task_billing_test.go:84
↓ 12 callersFunctionuseTestSessionSecret
(t *testing.T)
service/auth_token_test.go:14
↓ 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:51
↓ 11 callersMethodGetMaxTokens
()
dto/openai_request.go:260
↓ 11 callersFunctionGetPointer
(v T)
common/utils.go:302
↓ 11 callersFunctionGetPricing
()
model/pricing.go:66
← previousnext →101–200 of 9,195, ranked by callers