Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
12,054 in github.com/QuantumNous/new-api
⨍
Functions
12,054
◇
Types & classes
1,812
↓ 8 callers
Method
ApplyTick
ApplyTick maps bounded plugin semantics onto host-owned Responses events. taskStatus is the current durable DB status (for example, IN_PROGRESS, SUCCE
relay/plugin_protocol.go:444
↓ 8 callers
Function
BuildTaskPluginView
BuildTaskPluginView converts a persisted task into the deliberately narrow public shape permitted at JavaScript plugin boundaries.
service/task_plugin_view.go:11
↓ 8 callers
Method
Close
()
relay/channel/openai/image_stream_test.go:165
↓ 8 callers
Method
ConvertClaudeRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.ClaudeRequest)
relay/channel/adapter.go:32
↓ 8 callers
Method
CreatedEvent
()
relay/plugin_protocol.go:430
↓ 8 callers
Method
Decode
(r io.Reader, v any)
relaykit/relayconvert/kitutil/json.go:20
↓ 8 callers
Method
DeleteMany
DeleteMany accepts either fully namespaced keys or raw keys and deletes them. It returns a map keyed by fully namespaced keys.
pkg/cachex/hybrid_cache.go:231
↓ 8 callers
Method
Export
Export returns one module export without exposing Sobek values outside the engine boundary. It is used for declarative exports such as meta.
pkg/jsplugin/engine.go:187
↓ 8 callers
Function
GetModelRatio
(name string)
setting/ratio_setting/model_ratio.go:385
↓ 8 callers
Function
GetOIDCSettings
()
setting/system_setting/oidc.go:28
↓ 8 callers
Function
GetTopUpByTradeNo
(tradeNo string)
model/topup.go:135
↓ 8 callers
Method
GetUsageMetadata
()
relaykit/dto/gemini.go:522
↓ 8 callers
Function
HashAccountPassword
HashAccountPassword is for account passwords, not MFA backup codes. The temporary bcrypt mode permits rolling out dual-format readers to all nodes bef
common/account_password.go:44
↓ 8 callers
Function
IssueAccessToken
(identity AuthIdentity)
service/auth_token.go:60
↓ 8 callers
Function
OaiResponsesHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay_responses.go:21
↓ 8 callers
Function
OpenaiImageStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay_image.go:93
↓ 8 callers
Function
ParseEffort
(value string)
relaykit/relayconvert/reasoning/intent.go:123
↓ 8 callers
Function
PrepareMidjourneyTaskBilling
PrepareMidjourneyTaskBilling sets the durable refund marker before the task is inserted.
service/midjourney.go:35
↓ 8 callers
Function
RecordConsumeLog
(c *gin.Context, userId int, params RecordConsumeLogParams)
model/log.go:339
↓ 8 callers
Function
ReloadPolicy
()
service/authz/enforcer.go:69
↓ 8 callers
Function
RequireVerificationMethod
(identity AuthIdentity, scope, method string)
service/security_verification.go:313
↓ 8 callers
Method
Reset
Reset clears pending observations (used when a terminal response fails).
relay/common/tool_usage.go:129
↓ 8 callers
Function
ResetProxyClientCache
ResetProxyClientCache clears cached proxy and non-default direct policy clients and closes idle connections on every transport/shard. The package-leve
service/http_client.go:453
↓ 8 callers
Method
SaveToDB
SaveToDB 将配置保存到数据库
setting/config/config.go:71
↓ 8 callers
Function
UpdateUserUsableGroupsByJSONString
(jsonStr string)
setting/user_usable_group.go:37
↓ 8 callers
Method
Usage
()
relaykit/relayconvert/response_registry.go:405
↓ 8 callers
Method
Valid
(data []byte)
relaykit/relayconvert/kitutil/json.go:21
↓ 8 callers
Function
ValidateAccessToken
(token string)
model/user.go:1236
↓ 8 callers
Function
ValidateFlowAuthorization
ValidateFlowAuthorization permits a dedicated configuration flow to outlive its consumed proof, while retaining its operation, session and method poli
service/security_verification.go:386
↓ 8 callers
Function
ValidateSSRFProtectedFetchURL
(urlStr string)
service/http_client.go:71
↓ 8 callers
Method
authorization
(t *testing.T, intent string, identity service.AuthIdentity, scope string, claims jwt.MapClaims)
controller/telegram_test.go:154
↓ 8 callers
Function
canManageTargetRole
(myRole int, targetRole int)
controller/user.go:380
↓ 8 callers
Function
cloneRaw
(raw []byte)
relaykit/relayconvert/internal/toolconv/decode.go:799
↓ 8 callers
Function
compilePluginProtocolRetrieveEndpoint
(t *testing.T, key, source string, options pluginruntime.Options)
controller/plugin_protocol_test.go:1537
↓ 8 callers
Function
convertCompatRequest
(c context.Context, info convmeta.Meta, target types.RelayFormat, request any)
relaykit/relayconvert/request_compat.go:63
↓ 8 callers
Function
defaultHTTPTransportPolicy
()
service/http_transport_policy.go:22
↓ 8 callers
Function
effectiveBillingUsage
(usage *dto.Usage)
service/billing_usage.go:19
↓ 8 callers
Function
formatQuotaWithCurrency
( quota: number | null | undefined, options?: CurrencyFormatOptions )
web/src/lib/currency.ts:516
↓ 8 callers
Function
getCurrencyLabel
()
web/src/lib/currency.ts:546
↓ 8 callers
Function
getTaskEnumFields
( schema: BillingUsageSchema | null | undefined )
web/src/features/pricing/lib/task-expr.ts:78
↓ 8 callers
Function
getTokenUsedQuota
(t *testing.T, id int)
service/task_billing_test.go:482
↓ 8 callers
Function
getUserAuthVersionKey
(userId int)
model/user_auth_cache.go:30
↓ 8 callers
Function
hasParsedChildren
( node: ParsedNode )
web/src/components/ai-elements/response-node-guards.ts:36
↓ 8 callers
Function
insertOriginTaskChannel
(t *testing.T, status int)
middleware/task_plugin_origin_task_test.go:43
↓ 8 callers
Function
insertPricingEndpointChannel
(t *testing.T, channelID int, channelType int, settings dto.ChannelOtherSettings)
model/pricing_endpoint_test.go:34
↓ 8 callers
Function
intPtr
(v int)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp.go:263
↓ 8 callers
Function
isDynamicPricingModel
(model: PricingModel)
web/src/features/pricing/lib/dynamic-price.ts:131
↓ 8 callers
Function
isTagAggregateRow
(row: Channel | TagRow)
web/src/features/channels/lib/channel-utils.ts:617
↓ 8 callers
Function
jsonValue
(value any)
relay/channel/task/jsplugin/adaptor.go:1551
↓ 8 callers
Method
memCache
()
pkg/cachex/hybrid_cache.go:69
↓ 8 callers
Function
metricValue
(metrics: FlowMetrics, metric: FlowMetric)
web/src/features/dashboard/lib/flow.ts:164
↓ 8 callers
Function
newAuthzTestDB
(t *testing.T)
service/authz/authz_test.go:14
↓ 8 callers
Function
newConvertRequestFailedError
(c *gin.Context, info *relaycommon.RelayInfo, err error)
relay/convert_request_error.go:13
↓ 8 callers
Function
newImageTestContext
(t *testing.T, body, contentType string, isStream bool)
relay/channel/openai/image_stream_test.go:19
↓ 8 callers
Function
newOuterPluginTestEngine
()
router/plugin_router_test.go:815
↓ 8 callers
Function
newPluginProtocolObservationLimiter
(limits pluginProtocolObservationLimits)
controller/plugin_protocol_limiter.go:56
↓ 8 callers
Function
newPluginProtocolRetrieveContext
(responseID string)
controller/plugin_protocol_test.go:1553
↓ 8 callers
Function
newSecurityLoginPasskey
(t *testing.T, userID int)
controller/auth_flow_test.go:33
↓ 8 callers
Function
normalizeHeaderContextKey
(key string)
relay/common/override.go:1626
↓ 8 callers
Function
pluginProtocolRetrieveDeps
(pinned pluginruntime.PinnedEndpoint, task *model.Task, exists bool, err error)
controller/plugin_protocol_test.go:1563
↓ 8 callers
Function
presentationLoss
(path string, code string, message string)
relaykit/relayconvert/internal/toolconv/encode.go:1302
↓ 8 callers
Function
rawJSONPresent
(value json.RawMessage)
relaykit/relayconvert/internal/toolconv/response_artifacts.go:805
↓ 8 callers
Method
redisOn
()
pkg/cachex/hybrid_cache.go:59
↓ 8 callers
Function
requireDeploymentID
(c *gin.Context)
controller/deployment.go:120
↓ 8 callers
Function
resetBatchUpdateTestState
(t *testing.T)
model/quota_reserve_test.go:58
↓ 8 callers
Function
resetSessionCookieSettingsAfterTest
(t *testing.T)
common/url_validator_test.go:125
↓ 8 callers
Function
responseStreamEventItemID
(event *dto.ResponsesStreamResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp.go:363
↓ 8 callers
Function
setupTaskSubmissionDatabase
(t *testing.T, migrate bool, events *[]string)
controller/relay_task_plugin_test.go:354
↓ 8 callers
Function
staticProtection
(protection *common.SSRFProtection)
service/protected_fetch_client_test.go:26
↓ 8 callers
Method
submitContext
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/task/jsplugin/adaptor.go:1190
↓ 8 callers
Function
telegramIdentityClaims
(id any)
controller/telegram_test.go:186
↓ 8 callers
Function
telegramOAuthCallback
(state, code string, identity service.AuthIdentity)
controller/telegram_test.go:194
↓ 8 callers
Function
tieredQuota
--------------------------------------------------------------------------- BuildTieredTokenParams: token normalization and ratio parity tests -------
service/tiered_settle_test.go:664
↓ 8 callers
Function
toIntlLocale
(value?: string | null)
web/src/i18n/languages.ts:86
↓ 8 callers
Function
trimmed
(value)
plugins/tasks/alibaba/plugin.js:47
↓ 8 callers
Function
useContextValue
()
web/src/components/ai-elements/context.tsx:52
↓ 8 callers
Function
useRateLimitMiniRedis
(t *testing.T)
middleware/rate_limit_test.go:20
↓ 8 callers
Function
useRedemptions
()
web/src/features/redemption-codes/components/redemptions-provider.tsx:66
↓ 8 callers
Function
useSecureVerification
()
web/src/features/auth/secure-verification/hooks/use-secure-verification.ts:140
↓ 8 callers
Function
useSubscriptions
()
web/src/features/subscriptions/components/subscriptions-provider.tsx:82
↓ 8 callers
Function
useSystemConfig
(options: UseSystemConfigOptions = {})
web/src/hooks/use-system-config.ts:144
↓ 8 callers
Function
useTableUrlState
( params: UseTableUrlStateParams )
web/src/hooks/use-table-url-state.ts:107
↓ 7 callers
Method
CanonicalUsage
CanonicalUsage decodes the original provider usage carried across relay hops into the shared accounting shape. The BillingUsage snapshot remains the s
relaykit/dto/billing_usage.go:236
↓ 7 callers
Function
ConfigureTrustedProxies
(engine *gin.Engine)
middleware/trusted_proxies.go:11
↓ 7 callers
Function
ConsumeAuthFlowWithAction
ConsumeAuthFlowWithAction consumes a flow and runs action in the same database transaction. An action failure rolls the consumption back.
model/auth_flow.go:240
↓ 7 callers
Method
ConvertGeminiRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeminiChatRequest)
relay/channel/adapter.go:33
↓ 7 callers
Function
ConvertStreamResponseChunk
(c *gin.Context, info *relaycommon.RelayInfo, state *relayconvert.ResponseStreamState, response any)
service/response_converter.go:26
↓ 7 callers
Function
DecreaseUserQuota
(id int, quota int, db bool)
model/user.go:1388
↓ 7 callers
Method
FinalResponse
FinalResponse validates a plugin-authored complete Responses object and overwrites every host-owned identity and lifecycle field. Unknown protocol fie
relay/plugin_protocol.go:563
↓ 7 callers
Function
FormatClaudeResponseInfo
(claudeResponse *dto.ClaudeResponse, oaiResponse *dto.ChatCompletionsStreamResponse, claudeInfo *ClaudeRespons
relay/channel/claude/relay-claude.go:83
↓ 7 callers
Function
GenerateHMACWithKey
(key []byte, data string)
common/crypto.go:12
↓ 7 callers
Method
GetAccessToken
()
model/user.go:133
↓ 7 callers
Function
GetAuditLogs
(filter AuditLogFilter, start, limit, viewerRole int)
model/audit_log.go:139
↓ 7 callers
Method
GetAutoBan
()
model/channel.go:343
↓ 7 callers
Function
GetBillingExpr
(model string)
setting/billing_setting/tiered_billing.go:65
↓ 7 callers
Function
GetByTaskId
(userId int, taskId string)
model/task.go:421
↓ 7 callers
Function
GetClaudeSettings
GetClaudeSettings 获取Claude配置
setting/model_setting/claude.go:45
↓ 7 callers
Function
GetContextKeyBool
(c *gin.Context, key constant.ContextKey)
common/gin.go:173
↓ 7 callers
Function
GetContextKeyString
(c *gin.Context, key constant.ContextKey)
common/gin.go:165
↓ 7 callers
Function
GetEnvOrDefaultString
(env string, defaultValue string)
common/env.go:21
← previous
next →
501–600 of 12,054, ranked by callers