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
↓ 6 callers
Function
noteQuotaClamp
noteQuotaClamp records the first quota saturation event onto relayInfo so it can later be attached to the consume/task log for admin auditing. First n
service/text_quota.go:192
↓ 6 callers
Function
openTaskDialectDatabase
Uses the real submit adaptor, expression evaluator, BillingSession, task row and consume log. Set TEST_TASK_DB_DIALECT plus TEST_MYSQL_DSN or TEST_POS
controller/relay_task_plugin_test.go:511
↓ 6 callers
Function
parseHttpStatusCodeRules
( input: unknown )
web/src/lib/http-status-code-rules.ts:32
↓ 6 callers
Function
parseLogOther
(other: string)
web/src/features/usage-logs/lib/format.ts:162
↓ 6 callers
Function
parseTags
(tagsString?: string)
web/src/features/pricing/lib/filters.ts:259
↓ 6 callers
Function
parseTiersFromExpr
(exprStr: string)
web/src/features/pricing/lib/billing-expr.ts:320
↓ 6 callers
Function
passkeyDomainRequest
(t *testing.T, path string, payload any, identity service.AuthIdentity, origin string, handler gin.HandlerFunc
controller/passkey_test.go:89
↓ 6 callers
Function
paymentReturnPath
(suffix string)
controller/return_path.go:9
↓ 6 callers
Function
performSharedRouteRequest
(router http.Handler, method, path, body string)
middleware/task_plugin_test.go:2418
↓ 6 callers
Function
persist
(reset = false)
web/src/features/model-pricing/model-pricing-panel.tsx:90
↓ 6 callers
Function
pluginErrorCategory
pluginErrorCategory names a plugin call failure for logs without its message, which may quote a vendor response.
service/provider_plugin.go:519
↓ 6 callers
Function
pluginMapKeys
(plugins map[string]*LoadedPlugin)
pkg/jsplugin/registry.go:1336
↓ 6 callers
Method
prepareGeneration
( factory, override map[string]*LoadedPlugin, tolerateConflicts bool, retainCurrent map[string]struct{}, )
pkg/jsplugin/registry.go:1040
↓ 6 callers
Function
pricingEndpointAdvancedCustomConfig
(routes ...dto.AdvancedCustomRoute)
model/pricing_endpoint_test.go:59
↓ 6 callers
Function
pricingFromDraft
(data: ModelRatioData)
web/src/features/model-pricing/pricing.ts:238
↓ 6 callers
Function
pricingRow
( name: string, values: PricingValues )
web/src/features/model-pricing/pricing.ts:199
↓ 6 callers
Function
ptr
(value T)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_resp_test.go:428
↓ 6 callers
Method
publishGeneration
( generation *RoutingGeneration, routingErrors map[string]string, activeOverride map[string]*LoadedPlugin,
pkg/jsplugin/registry.go:1091
↓ 6 callers
Method
queryContext
(task *model.Task, key, baseURL, proxy string)
relay/channel/task/jsplugin/adaptor.go:1454
↓ 6 callers
Function
quotaUnitsToDollars
(units: number)
web/src/lib/format.ts:122
↓ 6 callers
Method
recordRebuildFailure
(err error)
pkg/jsplugin/registry.go:1152
↓ 6 callers
Function
redisFixedWindowTake
(ctx context.Context, key string, maxRequestNum int, duration int64)
middleware/rate-limit.go:66
↓ 6 callers
Function
refreshSubscriptionUserGroupCache
(userId int, operation string)
model/subscription.go:572
↓ 6 callers
Function
rejectInvalidTopUpQuota
(c *gin.Context, userId int, amount int64)
controller/topup.go:279
↓ 6 callers
Function
rememberOAuthLoginRedirect
( state: string, redirect?: string )
web/src/features/auth/lib/oauth-callback-mode.ts:22
↓ 6 callers
Function
resetRegistryForTest
()
pkg/wsmanager/wsmanager_test.go:18
↓ 6 callers
Function
resetSession
()
web/src/features/auth/hooks/use-oauth-login.ts:61
↓ 6 callers
Method
resolveActiveOverrides
( generation *RoutingGeneration, override map[string]*LoadedPlugin, )
pkg/jsplugin/registry.go:1344
↓ 6 callers
Function
resolvePluginParts
( item: TaskPluginParts & { meta: Pick<TaskPluginMeta, 'relay'> } )
web/src/features/task-plugins/lib/plugin-parts.ts:26
↓ 6 callers
Function
respondWith
(status int, contentType, body string)
router/provider_plugin_relay_test.go:1121
↓ 6 callers
Function
responsePresentationLoss
(path string, code string, message string)
relaykit/relayconvert/internal/toolconv/response.go:513
↓ 6 callers
Function
runAttachments
runAttachments runs one rp-attachments instance at ingress on body.
relay/requestplugin/attachments_test.go:65
↓ 6 callers
Function
runReplyHook
runReplyHook validates config as the host does when an instance is saved and calls the reply hook of a built-in plugin on one output.
plugins/request_plugins_test.go:721
↓ 6 callers
Function
saveBillingConfig
(t *testing.T)
relay/relay_task_test.go:303
↓ 6 callers
Function
seededRandom
(seed: number)
web/src/features/pricing/lib/seed.ts:39
↓ 6 callers
Function
setupAdminUserTest
setupAdminUserTest promotes the enrolled operator to root and creates a managed common user for the administrative endpoints to act on.
controller/admin_user_verification_test.go:20
↓ 6 callers
Function
setupProviderPluginControllerTest
(t *testing.T, pluginKey string)
controller/provider_plugin_test.go:74
↓ 6 callers
Function
setupTaskPluginFactoryDisableTest
(t *testing.T)
controller/task_plugin_test.go:150
↓ 6 callers
Function
sharedRouteTestPluginSource
sharedRouteTestPluginSource declares the probe routes two plugins share; decoder and presenter bodies name the plugin, and extra adds members to nativ
middleware/task_plugin_test.go:2373
↓ 6 callers
Function
sharedTaskPluginRouteRouter
sharedTaskPluginRouteRouter serves the plugins' route groups as the inner plugin router does, each pinned to its candidates, for caller 7.
middleware/task_plugin_test.go:2395
↓ 6 callers
Method
shutdown
shutdown ends the connection once. Each peer gets a close frame that says why, bounded to one second, and both sockets close even if a write failed. C
relay/responses_websocket.go:894
↓ 6 callers
Method
size
()
relay/requestplugin/attachments.go:190
↓ 6 callers
Function
startHTTP2TLSServer
(t *testing.T, handler http.Handler)
service/http_client_transport_test.go:108
↓ 6 callers
Function
stringValue
stringValue reads a host function's string parameter: undefined and null read as "", other values as JavaScript's String(value).
pkg/jsplugin/utils.go:358
↓ 6 callers
Function
syncTaskPluginsOnce
()
controller/task_plugin.go:1019
↓ 6 callers
Function
taskBillingOther
taskBillingOther 从 task 的 BillingContext 构建日志 Other 字段。
service/task_billing.go:152
↓ 6 callers
Function
taskCredentialLine
(t *testing.T, plugin, access, account string, expiresAt int64)
relay/channel/task/jsplugin/credential_test.go:123
↓ 6 callers
Function
taskEnumLabel
( definition: BillingUsageFieldSchema | undefined, value: string, language: string )
web/src/features/pricing/lib/task-price-display.ts:51
↓ 6 callers
Function
testTLSClientConfig
(t *testing.T, server *httptest.Server)
service/http_client_transport_test.go:100
↓ 6 callers
Method
text
text reads the text of item once per request, under the request's budget.
relay/requestplugin/attachments.go:212
↓ 6 callers
Function
toNumberOrNull
(value: unknown)
web/src/features/system-settings/models/model-pricing-core.ts:204
↓ 6 callers
Function
trimmed
(value)
plugins/tasks/vidu/plugin.js:158
↓ 6 callers
Function
trimmed
(value)
plugins/tasks/sunoapi/plugin.js:41
↓ 6 callers
Function
tryParseTaskVisualConfig
( expression: string | null | undefined, schema: BillingUsageSchema )
web/src/features/pricing/lib/task-expr.ts:404
↓ 6 callers
Function
updateCurrentVersionContent
( message: Message, content: string )
web/src/features/playground/lib/message/message-utils.ts:63
↓ 6 callers
Function
useBillingTime
( expression: string | null | undefined, enabled = true )
web/src/features/pricing/hooks/use-billing-time.ts:64
↓ 6 callers
Function
useChartTheme
()
web/src/lib/use-chart-theme.ts:32
↓ 6 callers
Function
useDialogState
( initialState: T | null = null )
web/src/hooks/use-dialog.ts:97
↓ 6 callers
Function
useLogsViewScope
()
web/src/features/usage-logs/components/usage-logs-provider.tsx:104
↓ 6 callers
Function
useOpenInContext
()
web/src/components/ai-elements/open-in-chat.tsx:206
↓ 6 callers
Function
usePricingData
(enabled = true)
web/src/features/pricing/hooks/use-pricing-data.ts:27
↓ 6 callers
Function
useResetForm
( form: UseFormReturn<TFieldValues>, values: DefaultValues<TFieldValues> | undefined )
web/src/features/system-settings/hooks/use-reset-form.ts:27
↓ 6 callers
Function
withPluginPricing
( model: PricingModel, variant: BillingPluginVariant )
web/src/features/pricing/lib/plugin-pricing.ts:75
↓ 6 callers
Function
writeAnswer
writeAnswer writes a non-stream JSON answer the way the handlers do: its length, the status, then the body in parts.
relay/requestplugin/requestplugin_test.go:1011
↓ 6 callers
Function
writeTaskArtifactError
(c *gin.Context, status int, code, message string)
controller/task.go:299
↓ 5 callers
Function
AccessTokenHint
AccessTokenHint is the last four characters of a token, shown so users can tell their tokens apart. PostgreSQL pads legacy CHAR(32) values with spaces
model/user_access_token.go:225
↓ 5 callers
Function
AccessTokenSessionID
AccessTokenSessionID is the step-up session identifier bound to a token. Browser session IDs are UUIDs and can never carry this prefix.
model/user_access_token.go:235
↓ 5 callers
Function
ActivateTaskPlugin
(key, version string)
model/task_plugin.go:253
↓ 5 callers
Method
ActiveOverridePlugins
()
pkg/jsplugin/registry.go:985
↓ 5 callers
Method
AddAbilities
(tx *gorm.DB)
model/ability.go:225
↓ 5 callers
Function
AllOption
()
model/option.go:26
↓ 5 callers
Function
AppendRelayLogAdminInfo
AppendRelayLogAdminInfo records relay routing and conversion diagnostics in the admin-only scope shared by successful and failed request logs.
service/log_info_generate.go:70
↓ 5 callers
Method
Apply
(query *gorm.DB)
model/channel.go:114
↓ 5 callers
Function
ApplyHeaderOverride
ApplyHeaderOverride applies the request plugins' header changes, then the channel overrides, after the adaptor's headers. Without a client request, on
relay/channel/api_request.go:303
↓ 5 callers
Method
ApplyOtherRatiosToFloat
(value float64)
types/price_data.go:93
↓ 5 callers
Method
ArgumentsString
ArgumentsString returns function call arguments in the string form expected by Chat Completions.
relaykit/dto/openai_response.go:564
↓ 5 callers
Function
AttachRequest
(format types.RelayFormat, request any, set Set, options *convmeta.Options)
relaykit/relayconvert/internal/toolconv/encode.go:17
↓ 5 callers
Function
AutoGroups2JsonString
()
setting/auto_group.go:35
↓ 5 callers
Method
BindsTaskPlugin
BindsTaskPlugin reports whether the channel is bound to the task plugin, either through the single binding or the New API extension list.
relaykit/dto/channel_settings.go:46
↓ 5 callers
Function
CacheGetRandomSatisfiedChannel
CacheGetRandomSatisfiedChannel tries to get a random channel that satisfies the requirements. 尝试获取一个满足要求的随机渠道。 For "auto" tokenGroup with cross-group
service/channel_select.go:119
↓ 5 callers
Method
CallConvertResponse
CallConvertResponse runs convertResponse(ctx, {status, headers, body}) on an upstream response of the route at hookCtx.Path, with bodyBase64 in place
pkg/jsplugin/provider.go:1078
↓ 5 callers
Method
CallLogin
CallLogin runs login(ctx, input). credential is the wrapper data when the administrator logs in again on an existing credential.
pkg/jsplugin/provider.go:299
↓ 5 callers
Method
CallMember
CallMember invokes a function stored on an exported object, such as a renderer in the renderers export.
pkg/jsplugin/engine.go:364
↓ 5 callers
Method
CanonicalModel
CanonicalModel returns the declared spelling for model. An exact byModel hit wins and returns the input unchanged; otherwise the ASCII-folded index is
pkg/jsplugin/routing.go:544
↓ 5 callers
Function
Capabilities
Capabilities returns the full resource/action matrix the subject is allowed.
service/authz/resolver.go:38
↓ 5 callers
Function
ChatCompletionsResponseToResponsesResponse
(resp *dto.OpenAITextResponse, id string)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp.go:42
↓ 5 callers
Function
ClearCurrentChannelAffinityCache
(c *gin.Context)
service/channel_affinity.go:651
↓ 5 callers
Method
Convert
(response *dto.ClaudeResponse, state *ResponseStreamState)
relaykit/relayconvert/response_compat.go:85
↓ 5 callers
Method
ConvertChunk
ConvertChunk accumulates OpenAI tool-call deltas until their choice ends. Gemini functionCall parts are atomic, so emitting each OpenAI arguments frag
relaykit/relayconvert/internal/oai_chat/to_gemini_chat_resp.go:232
↓ 5 callers
Method
ConvertEmbeddingRequest
(c *gin.Context, info *relaycommon.RelayInfo, request dto.EmbeddingRequest)
relay/channel/adapter.go:25
↓ 5 callers
Function
ConvertRequestByID
(c *gin.Context, info *relaycommon.RelayInfo, converter string, request any)
service/request_converter.go:34
↓ 5 callers
Function
CreateUserAccessToken
CreateUserAccessToken inserts a token while holding the owner's users row, so concurrent creates cannot exceed limit. Expired rows awaiting cleanup co
model/user_access_token.go:120
↓ 5 callers
Function
CurrentRequestPolicy
()
model/request_policy.go:72
↓ 5 callers
Method
DatabaseTypeName
()
model/migration_dialector.go:112
↓ 5 callers
Function
DecodeEffects
DecodeEffects reads the effects array of prepareRequest from its JSON text: json.patch and header.patch. Unknown members are rejected.
pkg/requestpatch/patch.go:78
↓ 5 callers
Method
DecodePayload
(v any)
model/system_task.go:564
↓ 5 callers
Method
DefinedModes
DefinedModes returns each distinct mode on the protocol in host-table order.
pkg/jsplugin/routing.go:139
↓ 5 callers
Function
DeleteUserAccessToken
DeleteUserAccessToken hard-deletes one token owned by userID and returns the deleted row for auditing.
model/user_access_token.go:169
↓ 5 callers
Method
Diagnostics
Diagnostics returns every conversion-loss diagnostic observed so far. This remains available even when a source event produces no target stream chunk.
relaykit/relayconvert/response_registry.go:468
↓ 5 callers
Function
DispatchPlatformUpdate
DispatchPlatformUpdate 按平台分发轮询更新
service/task_polling.go:238
← previous
next →
1,201–1,300 of 15,409, ranked by callers