Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
15,409 in github.com/QuantumNous/new-api
⨍
Functions
15,409
◇
Types & classes
2,241
↓ 7 callers
Function
invalidateVendorData
(client: QueryClient)
web/src/features/models/vendor-api.ts:97
↓ 7 callers
Function
manageMultiKeys
( params: MultiKeyManageParams )
web/src/features/channels/api.ts:546
↓ 7 callers
Function
marketplaceSourceKind
(indexUrl: string)
web/src/features/task-plugins/lib/marketplace.ts:468
↓ 7 callers
Function
metadataTransaction
metadataTransaction serializes changes to vendors and model ownership before acquiring model/vendor row locks. The option anchor also covers empty tab
model/model_metadata_sync.go:19
↓ 7 callers
Function
newAccessTokenTestRouter
newAccessTokenTestRouter mirrors the production paths, so the access token route rules keyed by gin full path apply unchanged.
controller/access_token_audit_test.go:75
↓ 7 callers
Function
newAuthenticatedContext
(t *testing.T, method string, target string, body any, userID int)
controller/token_test.go:192
↓ 7 callers
Function
newOuterPluginTestEngine
()
router/plugin_router_test.go:1040
↓ 7 callers
Method
newRefreshToken
newRefreshToken stores a refresh token the fake server accepts.
service/provider_plugin_test.go:324
↓ 7 callers
Function
newSub2APITestChannel
(t *testing.T, serverURL string)
controller/channel_billing_sub2api_test.go:37
↓ 7 callers
Function
newTaskUpstream
(t *testing.T)
relay/channel/task/jsplugin/credential_test.go:86
↓ 7 callers
Function
numberValue
(value: unknown)
web/src/features/dashboard/lib/flow.ts:149
↓ 7 callers
Function
omniModel
(ctx)
plugins/tasks/vertex-ai/plugin.js:136
↓ 7 callers
Function
parseTaskTiersFromExpr
( exprStr: string, schema: BillingUsageSchema | null | undefined, includeBooleanConditions = false )
web/src/features/pricing/lib/billing-expr.ts:339
↓ 7 callers
Function
plainObject
(value)
plugins/tasks/vertex-ai/plugin.js:121
↓ 7 callers
Function
pluginProtocolTestSSEEventTypes
(body string)
controller/plugin_protocol_test.go:1541
↓ 7 callers
Function
postAddChannel
(t *testing.T, userID, role int, body string)
controller/channel_task_plugin_bind_test.go:46
↓ 7 callers
Function
pricingEndpointTypesByModel
(t *testing.T)
model/pricing_endpoint_test.go:67
↓ 7 callers
Function
proxyTaskMedia
(c *gin.Context, task *model.Task, descriptor *relaychannel.TaskContentRequest)
controller/video_proxy.go:135
↓ 7 callers
Function
rateLimitFactory
(maxRequestNum int, duration int64, mark string)
middleware/rate-limit.go:148
↓ 7 callers
Function
registerNetPlugin
(t *testing.T)
relay/requestplugin/requestplugin_test.go:704
↓ 7 callers
Function
registerRotatingPlugin
(t *testing.T, key, extra string)
router/provider_plugin_relay_test.go:421
↓ 7 callers
Function
requestContextDone
(c *gin.Context)
relay/helper/common.go:193
↓ 7 callers
Function
requireOptionMissing
(t *testing.T, db *gorm.DB, key string)
model/frontend_option_migration_test.go:37
↓ 7 callers
Method
resolveForConversion
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:375
↓ 7 callers
Method
responseSnapshot
(responseError *dto.PluginResponsesError)
relay/plugin_protocol.go:1002
↓ 7 callers
Function
sanitizeFetchModelsError
(err error, key string)
controller/channel_upstream_update.go:287
↓ 7 callers
Function
seedPollingTask
(t *testing.T, channelID int, publicID string, upstreamID string)
service/task_polling_test.go:207
↓ 7 callers
Method
sent
(t *testing.T, path string)
relay/channel/task/jsplugin/credential_test.go:101
↓ 7 callers
Function
setupTaskPluginBindChannelTest
(t *testing.T)
controller/channel_task_plugin_bind_test.go:22
↓ 7 callers
Function
sseData
sseData returns the data of each event of a stream.
relay/requestplugin/requestplugin_test.go:1035
↓ 7 callers
Method
sync
sync puts the steps and the record of the reply checks after the attempt's other entries on info, where the consume or error log reads them.
relay/requestplugin/reply.go:1490
↓ 7 callers
Function
syncCreditUserQuotaCache
syncCreditUserQuotaCache 在授信事务(充值/兑换等)提交后同步把增量补进缓存 余额。预扣以缓存值为准(存在期间),授信不能绕过它,否则新到账的额度在 缓存过期前不可用;缓存未命中无需处理,下次读取会从已提交的数据库余额水合。
model/user_cache.go:174
↓ 7 callers
Function
tasksToDto
(tasks []*model.Task, fillUser bool, viewerRole int)
controller/task.go:440
↓ 7 callers
Function
transformChannelToFormDefaults
( channel: Channel )
web/src/features/channels/lib/channel-form.ts:514
↓ 7 callers
Function
transformFormDataToCreatePayload
(formData: ChannelFormValues)
web/src/features/channels/lib/channel-form.ts:912
↓ 7 callers
Function
useAccountSecurity
()
web/src/features/security/hooks/use-account-security.ts:34
↓ 7 callers
Function
useCanEditModelPricing
()
web/src/features/model-pricing/api.ts:125
↓ 7 callers
Function
useIsMobile
()
web/src/hooks/use-mobile.ts:23
↓ 7 callers
Function
userSessionCacheDeadline
()
model/user_session.go:131
↓ 7 callers
Method
value
value reads one object; values counts down the values an object may hold.
relay/requestplugin/pdf.go:794
↓ 7 callers
Function
vendorAPIError
(c *gin.Context, err error)
controller/vendor_meta.go:95
↓ 7 callers
Function
visitExpression
( node: ExpressionNode, visitor: (node: ExpressionNode) => void )
web/src/features/pricing/lib/billing-expression/types.ts:166
↓ 7 callers
Function
withBasePricing
(model: PricingModel)
web/src/features/pricing/lib/plugin-pricing.ts:104
↓ 7 callers
Function
withRelayHTTPTransportSettings
(t *testing.T)
service/http_client_transport_test.go:27
↓ 6 callers
Function
AccessTokenScopeOf
AccessTokenScopeOf is the token scope key for a Casbin permission.
service/access_token_scope.go:118
↓ 6 callers
Function
AdvanceCurrentSessionToUserVersion
AdvanceCurrentSessionToUserVersion is used when the security mutation and AuthVersion increment were committed in the same transaction (for example, a
service/auth_session.go:200
↓ 6 callers
Function
ApplyChannelAffinityOverrideTemplate
ApplyChannelAffinityOverrideTemplate merges per-rule channel override templates onto the selected channel override config.
service/channel_affinity.go:533
↓ 6 callers
Function
ApplyResponsesUsage
(dst *dto.Usage, src *dto.Usage)
service/responses_usage.go:154
↓ 6 callers
Function
ApplyToOpenAIChat
ApplyToOpenAIChat writes the portable portion of an intent to the OpenAI pivot. reasoning_effort carries level-based strength; a JSON-excluded DTO sta
relaykit/relayconvert/reasoning/intent.go:452
↓ 6 callers
Method
ApplyVendorToolUsage
ApplyVendorToolUsage writes the vendor-billed counts of one upstream response into BuiltInTools. Protocol items counted earlier for the same key are r
relay/common/tool_usage.go:85
↓ 6 callers
Method
BuildRequestHeader
(c *gin.Context, req *http.Request, info *relaycommon.RelayInfo)
relay/channel/adapter.go:75
↓ 6 callers
Method
CallPathWithAdmissionTimeout
CallPathWithAdmissionTimeout gives long-lived observers a separate bound for waiting on JavaScript capacity. Once admitted, the hook receives the engi
pkg/jsplugin/engine.go:386
↓ 6 callers
Method
CallSignRequest
CallSignRequest runs signRequest(ctx, {method, url, headers, bodySha256}).
pkg/jsplugin/provider.go:450
↓ 6 callers
Function
ChatCompletionsRequestToResponsesRequest
(ctx context.Context, req *dto.GeneralOpenAIRequest)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_req.go:83
↓ 6 callers
Function
ClaimExternalIdentityWithTx
ClaimExternalIdentityWithTx atomically claims a provider subject for one user. Repeating the exact mapping is idempotent; every competing subject or u
model/external_identity_claim.go:37
↓ 6 callers
Method
Clear
()
types/rw_map.go:54
↓ 6 callers
Function
CommonClaudeHeadersOperation
(c *gin.Context, req *http.Header, info *relaycommon.RelayInfo)
relay/channel/claude/adaptor.go:105
↓ 6 callers
Function
CompleteSubscriptionOrder
Complete a subscription order (idempotent). Creates a UserSubscription snapshot from the plan. expectedPaymentProvider guards against cross-gateway ca
model/subscription.go:581
↓ 6 callers
Function
ConsumeAuthFlow
ConsumeAuthFlow atomically validates and consumes a flow. Optional match fields are enforced when non-zero so tokens cannot cross purposes or users.
model/auth_flow.go:239
↓ 6 callers
Method
ConvertImageRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.ImageRequest)
relay/channel/adapter.go:27
↓ 6 callers
Function
ConvertResponse
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, response any)
service/response_converter.go:10
↓ 6 callers
Method
ConvertToOpenAIVideo
(originTask *model.Task)
relay/channel/adapter.go:101
↓ 6 callers
Method
Delete
()
model/channel.go:687
↓ 6 callers
Function
DeleteTaskPluginVersion
(c *gin.Context)
controller/task_plugin.go:588
↓ 6 callers
Function
DryRun
DryRun runs the four stages on input without sending or charging anything. It stops at a rejection or a failure that stops the request.
relay/requestplugin/relay.go:635
↓ 6 callers
Function
EffortFromBudget
(budget int)
relaykit/relayconvert/reasoning/intent.go:674
↓ 6 callers
Function
Estimate
Estimate returns the estimated token count of text for model, using the weights of the model's family. It never runs a tokenizer; use Count for an exa
tokenkit/tokenkit.go:140
↓ 6 callers
Function
EvaluateTaskCompletionUsage
EvaluateTaskCompletionUsage evaluates actual facts against the frozen task expression. It neither mutates the snapshot nor moves funds: synchronous su
service/task_billing.go:444
↓ 6 callers
Function
ExceedsMaxTokensLimit
ExceedsMaxTokensLimit checks token limits before they reach billing arithmetic.
relay/helper/valid_request.go:128
↓ 6 callers
Function
FatalLog
(v ...any)
common/sys_log.go:55
↓ 6 callers
Method
FetchBatchTasks
(baseURL, key string, tasks []*model.Task, proxy string)
service/task_polling.go:41
↓ 6 callers
Function
FinalizeStreamResponse
(c *gin.Context, info *relaycommon.RelayInfo, state *relayconvert.ResponseStreamState)
service/response_converter.go:34
↓ 6 callers
Function
FormatAdminLogs
FormatAdminLogs removes root-only diagnostics while retaining operational admin_info. Root callers must not pass their results through this formatter.
model/log.go:125
↓ 6 callers
Function
FromOpenAIChat
(req *dto.GeneralOpenAIRequest)
relaykit/relayconvert/reasoning/intent.go:361
↓ 6 callers
Function
GeminiChatHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/gemini/relay-gemini.go:412
↓ 6 callers
Function
GenerateFinalUsageResponse
(id string, createAt int64, model string, usage dto.Usage)
relay/helper/common.go:376
↓ 6 callers
Function
GetActiveSystemTask
(taskType string)
model/system_task.go:142
↓ 6 callers
Method
GetBalanceDetail
GetBalanceDetail returns the channel's last balance query, nil before the first one.
model/channel_balance.go:22
↓ 6 callers
Method
GetByModel
GetByModel returns the deterministic effective plugin metadata used for a model-level host concern such as billing. When multiple providers expose the
pkg/jsplugin/routing.go:519
↓ 6 callers
Method
GetCacheCreation1hTokens
()
relaykit/dto/claude.go:705
↓ 6 callers
Method
GetCacheCreation5mTokens
()
relaykit/dto/claude.go:698
↓ 6 callers
Method
GetChannelName
()
relay/channel/adapter.go:32
↓ 6 callers
Function
GetCompletionRatio
(name string)
setting/ratio_setting/model_ratio.go:436
↓ 6 callers
Function
GetEpayClient
()
controller/topup.go:137
↓ 6 callers
Method
GetIdentifier
()
relaykit/types/file_source.go:15
↓ 6 callers
Function
GetRandomSatisfiedChannel
( group string, model string, retry int, filters []dto.ChannelFilter, )
model/channel_cache.go:123
↓ 6 callers
Method
GetRetry
()
service/channel_select.go:58
↓ 6 callers
Function
GetSubscriptionPlanById
(id int)
model/subscription.go:397
↓ 6 callers
Function
GetTaskPluginOptions
(c *gin.Context)
controller/task_plugin.go:924
↓ 6 callers
Function
GetTaskPluginSyncSnapshot
GetTaskPluginSyncSnapshot returns the enabled override set together with a deterministic revision of every active database override. Nodes can compare
model/task_plugin.go:195
↓ 6 callers
Function
GetToolPriceForModel
GetToolPriceForModel returns the price ($/1K calls) for a tool given a model name. Lookup: longest prefix match → tool default → 0.
setting/operation_setting/tools.go:254
↓ 6 callers
Method
GetTools
GetTools 获取工具列表
relaykit/dto/claude.go:462
↓ 6 callers
Function
GetTopupGroupRatio
(name string)
common/topup-ratio.go:32
↓ 6 callers
Function
GetUserAccessToken
(userID, id int)
model/user_access_token.go:100
↓ 6 callers
Function
GetUserAccessTokenStatus
GetUserAccessTokenStatus reads last use of the legacy token from the access audit. Deprecated: 旧版面板访问令牌,仅在升级后的过渡期内使用;删除 users.access_token 列时一并移除。
model/audit_log.go:220
↓ 6 callers
Function
GetUsernameById
GetUsernameById gets username from Redis first, falls back to DB if needed
model/user.go:1490
↓ 6 callers
Function
GroupRatio2JSONString
()
setting/ratio_setting/group_ratio.go:71
↓ 6 callers
Function
HandleOAuth
HandleOAuth handles OAuth callback for all standard OAuth providers
controller/oauth.go:146
↓ 6 callers
Function
HeaderNavModulePublicOrUserAuth
(module string)
middleware/header_nav.go:130
↓ 6 callers
Function
IncreaseTokenQuota
(tokenId int, key string, quota int)
model/token.go:382
← previous
next →
1,001–1,100 of 15,409, ranked by callers