MCPcopy Create free account

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

Functions15,409 in github.com/QuantumNous/new-api

↓ 5 callersFunctionSetUserPermissionsInTx
(tx *gorm.DB, userID int, permissions PermissionsMap)
service/authz/override.go:42
↓ 5 callersFunctionSetVideoRouter
(router *gin.Engine)
router/video-router.go:10
↓ 5 callersFunctionSetupContextForToken
(c *gin.Context, token *model.Token, parts ...string)
middleware/auth.go:673
↓ 5 callersFunctionSha1
(data []byte)
common/hash.go:22
↓ 5 callersFunctionShouldSkipRetryAfterChannelAffinityFailure
(c *gin.Context)
service/channel_affinity.go:633
↓ 5 callersMethodSkippedRoutes
SkippedRoutes returns the declared top-level routes the gateway does not register.
pkg/jsplugin/routing.go:695
↓ 5 callersFunctionSmokeTestTaskExpr
SmokeTestTaskExpr validates a task usage expression against the usage facts declared by its plugin. Literal u() keys must be declared; dynamic calls a
setting/billing_setting/tiered_billing.go:249
↓ 5 callersFunctionStreamResponseOpenAI2Claude
(openAIResponse *dto.ChatCompletionsStreamResponse, info convmeta.Meta)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_resp.go:112
↓ 5 callersFunctionSubmitIngress
SubmitIngress takes the execution plan of a task or Midjourney submission and runs the ingress stage on its stored client body, once, before the body
relay/requestplugin/relay.go:65
↓ 5 callersMethodSummary
()
relay/common/stream_status.go:218
↓ 5 callersMethodSupportedEndpointTypesForModel
(model string)
relaykit/dto/channel_settings.go:333
↓ 5 callersFunctionSyncTaskPluginsOnceContext
SyncTaskPluginsOnceContext loads the enabled plugin rows into the registry and records the ones this node runs differently from the database as the pl
controller/task_plugin.go:1026
↓ 5 callersFunctionTaskPriceExpr
TaskPriceExpr reports whether expression can be a plugin's task price. An expression reading chat request quantities cannot. A plugin's own price alwa
setting/billing_setting/tiered_billing.go:155
↓ 5 callersMethodToFileSource
()
relaykit/dto/gemini.go:265
↓ 5 callersFunctionTryReserveUserQuota
TryReserveUserQuota atomically checks and deducts a user's wallet quota. 缓存命中时以缓存余额为准(避免批量模式下过期的数据库余额放大并发超扣); Redis 异常或水合失败时降级为数据库条件更新,保证服务可用。
model/quota_reserve.go:164
↓ 5 callersMethodUpdate
()
model/subscription.go:249
↓ 5 callersFunctionUpdateOptionsBulk
UpdateOptionsBulk persists multiple key/value pairs in a single database transaction, then dispatches them through updateOptionMap in one pass. If any
model/option.go:323
↓ 5 callersFunctionUpdatePasskeyAssertionState
UpdatePasskeyAssertionState persists only fields produced by a successful assertion. Registration identity (credential ID, public key, AAGUID, transpo
model/passkey.go:165
↓ 5 callersFunctionUpdateSystemTaskState
(taskID string, lockedBy string, state any)
model/system_task.go:449
↓ 5 callersMethodUsageForModels
UsageForModels returns the usage metadata of the first candidate that a profile declares. Runtime callers pass the final upstream model before the cli
pkg/jsplugin/registry.go:337
↓ 5 callersFunctionUsageFromGeminiMetadata
(metadata *dto.GeminiUsageMetadata, fallbackPromptTokens int)
relaykit/relayconvert/response_compat.go:136
↓ 5 callersFunctionUsedVarsByHash
UsedVarsByHash reuses the digest captured by the host's billing snapshot.
pkg/billingexpr/compile.go:301
↓ 5 callersFunctionUsesChatQuantities
UsesChatQuantities reports whether an expression reads a chat request quantity, including in branches the current request would not evaluate.
pkg/billingexpr/compile.go:332
↓ 5 callersFunctionUsesFixedPricing
UsesFixedPricing includes unselected branches, even when compilation later optimizes them away. Hosts use it to reject unsupported billing entrances.
pkg/billingexpr/fixed.go:12
↓ 5 callersFunctionValidateConsoleSettings
(settingsStr string, settingType string)
setting/console_setting/validation.go:88
↓ 5 callersFunctionValidateModelPricing
(name string, values PricingValues)
model/model_pricing_config.go:486
↓ 5 callersMethodValidateSettings
()
model/channel.go:1160
↓ 5 callersFunctionValidateWalletQuota
ValidateWalletQuota enforces the upper bound shared by wallet mutations. Negative balances remain valid because billing can temporarily overdraw a wal
common/quota_math.go:22
↓ 5 callersMethodWriteHeaders
(originModel string, httpHeader *http.Header)
setting/model_setting/claude.go:53
↓ 5 callersFunctionadd
(tag: string)
web/src/lib/localized-text.ts:67
↓ 5 callersFunctionadminUserRequest
adminUserRequest drives an admin user-management handler with the operator context that AdminAuth would have populated for a dashboard session.
controller/admin_user_verification_test.go:34
↓ 5 callersMethodapply
(tx *gorm.DB)
model/log.go:495
↓ 5 callersFunctionapplyFetchModelsHeaderOverrides
(channel *model.Channel, key string, headers http.Header)
controller/channel.go:333
↓ 5 callersFunctionapplyUsagePostProcessing
(info *relaycommon.RelayInfo, usage *dto.Usage, responseBody []byte)
relay/channel/openai/usage.go:10
↓ 5 callersFunctionattachmentInstance
(id, config string)
relay/requestplugin/attachments_test.go:60
↓ 5 callersFunctionauditRequest
(router http.Handler, method, path, token string)
controller/access_token_audit_test.go:63
↓ 5 callersFunctionauthCacheMAC
authCacheMAC binds cache metadata to its purpose and Redis key. Only database snapshots or server-created session states may be signed.
model/auth_cache_integrity.go:12
↓ 5 callersFunctionbuildAlphaSearchRequestBody
buildAlphaSearchRequestBody returns RawBody unchanged unless the model was mapped, in which case only the "model" field is rewritten so unknown fields
relay/alpha_search_handler.go:124
↓ 5 callersFunctionbuildChannelAffinityTemplateContextForTest
(meta channelAffinityMeta)
service/channel_affinity_template_test.go:23
↓ 5 callersFunctionbuildQueryParams
buildQueryParams builds query parameters for GET requests
pkg/ionet/client.go:161
↓ 5 callersFunctioncacheIncrUserQuota
Add atomic quota operations using hash fields. 通过守卫式 Lua 脚本执行:哈希不存在时直接跳过(下次读取会从数据库水合), 不会像裸 HINCRBY 那样创建只含 Quota 字段的残缺哈希。
model/user_cache.go:159
↓ 5 callersFunctioncallback
(authorization: unknown)
web/src/features/auth/components/telegram-login-dialog.tsx:56
↓ 5 callersMethodcanRenew
canRenew reports whether a rejected request can be sent again with a renewed key: a credential the plugin refreshes, or a static key it exchanges.
relay/channel/providerplugin/adaptor.go:630
↓ 5 callersFunctionchatBody
(parts ...string)
relay/requestplugin/attachments_test.go:81
↓ 5 callersFunctionchatFile
(filename, url string)
relay/requestplugin/attachments_test.go:77
↓ 5 callersFunctionclaudeCapabilitiesFor
(model string)
relaykit/relayconvert/reasoning/claude.go:45
↓ 5 callersFunctionclickHouseLogOrder
(prefix string)
model/log.go:105
↓ 5 callersMethodcode
(t *testing.T, receiver string)
controller/security_account_test.go:323
↓ 5 callersFunctioncolorAt
(index: number, palette?: readonly string[])
web/src/features/dashboard/lib/flow.ts:283
↓ 5 callersMethodcommit
(info *relaycommon.RelayInfo)
relay/channel/gemini/relay-gemini.go:123
↓ 5 callersFunctioncompleteAssistantTiming
( message: Message, completedAt: number = Date.now() )
web/src/features/playground/lib/message/message-timing-utils.ts:22
↓ 5 callersFunctionconfigValue
(config json.RawMessage)
pkg/jsplugin/provider.go:283
↓ 5 callersFunctionconfigureTokenAutoGroupsTest
(t *testing.T, maxCount string, autoGroups string)
controller/token_auto_groups_test.go:19
↓ 5 callersFunctioncountClaudeStreamBillableTools
(info *relaycommon.RelayInfo, claudeResponse *dto.ClaudeResponse)
relay/channel/claude/relay-claude.go:225
↓ 5 callersFunctioncreateReserveTestUser
(t *testing.T, quota int)
model/quota_reserve_test.go:14
↓ 5 callersFunctiondecodeData
(data []byte, target *T)
pkg/ionet/jsonutil.go:28
↓ 5 callersFunctiondecodeDoubaoImage
(t *testing.T, registry *jsplugin.Registry, plugin *jsplugin.LoadedPlugin, body map[string]any)
plugins/doubao_responses_test.go:69
↓ 5 callersFunctiondecodePasskeyDomainBegin
(t *testing.T, response *httptest.ResponseRecorder)
controller/passkey_test.go:99
↓ 5 callersFunctiondoRequest
(c *gin.Context, req *http.Request, info *common.RelayInfo)
relay/channel/api_request.go:538
↓ 5 callersFunctiondocumentLocale
(language: string)
web/src/features/task-plugins/lib/plugin-document.ts:32
↓ 5 callersFunctiondrainClose
(t *testing.T, resp *http.Response)
service/http_client_transport_test.go:117
↓ 5 callersFunctiondryRunBuiltIn
dryRunBuiltIn runs one instance of a built-in plugin through the host's dry run, attachments included.
plugins/request_plugins_test.go:1120
↓ 5 callersMethodencode
(out *bytes.Buffer)
pkg/requestpatch/patch.go:494
↓ 5 callersFunctionevaluateTaskVisualConfig
( config: TaskVisualConfig, sample: Record<string, number | string>, schema?: BillingUsageSchema )
web/src/features/pricing/lib/task-expr.ts:229
↓ 5 callersMethodfetch
Synchronous request. Driver hooks address the channel Base URL host or allowedHosts, read-only outside login, refresh, revoke, exchangeKey and schedul
docs/plugin-api/v1.d.ts:27
↓ 5 callersFunctionformatLatency
(ms: number)
web/src/features/performance-metrics/lib/format.ts:25
↓ 5 callersFunctionformatLogOtherJSON
formatLogOtherJSON applies the role projection while keeping untouched JSON values as RawMessage. This preserves integers larger than JavaScript's saf
model/log_other.go:232
↓ 5 callersFunctionformatNotifyType
(channelId int, status int)
service/channel.go:16
↓ 5 callersFunctionformatThroughput
(tps: number)
web/src/features/performance-metrics/lib/format.ts:19
↓ 5 callersFunctiongetAccessToken
(a *Adaptor, info *relaycommon.RelayInfo)
relay/channel/vertex/service_account.go:49
↓ 5 callersFunctiongetChannelAffinityMeta
(c *gin.Context)
service/channel_affinity.go:377
↓ 5 callersFunctiongetDynamicPriceEntries
( tier: DynamicPricingTier | null, options: DynamicPriceOptions )
web/src/features/pricing/lib/dynamic-price.ts:282
↓ 5 callersFunctiongetDynamicPriceUnitLabelKey
( entry: DynamicPriceEntry )
web/src/features/pricing/lib/dynamic-price.ts:122
↓ 5 callersFunctiongetMessageContent
(message: Message)
web/src/features/playground/lib/message/message-utils.ts:49
↓ 5 callersFunctiongetPluginWebsite
(value: unknown)
web/src/features/task-plugins/lib/plugin-website.ts:20
↓ 5 callersFunctiongetSavedChartPreferences
()
web/src/features/dashboard/lib/filters.ts:94
↓ 5 callersFunctiongetTaskQuota
(t *testing.T, id int64)
service/task_billing_test.go:562
↓ 5 callersFunctiongetTaskUsagePriceUnitLabelKey
( unit: BillingUsageUnit | undefined )
web/src/features/pricing/lib/dynamic-price.ts:113
↓ 5 callersFunctiongetUserAvatarFallback
(name: string)
web/src/lib/avatar.ts:43
↓ 5 callersFunctiongetUserAvatarStyle
(name: string)
web/src/lib/avatar.ts:31
↓ 5 callersFunctionhasDiagnosticCode
(diagnostics []types.ConversionDiagnostic, code string)
relaykit/relayconvert/internal/toolconv/policy_test.go:26
↓ 5 callersFunctionhasTaskUsageSchema
(model: PricingModel)
web/src/features/pricing/lib/dynamic-price.ts:154
↓ 5 callersFunctionhasValue
(value: unknown)
web/src/features/system-settings/models/model-pricing-core.ts:198
↓ 5 callersMethodhookContext
hookContext is the ctx of the relay hooks of the request.
relay/channel/providerplugin/adaptor.go:594
↓ 5 callersFunctionidParam
(id int)
controller/provider_plugin_test.go:111
↓ 5 callersFunctionidentityFilters
(key string, channelTypes []int)
model/task_plugin_channel_select_test.go:52
↓ 5 callersFunctioninsertTask
(t *testing.T, task *Task)
model/task_cas_test.go:99
↓ 5 callersFunctioninvalidRequestStatus
invalidRequestStatus is the status of a request whose body could not be read or parsed: 413 when the body exceeds MAX_REQUEST_BODY_MB, else 400.
middleware/utils.go:40
↓ 5 callersFunctioninvalidateTokenCacheForMutation
invalidateTokenCacheForMutation is called before a token metadata mutation writes to the database: it raises the fence and drops the cached hash so no
model/token_cache.go:56
↓ 5 callersFunctionisAuthBundle
(value: unknown)
web/src/lib/auth-session.ts:131
↓ 5 callersFunctionisContentSizedColumn
(columnId: string)
web/src/components/data-table/core/content-sized-columns.ts:19
↓ 5 callersFunctionisH3
(model)
plugins/tasks/hailuo/plugin.js:278
↓ 5 callersFunctionisObject
(value)
plugins/tasks/request-filter/plugin.js:129
↓ 5 callersFunctionisPaymentComplianceConfirmed
()
controller/payment_webhook_availability.go:10
↓ 5 callersFunctionisRecord
(value: unknown)
web/src/lib/server-error-message.ts:89
↓ 5 callersFunctionisRecord
(value: unknown)
web/src/lib/auth-session.ts:90
↓ 5 callersMethoditem
item returns the media ref names.
relay/requestplugin/attachments.go:325
↓ 5 callersFunctionlimitLogTimeRange
limitLogTimeRange returns the start of a log or dashboard search kept within the longest log time range. A missing start reaches back the whole range,
controller/log.go:42
↓ 5 callersFunctionlistTaskPluginItem
(t *testing.T, key string)
controller/task_plugin_test.go:180
↓ 5 callersFunctionlogTokenName
( log: Pick<UsageLog, 'token_id' | 'token_name'>, t: (key: string, opts?: Record<string, unknown>) => stri
web/src/features/usage-logs/lib/format.ts:589
← previousnext →1,401–1,500 of 15,409, ranked by callers