Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
11,560 in github.com/QuantumNous/new-api
⨍
Functions
11,560
◇
Types & classes
1,706
↓ 16 callers
Function
pluginProtocolTestOutcome
( info *relaycommon.RelayInfo, pluginKey string, taskID string, _ ...any, )
controller/plugin_protocol_test.go:1498
↓ 16 callers
Function
setupStreamTest
(t *testing.T, body io.Reader)
relay/helper/stream_scanner_test.go:31
↓ 16 callers
Function
sideDrawerContentClassName
(className?: string)
web/src/components/drawer-layout.ts:24
↓ 16 callers
Function
useCopyToClipboard
(options?: UseCopyToClipboardOptions)
web/src/hooks/use-copy-to-clipboard.ts:36
↓ 15 callers
Function
CacheGetChannel
(id int)
model/channel_cache.go:219
↓ 15 callers
Function
ClaimSystemTask
(id int64, taskType string, runnerID string, lockUntil int64)
model/system_task.go:225
↓ 15 callers
Method
Close
()
common/body_storage.go:214
↓ 15 callers
Method
DoResponse
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo)
relay/channel/adapter.go:29
↓ 15 callers
Function
GetSessionAuthIdentity
GetSessionAuthIdentity returns only identities backed by a live dashboard session. PAT-authenticated requests intentionally fail this check.
middleware/auth.go:125
↓ 15 callers
Function
ModelMappedHelper
(c *gin.Context, info *relaycommon.RelayInfo, request dto.Request)
relay/helper/model_mapped.go:14
↓ 15 callers
Function
ModelPriceHelper
(c *gin.Context, info *relaycommon.RelayInfo, promptTokens int, meta *types.TokenCountMeta)
relay/helper/price.go:75
↓ 15 callers
Function
NewPluginResponsesMachine
(taskID, model string, createdAt int64, limits PluginProtocolLimits)
relay/plugin_protocol.go:378
↓ 15 callers
Function
NormalizeEmail
(email string)
model/user.go:304
↓ 15 callers
Method
OtherRatios
()
types/price_data.go:58
↓ 15 callers
Function
RunExprWithRequest
(exprStr string, params TokenParams, request RequestInput)
pkg/billingexpr/run.go:28
↓ 15 callers
Method
Seek
(offset int64, whence int)
common/body_storage.go:205
↓ 15 callers
Function
SetEventStreamHeaders
(c *gin.Context)
relay/helper/common.go:45
↓ 15 callers
Method
Update
(updatePassword bool)
model/user.go:749
↓ 15 callers
Function
newTestUserSession
(sid string, userID int, now int64)
model/user_session_test.go:82
↓ 15 callers
Function
streamValuesFromAny
(value any)
relaykit/relayconvert/response_registry.go:731
↓ 15 callers
Function
useDataTable
(options: UseDataTableOptions<TData>)
web/src/components/data-table/hooks/use-data-table.ts:278
↓ 14 callers
Function
ApplyReasoningModelSuffix
ApplyReasoningModelSuffix parses host-private reasoning suffixes from the origin and mapped model names, attaches the resulting intent to RelayInfo, a
relay/helper/reasoning_suffix.go:25
↓ 14 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:8
↓ 14 callers
Function
GetAdaptor
(apiType int)
relay/relay_adaptor.go:50
↓ 14 callers
Function
GetGeminiSettings
GetGeminiSettings 获取Gemini配置
setting/model_setting/gemini.go:65
↓ 14 callers
Function
GetHttpClient
GetHttpClient returns the general outbound client used by relay/provider integrations. Do not attach the SSRF-protected dialer here: provider base URL
service/http_client.go:153
↓ 14 callers
Function
GetHttpClientWithProxy
GetHttpClientWithProxy returns the default client or a cached proxy-enabled client.
service/http_client.go:382
↓ 14 callers
Function
InitHttpClient
()
service/http_client.go:139
↓ 14 callers
Function
NewClaudeMessagesBillingUsage
(usage *ClaudeUsage)
relaykit/dto/billing_usage.go:25
↓ 14 callers
Function
ResetStatusCode
(newApiErr *types.NewAPIError, statusCodeMappingStr string)
service/error.go:140
↓ 14 callers
Method
Routes
()
pkg/jsplugin/routing.go:490
↓ 14 callers
Function
UpdateModelRatioByJSONString
(jsonStr string)
setting/ratio_setting/model_ratio.go:372
↓ 14 callers
Function
getChannelUsedQuota
(t *testing.T, id int)
service/task_billing_test.go:468
↓ 14 callers
Function
getIoEnterpriseClient
(c *gin.Context)
controller/deployment.go:50
↓ 14 callers
Function
getTaskNumberFields
( schema: BillingUsageSchema | null | undefined )
web/src/features/pricing/lib/task-expr.ts:69
↓ 14 callers
Function
getUserUsageAccounting
(t *testing.T, id int)
service/task_billing_test.go:461
↓ 14 callers
Function
normalizeModelNames
(models []string)
controller/channel_upstream_update.go:101
↓ 14 callers
Function
sideDrawerFormClassName
(className?: string)
web/src/components/drawer-layout.ts:36
↓ 14 callers
Function
sideDrawerHeaderClassName
(className?: string)
web/src/components/drawer-layout.ts:30
↓ 14 callers
Function
trimmed
(value)
plugins/tasks/hailuo/plugin.js:70
↓ 13 callers
Function
ComputeTieredQuota
ComputeTieredQuota runs the Expr from a frozen BillingSnapshot against actual token counts and returns the settlement result.
pkg/billingexpr/settle.go:20
↓ 13 callers
Function
CreateAuthFlow
(input AuthFlowCreate)
model/auth_flow.go:96
↓ 13 callers
Function
DecodePluginProtocolEventResult
DecodePluginProtocolEventResult converts an exported JS value into the deliberately small semantic event contract. Unknown fields are rejected so plug
relay/plugin_protocol.go:131
↓ 13 callers
Method
Error
Error records a soft error. The stream continues processing. Can be called multiple times per chunk.
relay/helper/stream_result.go:21
↓ 13 callers
Function
FormatMatchingModelName
转换模型名,减少渠道必须配置各种带参数模型
setting/ratio_setting/model_ratio.go:713
↓ 13 callers
Function
GetAuthFlow
GetAuthFlow validates a flow without consuming it. Callers must still use ConsumeAuthFlow with all identity-bound fields before performing the action.
model/auth_flow.go:161
↓ 13 callers
Method
GetBillingModelName
GetBillingModelName returns the effective pricing identity without changing either the client-visible model or the model sent to the selected channel.
relay/common/relay_info.go:781
↓ 13 callers
Method
GetContentString
()
relaykit/dto/openai_response.go:105
↓ 13 callers
Function
GetGeneralSetting
()
setting/operation_setting/general_setting.go:40
↓ 13 callers
Function
GetPricing
()
model/pricing.go:70
↓ 13 callers
Function
IncrementUserAuthVersionWithTx
IncrementUserAuthVersionWithTx locks the user, publishes the next deny fence, then persists the version in the caller's transaction. Unscoped is inten
model/user_auth_cache.go:180
↓ 13 callers
Method
LookupEndpoint
(method, path, model string)
pkg/jsplugin/routing.go:453
↓ 13 callers
Function
ModelRatio2JSONString
()
setting/ratio_setting/model_ratio.go:630
↓ 13 callers
Method
cacheEntry
()
model/user_session.go:87
↓ 13 callers
Function
getLobeIcon
( iconName: string | undefined | null, size: number = 20 )
web/src/lib/lobe-icon.tsx:82
↓ 13 callers
Function
requireSuccess
(response: ApiResponse<T>)
web/src/features/task-plugins/api.ts:57
↓ 13 callers
Function
seedChargedAccounting
(t *testing.T, userID, channelID, tokenID, quota, requestCount int)
service/task_billing_test.go:125
↓ 13 callers
Function
writeUserSessionCache
writeUserSessionCache writes a bounded Session snapshot. Active snapshots must carry a deadline captured immediately before their authoritative databa
model/user_session.go:276
↓ 12 callers
Function
ApplyUpstreamBodyMetadata
ApplyUpstreamBodyMetadata restores metadata that net/http cannot infer from a ReplayableBody. Callers must pass the original body because NewRequest h
relay/channel/api_request.go:31
↓ 12 callers
Method
CallPath
CallPath invokes a function nested below an exported object. It is used for protocol hooks such as protocols.openai_responses.renderEvents.
pkg/jsplugin/engine.go:313
↓ 12 callers
Method
Error
Error implements the error interface
pkg/ionet/types.go:274
↓ 12 callers
Function
FormatQuota
(quota int)
logger/logger.go:152
↓ 12 callers
Method
GetErrorCode
()
relaykit/types/error.go:109
↓ 12 callers
Function
GetRandomString
(length int)
common/str.go:32
↓ 12 callers
Method
HasStrength
()
relaykit/relayconvert/reasoning/intent.go:85
↓ 12 callers
Function
IncreaseUserQuota
(id int, quota int, db bool)
model/user.go:1270
↓ 12 callers
Function
Init
(db *gorm.DB)
service/authz/enforcer.go:33
↓ 12 callers
Method
IsEmpty
()
relaykit/relayconvert/reasoning/intent.go:89
↓ 12 callers
Function
NewResponseStreamState
(from types.RelayFormat, target types.RelayFormat, options ResponseStreamOptions)
relaykit/relayconvert/response_registry.go:297
↓ 12 callers
Function
OptionsOf
OptionsOf returns m's conversion options, or empty defaults when m is nil.
relaykit/relayconvert/convmeta/meta.go:236
↓ 12 callers
Function
RecordLog
(userId int, logType int, content string)
model/log.go:150
↓ 12 callers
Method
SetContentString
(s string)
relaykit/dto/openai_response.go:101
↓ 12 callers
Method
SetOtherSettings
(setting dto.ChannelOtherSettings)
model/channel.go:1048
↓ 12 callers
Method
SetToolCalls
(toolCalls any)
relaykit/dto/openai_request.go:501
↓ 12 callers
Method
UpdateWithStatus
UpdateWithStatus performs a conditional UPDATE guarded by fromStatus (CAS). Returns (true, nil) if this caller won the update, (false, nil) if another
model/task.go:533
↓ 12 callers
Method
ValidateRequestAndSetAction
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/adapter.go:39
↓ 12 callers
Function
WalletQuotaFromDecimalStrict
WalletQuotaFromDecimalStrict converts wallet and top-up values within the JavaScript-safe integer range, which is also exactly representable by float6
common/quota_math.go:172
↓ 12 callers
Function
buildSSEBody
(n int)
relay/helper/stream_scanner_test.go:49
↓ 12 callers
Function
genBaseRelayInfo
(c *gin.Context, request dto.Request)
relay/common/relay_info.go:509
↓ 12 callers
Function
makeRelayInfo
(expr string, groupRatio float64, estPrompt, estCompletion int)
service/tiered_settle_test.go:45
↓ 12 callers
Function
safeJsonParse
( value: string | undefined | null, options: SafeJsonParseOptions<T> = {} )
web/src/features/system-settings/utils/json-parser.ts:113
↓ 12 callers
Function
settleTaskBillingOnComplete
settleTaskBillingOnComplete 任务完成时的统一计费调整。 返回 true 表示用量结算路径已接管最终计费;失败任务仅在返回 false 时补做全额退款。 优先级:1. tiered snapshot → 2. adaptor 调整 → 3. token 重算。 表达式求值
service/task_polling.go:666
↓ 12 callers
Function
setupGenericTaskTest
(t *testing.T)
controller/task_generic_test.go:27
↓ 12 callers
Function
splitBillingExprAndRequestRules
(expr: string)
web/src/features/pricing/lib/billing-expr.ts:901
↓ 12 callers
Function
trimmed
(value)
plugins/tasks/doubao/plugin.js:65
↓ 12 callers
Function
useMediaQuery
(query: string)
web/src/hooks/use-media-query.ts:26
↓ 12 callers
Function
useTestSessionSecret
(t *testing.T)
service/auth_token_test.go:14
↓ 11 callers
Function
AsClientError
(err error)
relaykit/relayconvert/reasoning/intent.go:38
↓ 11 callers
Function
Compile
Compile performs upload-time syntax checks and compiles an ESM plugin once. All Sobek-specific module and runtime handling is intentionally kept here.
pkg/jsplugin/engine.go:135
↓ 11 callers
Method
ConversionDiagnostics
()
relay/common/conversion_diagnostics.go:62
↓ 11 callers
Function
ConvertResponse
(c context.Context, info convmeta.Meta, target types.RelayFormat, response any)
relaykit/relayconvert/response_registry.go:231
↓ 11 callers
Method
CountBillableToolCall
CountBillableToolCall is the single entry point for per-call tool billing counts. Built-in call types always count; custom function/tool_use names onl
relay/common/tool_usage.go:24
↓ 11 callers
Function
DeleteToolPriceForTest
DeleteToolPriceForTest removes an injected tool price and rebuilds the index. Tests only.
setting/operation_setting/tools.go:231
↓ 11 callers
Method
Error
()
pkg/jsplugin/engine.go:35
↓ 11 callers
Function
GetChannelBaseURL
(channelType int)
constant/channel.go:131
↓ 11 callers
Function
GetDBTimestamp
GetDBTimestamp returns a UNIX timestamp from database time. Falls back to application time on error.
model/db_time.go:7
↓ 11 callers
Function
GetFetchSetting
()
setting/system_setting/fetch_setting.go:32
↓ 11 callers
Function
GetHttpClientWithProxySettings
GetHttpClientWithProxySettings returns a cached HTTP client for the proxy URL and channel transport settings. Default auto + 1 shard shares the same c
service/http_client.go:389
↓ 11 callers
Function
GetMaxTokenAutoGroups
()
setting/auto_group.go:51
↓ 11 callers
Method
GetReasoningContent
()
relaykit/dto/openai_request.go:469
← previous
next →
201–300 of 11,560, ranked by callers