Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
15,592 in github.com/QuantumNous/new-api
⨍
Functions
15,592
◇
Types & classes
2,267
↓ 3 callers
Method
SuppressesRetry
()
dto/channel_constraints.go:118
↓ 3 callers
Function
SyncTaskPluginsOnce
()
controller/task_plugin.go:1213
↓ 3 callers
Function
SyncTaskTopic
SyncTaskTopic returns the topic of a sync task type.
model/system_sync_task.go:34
↓ 3 callers
Function
TaskAttempt
TaskAttempt runs the late ingress hooks of a task or Midjourney submission attempt on the client body, before the attempt validates and prices it: tho
relay/requestplugin/relay.go:127
↓ 3 callers
Function
TaskBulkUpdateByID
TaskBulkUpdateByID performs an unconditional bulk UPDATE by primary key IDs. WARNING: This function has NO CAS (Compare-And-Swap) guard — it will over
model/task.go:604
↓ 3 callers
Function
TaskExprCompatible
TaskExprCompatible checks the schema contract even for usage references in branches that the current request would not evaluate. Chat request quantiti
setting/billing_setting/tiered_billing.go:136
↓ 3 callers
Function
TaskGetAllUserTask
(userId int, startIdx int, num int, queryParams SyncTaskQueryParams)
model/task.go:319
↓ 3 callers
Method
TaskIDInQuery
TaskIDInQuery reports whether a query route reads its task id from the query string, as the MiniMax v1 query does (?task_id=): the route's path has no
pluginkit/routing.go:543
↓ 3 callers
Function
TaskModel2Dto
(task *model.Task)
relay/relay_task.go:695
↓ 3 callers
Method
TaskPluginBindings
TaskPluginBindings returns the sorted, de-duplicated set of task plugins the channel binds through either field, so callers can compare bindings as a
relaykit/dto/channel_settings.go:55
↓ 3 callers
Function
TaskPluginEndpointOnly
TaskPluginEndpointOnly applies middleware only after a shared endpoint has been claimed. This preserves the original middleware chain for unclaimed vi
middleware/task_plugin.go:742
↓ 3 callers
Method
Terminal
Terminal checks the event that ends the response and returns it as the client gets it, for the session to send; the events released before it go out f
relay/requestplugin/socket.go:108
↓ 3 callers
Method
ToString
()
relay/common/relay_info.go:378
↓ 3 callers
Function
TokenOrTaskArtifactAccessAuth
TokenOrTaskArtifactAccessAuth accepts the normal relay API Bearer token or a route-bound capability. Capabilities are verified before any database rea
middleware/task_artifact_access.go:174
↓ 3 callers
Function
TopupGroupRatio2JSONString
()
common/topup-ratio.go:15
↓ 3 callers
Method
TryLock
()
controller/user.go:1258
↓ 3 callers
Method
Update
()
model/model_meta.go:261
↓ 3 callers
Function
UpdateAuthFlowPayload
UpdateAuthFlowPayload replaces the payload of an unconsumed, unexpired flow only while it still holds expected, so of two concurrent submits of one st
model/auth_flow.go:293
↓ 3 callers
Function
UpdateChannel
(c *gin.Context)
controller/channel.go:1218
↓ 3 callers
Function
UpdateChannelBalanceDetail
UpdateChannelBalanceDetail stores a balance query of a channel. update gets the stored detail, nil before the first query, and returns the detail to s
model/channel_balance.go:45
↓ 3 callers
Function
UpdateChannelOtherInfo
UpdateChannelOtherInfo runs update on the stored channel and writes the other_info it leaves, with the columns update returns, only while the stored o
model/channel.go:381
↓ 3 callers
Function
UpdateCompletionRatioByJSONString
(jsonStr string)
setting/ratio_setting/model_ratio.go:432
↓ 3 callers
Function
UpdatePendingTopUpStatus
(tradeNo string, expectedPaymentProvider string, targetStatus string)
model/topup.go:146
↓ 3 callers
Function
UpdateRequestPolicyOptions
UpdateRequestPolicyOptions validates the entire resulting policy before any write. Unknown JSON rule fields stay in the original option string.
model/request_policy.go:211
↓ 3 callers
Function
UpdateToken
(c *gin.Context)
controller/token.go:402
↓ 3 callers
Function
UpdateTopupGroupRatioByJSONString
(jsonStr string)
common/topup-ratio.go:25
↓ 3 callers
Function
UpdateUserBindColumn
UpdateUserBindColumn 第三方账号绑定字段的专用更新。 绑定操作必须只写绑定列:若改为“读取完整用户 → 改一个字段 → 整体更新”, 读快照期间并发发生的封禁、降权或分组变更会被旧快照覆盖恢复。 角色、状态、分组只允许通过各自带锁/CAS 的专用方法修改。
model/user.go:214
↓ 3 callers
Method
UpdateWithTx
(tx *gorm.DB, updatePassword bool)
model/user.go:809
↓ 3 callers
Function
UpsertSystemInstance
(nodeName string, info any, startedAt int64, lastSeenAt int64)
model/system_instance.go:46
↓ 3 callers
Function
UsageFromResponsesUsage
(src *dto.Usage)
relaykit/relayconvert/response_compat.go:180
↓ 3 callers
Function
ValidUsage
(usage *dto.Usage)
service/usage_helpr.go:32
↓ 3 callers
Function
ValidateChannelTestConcurrency
(value string)
setting/operation_setting/monitor_setting.go:75
↓ 3 callers
Method
ValidateResolvedIP
ValidateResolvedIP validates a domain's resolved IP immediately before dialing it.
common/ssrf_protection.go:315
↓ 3 callers
Function
ValidateStepUpIdentity
ValidateStepUpIdentity checks that the identity requesting or consuming a proof is still live: a browser session or a scoped access token.
service/auth_session.go:154
↓ 3 callers
Function
ValidateTOTPCode
ValidateTOTPCode 验证TOTP验证码
common/totp.go:38
↓ 3 callers
Function
ValidateTaskArtifactBaseURL
ValidateTaskArtifactBaseURL validates configuration syntax only. It deliberately performs no DNS lookup or reachability probe.
service/task_artifact_access.go:70
↓ 3 callers
Function
ValidateToolPricesJSON
ValidateToolPricesJSON validates an operator-supplied complete price map. A numeric zero is valid and intentionally disables the matching rule.
setting/operation_setting/tools.go:191
↓ 3 callers
Function
ValidateURLWithFetchSetting
ValidateURLWithFetchSetting 使用FetchSetting配置验证URL
common/ssrf_protection.go:376
↓ 3 callers
Function
VerifyTwoFactorCode
VerifyTwoFactorCode classifies the input before verification so one failed submission cannot increment the failure counter for both TOTP and backup co
service/security_verification.go:621
↓ 3 callers
Function
WithClaudeError
(claudeError ClaudeError, statusCode int, ops ...NewAPIErrorOptions)
relaykit/types/error.go:357
↓ 3 callers
Function
WithCollector
(ctx context.Context)
relaykit/relayconvert/internal/convdiag/collector.go:16
↓ 3 callers
Method
WithDefaults
(serverAddress string)
setting/system_setting/passkey.go:154
↓ 3 callers
Method
WithSkippedRoutes
WithSkippedRoutes returns a shallow immutable copy that leaves the given routes out of RouteGroups. Callers use it before publication.
pkg/jsplugin/routing.go:338
↓ 3 callers
Method
Write
(data []byte)
router/plugin-router.go:553
↓ 3 callers
Function
WriteNativeReply
WriteNativeReply writes what a native presenter returned. A value is the JSON body of a reply with the given status (200 for submit and query presente
middleware/task_plugin.go:1567
↓ 3 callers
Function
abortTaskPluginRouteError
(c *gin.Context, status int)
middleware/task_plugin.go:1695
↓ 3 callers
Function
accessTokenMutationEndpoints
accessTokenMutationEndpoints lists every proof-guarded access token operation for one scoped token of the test user.
controller/security_enrollment_test.go:159
↓ 3 callers
Function
actionFor
(req)
plugins/tasks/vidu/plugin.js:305
↓ 3 callers
Function
actionForImageCount
(imageCount)
plugins/tasks/jimeng/plugin.js:114
↓ 3 callers
Function
actionName
(ctx)
plugins/tasks/sunoapi/plugin.js:74
↓ 3 callers
Function
activateTaskPlugin
(key: string, version: string)
web/src/features/task-plugins/api.ts:157
↓ 3 callers
Method
add
add keeps steps and record entries for the session's log and its next report, within their bounds: entries past the bound are counted in a last {trunc
relay/requestplugin/socket.go:413
↓ 3 callers
Function
affinityTestKeys
(t *testing.T)
service/channel_affinity_usage_cache_test.go:17
↓ 3 callers
Function
apiKeyHeaderAuth
()
web/src/features/channels/lib/advanced-custom.ts:231
↓ 3 callers
Function
apiRoot
(ctx)
plugins/tasks/kling/plugin.js:173
↓ 3 callers
Function
appendEncodedWebSearch
appendEncodedWebSearch runs the host encoder for a Responses, Claude, or Gemini target. When the encoder handled the definition, its diagnostics and t
relaykit/relayconvert/internal/toolconv/encode.go:205
↓ 3 callers
Function
appendToolSurchargeLogInfo
(other *model.LogOther, items []ToolSurchargeItem)
service/text_quota.go:31
↓ 3 callers
Function
applyAuthTemplate
(template string, apiKey string)
relay/channel/advancedcustom/adaptor.go:572
↓ 3 callers
Function
applyPriceSyncSelections
( options: PricingOptions, selections: Record<string, Record<string, number | string>> )
web/src/features/model-pricing/pricing.ts:364
↓ 3 callers
Function
applyRankingQuotaTimeRange
(query *gorm.DB, startTime int64, endTime int64)
model/usedata_rankings.go:77
↓ 3 callers
Function
applyStartupSyncRevisions
applyStartupSyncRevisions records the revisions read before the startup loads as applied. A topic whose startup load failed, or every topic when that
service/node_sync.go:140
↓ 3 callers
Method
applyStepHeaders
applyStepHeaders sets the headers a hook gave a request. They cannot touch the route auth header, the credential's headers or the content type, which
relay/channel/providerplugin/chain.go:188
↓ 3 callers
Function
artifactData
(ctx)
plugins/tasks/sunoapi/plugin.js:183
↓ 3 callers
Function
artifactKey
(type, song)
plugins/tasks/sunoapi/plugin.js:192
↓ 3 callers
Function
asClaudeResponse
(response any)
relaykit/relayconvert/response_registry.go:1302
↓ 3 callers
Function
asGeminiChatResponse
(response any)
relaykit/relayconvert/response_registry.go:1313
↓ 3 callers
Function
asOAIChatResponse
(response any)
relaykit/relayconvert/response_registry.go:1258
↓ 3 callers
Function
assertAccessTokensUnchanged
assertAccessTokensUnchanged checks that the seeded scoped token keeps its name and grant and that the legacy token still authenticates.
controller/security_enrollment_test.go:170
↓ 3 callers
Function
assignDisplayLogIds
(logs []*Log, startIdx int)
model/log.go:109
↓ 3 callers
Function
attachedFunctions
attachedFunctions returns the function declarations and the tool choice that AttachRequest wrote into a Chat, Claude, or Gemini request, decoded from
relaykit/relayconvert/internal/toolconv/policy_test.go:141
↓ 3 callers
Function
auditResponseSuccess
auditResponseSuccess 依据 HTTP 状态码与响应体推断操作是否成功。 优先解析响应 JSON 中的 success 字段;无法解析时退回到状态码判断。
middleware/audit.go:190
↓ 3 callers
Function
authFlowTokenHash
(token string)
model/auth_flow.go:144
↓ 3 callers
Function
authHelper
(c *gin.Context, minRole int)
middleware/auth.go:52
↓ 3 callers
Function
authorizationToken
(header string)
middleware/auth.go:345
↓ 3 callers
Function
avg
(sum int64, count int64)
pkg/perf_metrics/metrics.go:549
↓ 3 callers
Function
avgTps
(value counters)
pkg/perf_metrics/metrics.go:563
↓ 3 callers
Function
awsStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, a *Adaptor)
relay/channel/aws/relay-aws.go:266
↓ 3 callers
Method
base64URL
(value: string)
pluginkit/v1.d.ts:23
↓ 3 callers
Method
base64URLDecode
(value: string)
pluginkit/v1.d.ts:24
↓ 3 callers
Method
batchQueryContext
(key, baseURL, proxy string, tasks []map[string]any)
relay/channel/task/jsplugin/adaptor.go:1337
↓ 3 callers
Function
bodyHash
bodyHash is the hex SHA-256 of a request body, which signRequest gets.
relay/channel/providerplugin/chain.go:105
↓ 3 callers
Function
bodySHA256
(body []byte)
relay/channel/task/jsplugin/credential.go:170
↓ 3 callers
Function
boolPtr
(v bool)
relaykit/relayconvert/reasoning/intent_test.go:215
↓ 3 callers
Function
boxHeader
(bytes, offset, end)
plugins/tasks/xai/plugin.js:597
↓ 3 callers
Function
buildApiParams
(config: { page: number pageSize: number searchParams: Record<string, unknown> columnFilters?: Array<{
web/src/features/usage-logs/lib/utils.ts:157
↓ 3 callers
Function
buildApiPath
(endpoint: string, isAdmin: boolean)
web/src/features/usage-logs/api.ts:40
↓ 3 callers
Function
buildAuditDetails
( entry: AuditLog, t: TFunction, options: AuditDetailOptions = {} )
web/src/features/usage-logs/audit/lib/audit-details.ts:389
↓ 3 callers
Function
buildChannelAffinityStatsContextForTest
(ruleName, usingGroup, keyFP string)
service/channel_affinity_usage_cache_test.go:23
↓ 3 callers
Function
buildDashboardFlowData
( rows: FlowQuotaDataItem[], metric: FlowMetric = 'quota', options: FlowBuildOptions = {} )
web/src/features/dashboard/lib/flow.ts:976
↓ 3 callers
Function
buildEstimatorTokens
( promptTokens: number, completionTokens: number, extraTokenValues: ExtraTokenValues, exprStr: string
web/src/features/pricing/lib/tier-expr.ts:320
↓ 3 callers
Function
buildFlowSankeySpec
( flow: DashboardFlowGraph, title: string, valueFormatter: (value: number) => string = formatNumber, l
web/src/features/dashboard/lib/flow.ts:1122
↓ 3 callers
Function
buildFormDefaults
(defaults: FlatOAuthDefaults)
web/src/features/system-settings/auth/oauth-section.tsx:178
↓ 3 callers
Function
buildLogLikeCondition
(column string, value string)
model/log.go:32
↓ 3 callers
Function
buildOAuthCallbackUrl
( serverAddress: string, callbackPath: string, fallback: string )
web/src/features/system-settings/auth/oauth-callback-url.ts:27
↓ 3 callers
Function
buildOpenAIModel
(modelName string, ownerByModel map[string]string)
controller/model.go:178
↓ 3 callers
Function
buildPreviewRows
( values: ModelPricingFormValues, mode: PricingMode, billingExpr: string, requestRuleExpr: string, p
web/src/features/system-settings/models/model-pricing-core.ts:261
↓ 3 callers
Function
buildPricingChanges
( snapshot: ModelPricingConfig, before: PricingOptions, after: PricingOptions )
web/src/features/model-pricing/api.ts:179
↓ 3 callers
Function
buildQueryParams
( params: Record<string, unknown> )
web/src/features/usage-logs/lib/query-params.ts:19
↓ 3 callers
Function
buildQuotaAuditOperation
( action: string, params: Record<string, unknown>, success: boolean, t: Translate )
web/src/features/usage-logs/lib/quota-audit-operation.ts:46
↓ 3 callers
Function
buildResponsesWSCreateEvent
(jsonData []byte, generate common.RawMessage, streamID string)
relay/responses_websocket.go:1013
← previous
next →
2,401–2,500 of 15,592, ranked by callers