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
↓ 19 callers
Function
compileProviderPlugin
(t *testing.T, relay, source string)
pkg/jsplugin/provider_test.go:36
↓ 19 callers
Function
mustCompileRoutingPlugin
(t *testing.T, key string, channelType int, models, metaFields, exports string)
pkg/jsplugin/routing_test.go:1200
↓ 19 callers
Function
newInfo
(bound ...string)
relay/requestplugin/requestplugin_test.go:101
↓ 19 callers
Function
newPluginProtocolTestContext
(stream, requestBodyStream bool)
controller/plugin_protocol_test.go:1480
↓ 19 callers
Function
resolve
resolve returns the value at tokens.
pkg/requestpatch/patch.go:600
↓ 19 callers
Function
semanticLoss
(path string, code string, message string)
relaykit/relayconvert/internal/toolconv/encode.go:1678
↓ 19 callers
Function
splitBillingExprAndRequestRules
(expr: string)
web/src/features/pricing/lib/billing-expr.ts:612
↓ 19 callers
Function
useDataTable
(options: UseDataTableOptions<TData>)
web/src/components/data-table/hooks/use-data-table.ts:278
↓ 19 callers
Function
useProviderPluginDatabase
useProviderPluginDatabase installs a database for the provider plugin tests. TEST_TASK_DB_DIALECT selects mysql or postgres through TEST_MYSQL_DSN and
service/provider_plugin_test.go:42
↓ 18 callers
Function
CloneBillingUsage
(usage *BillingUsage)
relaykit/dto/billing_usage.go:223
↓ 18 callers
Function
ConvertRequest
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, request any)
service/request_converter.go:26
↓ 18 callers
Method
Error
Error records a soft error. The stream continues processing. Can be called multiple times per chunk.
relay/helper/stream_result.go:25
↓ 18 callers
Function
GetAdaptor
(apiType int)
relay/relay_adaptor.go:51
↓ 18 callers
Function
NormalizeEmail
(email string)
model/user.go:311
↓ 18 callers
Method
OtherRatios
()
types/price_data.go:67
↓ 18 callers
Function
Reply
Reply starts the reply checks of a channel attempt, and the report capture when the attempt brings a report instance: before the attempt's handler run
relay/requestplugin/reply.go:76
↓ 18 callers
Function
SendEmail
(subject string, receiver string, content string)
common/email.go:78
↓ 18 callers
Method
SetEstimatePromptTokens
func (info *RelayInfo) SetPromptTokens(promptTokens int) { info.promptTokens = promptTokens }
relay/common/relay_info.go:850
↓ 18 callers
Function
UnmarshalBodyReusableNoCopy
UnmarshalBodyReusableNoCopy borrows from immutable memory bodies and decodes disk bodies through a file reader. Clone the decoded request before apply
common/gin.go:126
↓ 18 callers
Function
UpdateOption
(key string, value string)
model/option.go:288
↓ 18 callers
Function
getLobeIcon
( iconName: string | undefined | null, size: number = 20 )
web/src/lib/lobe-icon.tsx:131
↓ 18 callers
Function
pinTaskPluginRoute
(plugin *jsplugin.LoadedPlugin, routeIndex int)
middleware/task_plugin_test.go:2025
↓ 18 callers
Function
safeJsonParseWithValidation
( value: string | undefined | null, options: SafeJsonParseWithValidationOptions<T> )
web/src/features/system-settings/utils/json-parser.ts:141
↓ 18 callers
Function
setInstances
(t *testing.T, instances string)
relay/requestplugin/requestplugin_test.go:85
↓ 17 callers
Function
BuildTieredTokenParams
BuildTieredTokenParams constructs billingexpr.TokenParams from a dto.Usage, normalizing P and C so they mean "tokens not separately priced by the expr
service/tiered_settle.go:32
↓ 17 callers
Function
Can
Can reports whether the subject may perform the permission. A superuser role short-circuits to allow. Otherwise a per-user override wins, then the uni
service/authz/resolver.go:10
↓ 17 callers
Function
ComputeTieredQuota
ComputeTieredQuota runs the Expr from a frozen BillingSnapshot against actual token counts and returns the settlement result.
pkg/billingexpr/settle.go:24
↓ 17 callers
Method
ExtractUsageFactsValidated
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/adapter.go:146
↓ 17 callers
Function
GetGeminiSettings
GetGeminiSettings 获取Gemini配置
setting/model_setting/gemini.go:66
↓ 17 callers
Function
GetPageQuery
(c *gin.Context)
common/page_info.go:41
↓ 17 callers
Function
GetPricing
()
model/pricing.go:84
↓ 17 callers
Function
Init
(db *gorm.DB)
service/authz/enforcer.go:33
↓ 17 callers
Method
ParseResponse
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo)
relay/channel/adapter.go:79
↓ 17 callers
Function
RelayErrorHandler
(ctx context.Context, resp *http.Response, showBodyWhenFail bool)
service/error.go:87
↓ 17 callers
Function
RequireSecurityProof
RequireSecurityProof validates a proof against the authenticated dashboard session or scoped access token and writes the shared proof error contract o
middleware/secure_verification.go:40
↓ 17 callers
Method
Routes
()
pkg/jsplugin/routing.go:619
↓ 17 callers
Method
Seek
(offset int64, whence int)
common/body_storage.go:231
↓ 17 callers
Method
SetItems
(items any)
common/page_info.go:37
↓ 17 callers
Method
SetSetting
(setting dto.UserSetting)
model/user.go:176
↓ 17 callers
Method
SetToolCalls
(toolCalls any)
relaykit/dto/openai_request.go:691
↓ 17 callers
Method
SetTotal
(total int)
common/page_info.go:33
↓ 17 callers
Method
Text
Text returns the text for lang: its own locale, then the bare language, then the first regional locale of that language in sorted order, then en.
pkg/jsplugin/provider.go:1846
↓ 17 callers
Method
close
()
web/src/features/playground/hooks/use-stream-request.test.ts:50
↓ 17 callers
Method
closeAndWait
(t *testing.T)
controller/responses_websocket_test.go:290
↓ 17 callers
Function
finish
(result)
web/src/features/auth/lib/oauth-popup.ts:82
↓ 17 callers
Function
getServerMessage
(value: unknown)
web/src/lib/server-error-message.ts:162
↓ 17 callers
Function
newPluginRouterTest
( t *testing.T, plugins []*jsplugin.LoadedPlugin, handlers pluginRouteHandlers, )
router/plugin_router_test.go:1008
↓ 17 callers
Function
newResponsesWSBillingTest
(t *testing.T, expression string, handle func(*websocket.Conn, *http.Request), httpEvents ...string)
controller/responses_websocket_test.go:330
↓ 17 callers
Function
requireSuccess
(response: ApiResponse<T>)
web/src/features/task-plugins/api.ts:63
↓ 17 callers
Function
setupUserSessionTest
(t *testing.T)
model/user_session_test.go:43
↓ 17 callers
Function
sideDrawerContentClassName
(className?: string)
web/src/components/drawer-layout.ts:24
↓ 17 callers
Function
trimmed
(value)
plugins/tasks/hailuo/plugin.js:171
↓ 16 callers
Method
AddPin
(p ChannelPin)
dto/channel_constraints.go:61
↓ 16 callers
Function
ClaimSystemTask
(id int64, taskType string, runnerID string, lockUntil int64)
model/system_task.go:365
↓ 16 callers
Function
ConsumeOperationProof
ConsumeOperationProof accepts a proof at most once. The consumption commits before the caller performs its action; an action failure must not restore
service/security_verification.go:507
↓ 16 callers
Function
FinishSystemTask
(taskID string, lockedBy string, status SystemTaskStatus, resultPayload any, errorMessage string)
model/system_task.go:539
↓ 16 callers
Function
GetPointer
(v T)
common/utils.go:277
↓ 16 callers
Function
GetQuotaDisplayType
GetQuotaDisplayType 返回额度展示类型
setting/operation_setting/general_setting.go:55
↓ 16 callers
Method
Kind
Kind names the rule category: "scope", "any" or "session".
middleware/access_token_routes.go:365
↓ 16 callers
Function
NewPluginResponsesMachine
(taskID, model string, createdAt int64, limits PluginProtocolLimits)
relay/plugin_protocol.go:378
↓ 16 callers
Function
PasskeySettingsSnapshot
PasskeySettingsSnapshot includes the effective defaults without sharing a mutable settings pointer with a WebAuthn ceremony.
setting/system_setting/passkey.go:32
↓ 16 callers
Function
ResetStatusCode
(newApiErr *types.NewAPIError, statusCodeMappingStr string)
service/error.go:140
↓ 16 callers
Method
SetData
(data any)
model/task.go:75
↓ 16 callers
Method
SetEndReason
(reason StreamEndReason, err error)
relay/common/stream_status.go:77
↓ 16 callers
Method
SetReasoningEffort
SetReasoningEffort records the effort level a converter derived from a model-name suffix so downstream billing/logging can see it.
relaykit/relayconvert/convmeta/meta.go:32
↓ 16 callers
Function
Unregister
Unregister removes a provider from the registry
oauth/registry.go:55
↓ 16 callers
Function
UserAuth
()
middleware/auth.go:132
↓ 16 callers
Function
ValidateAuthSessionWithTx
ValidateAuthSessionWithTx rechecks the authoritative identity while holding the user/session locks until the caller's credential change or flow consum
model/auth_flow.go:103
↓ 16 callers
Method
ValidateConfig
ValidateConfig checks an instance config against meta.configSchema and returns it with the defaults of absent properties applied. Without a schema onl
pkg/jsplugin/config_schema.go:158
↓ 16 callers
Function
ValidateLoginSession
(identity AuthIdentity)
service/auth_session.go:130
↓ 16 callers
Function
countLogs
(t *testing.T)
service/task_billing_test.go:586
↓ 16 callers
Function
executeTaskSubmissionWith
( c *gin.Context, relayInfo *relaycommon.RelayInfo, submit taskSubmitAttempt, )
controller/relay.go:602
↓ 16 callers
Function
newTestUserSession
(sid string, userID int, now int64)
model/user_session_test.go:82
↓ 16 callers
Function
normalizeAdvancedCustomConfig
( config: AdvancedCustomConfig )
web/src/features/channels/lib/advanced-custom.ts:580
↓ 16 callers
Function
pluginCredentialKeyLines
pluginCredentialKeyLines splits a channel key into its lines: the whole key is the one line of a single-key channel. An empty key has none.
service/provider_plugin.go:426
↓ 16 callers
Function
pluginProtocolTestOutcome
( info *relaycommon.RelayInfo, pluginKey string, taskID string, _ ...any, )
controller/plugin_protocol_test.go:1522
↓ 16 callers
Function
replyContext
replyContext is a relay request on path from user alice with token ci, past its ingress stage.
relay/requestplugin/requestplugin_test.go:986
↓ 16 callers
Function
resetPricingEndpointTestTables
(t *testing.T)
model/pricing_endpoint_test.go:14
↓ 16 callers
Method
scope
scope returns the instances that run at stage for a request for model, in order: the global ones, then those of group, then the channel's bound ids; e
relay/requestplugin/plan.go:178
↓ 16 callers
Function
setupGenericTaskTest
(t *testing.T)
controller/task_generic_test.go:27
↓ 16 callers
Function
setupModelListControllerTestDB
(t *testing.T)
controller/model_list_test.go:37
↓ 16 callers
Function
setupStreamTest
(t *testing.T, body io.Reader)
relay/helper/stream_scanner_test.go:106
↓ 16 callers
Function
writeJSON
(w http.ResponseWriter, status int, value any)
service/provider_plugin_test.go:136
↓ 15 callers
Function
Add
(ctx context.Context, diagnostics ...types.ConversionDiagnostic)
relaykit/relayconvert/internal/convdiag/collector.go:27
↓ 15 callers
Method
ChannelConfigFor
ChannelConfigFor returns a channel's stored plugin config as its hooks get it: the properties meta.channelConfig declares, with the defaults of absent
pkg/jsplugin/config_schema.go:253
↓ 15 callers
Function
GetBodyStorage
GetBodyStorage 获取请求体存储对象(用于需要多次读取的场景)
common/gin.go:97
↓ 15 callers
Function
GetFetchSetting
()
setting/system_setting/fetch_setting.go:32
↓ 15 callers
Method
LookupEndpoint
(method, path, model string)
pkg/jsplugin/routing.go:583
↓ 15 callers
Function
NewClaudeMessagesBillingUsage
(usage *ClaudeUsage)
relaykit/dto/billing_usage.go:25
↓ 15 callers
Function
PostTextConsumeQuota
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.Usage, extraContent []*common.Message)
service/text_quota.go:400
↓ 15 callers
Method
Valid
(data []byte)
relaykit/relayconvert/kitutil/json.go:21
↓ 15 callers
Function
ValidatePasswordAndHash
(password string, hash string)
common/crypto.go:30
↓ 15 callers
Function
WithFetcher
WithFetcher makes utils.fetch available to the hook called with ctx.
pkg/jsplugin/fetch.go:59
↓ 15 callers
Method
append
append adds an accepted request without preallocating for the configured limit.
common/rate-limit.go:23
↓ 15 callers
Function
assertResponsesWSAccounting
(t *testing.T, fixture *responsesWSBillingTest, expectedQuotas []int)
controller/responses_websocket_test.go:512
↓ 15 callers
Function
decodePluginValue
(t *testing.T, value any)
plugins/vertex_ai_responses_test.go:199
↓ 15 callers
Function
getServerErrorMessage
( value: unknown, fallback?: string )
web/src/lib/server-error-message.ts:186
↓ 15 callers
Function
getUserCacheKey
getUserCacheKey returns the key for user cache
model/user_cache.go:62
↓ 15 callers
Function
insertPricingEndpointAbility
(t *testing.T, channelID int, modelName string)
model/pricing_endpoint_test.go:49
↓ 15 callers
Function
readResponsesWSTestEvent
(t *testing.T, client *websocket.Conn)
controller/responses_websocket_test.go:502
← previous
next →
301–400 of 15,409, ranked by callers