Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
10,934 in github.com/QuantumNous/new-api
⨍
Functions
10,934
◇
Types & classes
1,622
↓ 15 callers
Function
newTestUserSession
(sid string, userID int, now int64)
model/user_session_test.go:82
↓ 15 callers
Function
useDataTable
(options: UseDataTableOptions<TData>)
web/src/components/data-table/hooks/use-data-table.ts:278
↓ 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
ClaimSystemTask
(id int64, taskType string, runnerID string, lockUntil int64)
model/system_task.go:225
↓ 14 callers
Function
ConvertResponse
(c context.Context, info convmeta.Meta, target types.RelayFormat, response any)
relaykit/relayconvert/response_registry.go:206
↓ 14 callers
Function
GetAdaptor
(apiType int)
relay/relay_adaptor.go:50
↓ 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
Method
GetUpstreamTaskID
GetUpstreamTaskID 获取上游真实 task ID(用于与 provider 通信) 旧数据没有 UpstreamTaskID 时,TaskID 本身就是上游 ID
model/task.go:166
↓ 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
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
↓ 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
Function
FormatMatchingModelName
转换模型名,减少渠道必须配置各种带参数模型
setting/ratio_setting/model_ratio.go:702
↓ 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
Function
GetGeneralSetting
()
setting/operation_setting/general_setting.go:40
↓ 13 callers
Function
GetGlobalSettings
()
setting/model_setting/global.go:62
↓ 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
ModelMappedHelper
(c *gin.Context, info *common.RelayInfo, request dto.Request)
relay/helper/model_mapped.go:13
↓ 13 callers
Method
Source
Source 返回资金来源标识:"wallet" 或 "subscription"
service/funding_source.go:17
↓ 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
Function
CloneBillingUsage
(usage *BillingUsage)
relaykit/dto/billing_usage.go:138
↓ 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
Function
GetJsonType
(data json.RawMessage)
relaykit/relayconvert/kitutil/json.go:30
↓ 12 callers
Function
GetRandomString
(length int)
common/str.go:32
↓ 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
Function
RecordLog
(userId int, logType int, content string)
model/log.go:159
↓ 12 callers
Method
SetContentString
(s string)
relaykit/dto/openai_response.go:96
↓ 12 callers
Method
SetOtherSettings
(setting dto.ChannelOtherSettings)
model/channel.go:1045
↓ 12 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:30
↓ 12 callers
Method
SetToolCalls
(toolCalls any)
relaykit/dto/openai_request.go:494
↓ 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:473
↓ 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
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
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
↓ 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
Error
()
pkg/jsplugin/engine.go:35
↓ 11 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
↓ 11 callers
Function
GetChannelBaseURL
(channelType int)
constant/channel.go:131
↓ 11 callers
Method
GetContentString
()
relaykit/dto/openai_response.go:100
↓ 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
GetMaxTokens
()
relaykit/dto/openai_request.go:278
↓ 11 callers
Function
GetTwoFAByUserId
GetTwoFAByUserId 根据用户ID获取2FA设置
model/twofa.go:39
↓ 11 callers
Function
GetUserGroup
GetUserGroup gets group from Redis first, falls back to DB if needed
model/user.go:1205
↓ 11 callers
Function
MapToJsonStr
(m map[string]interface{})
common/str.go:39
↓ 11 callers
Function
NewClaudeMessagesBillingUsage
(usage *ClaudeUsage)
relaykit/dto/billing_usage.go:23
↓ 11 callers
Function
ObjectData
(c *gin.Context, object interface{})
relay/helper/common.go:125
↓ 11 callers
Function
PublishUserAuthCache
PublishUserAuthCache refreshes the current database state after a successful auth-sensitive transaction without touching the cached quota field.
model/user_auth_cache.go:229
↓ 11 callers
Method
Render
(w http.ResponseWriter)
common/custom-event.go:72
↓ 11 callers
Function
SendEmail
(subject string, receiver string, content string)
common/email.go:78
↓ 11 callers
Method
SetDisabledFactoryKeys
(keys []string)
pkg/jsplugin/registry.go:496
↓ 11 callers
Method
UpdateBalance
(balance float64)
model/channel.go:615
↓ 11 callers
Function
UpdateChannelUsedQuota
(id int, quota int)
model/channel.go:886
↓ 11 callers
Method
ValidateRequestAndSetAction
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/adapter.go:39
↓ 11 callers
Method
WriteString
(s string)
middleware/audit.go:36
↓ 11 callers
Function
cleanupTaskPluginControllerRuntime
(t *testing.T, key string)
controller/task_plugin_test.go:62
↓ 11 callers
Method
close
()
common/email_test.go:97
↓ 11 callers
Function
formatCurrencyFromUSD
( amountUSD: number | null | undefined, options?: CurrencyFormatOptions )
web/src/lib/currency.ts:408
↓ 11 callers
Function
getUserCacheKey
getUserCacheKey returns the key for user cache
model/user_cache.go:50
↓ 11 callers
Function
registerTestPlugin
(registry *Registry, version string, factory bool)
pkg/jsplugin/registry_test.go:492
↓ 11 callers
Function
requirePaymentCompliance
(c *gin.Context)
controller/payment_compliance.go:22
↓ 11 callers
Method
resolve
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:367
↓ 11 callers
Function
settleTaskBillingOnComplete
settleTaskBillingOnComplete 任务完成时的统一计费调整。 返回 true 表示用量结算路径已接管最终计费;失败任务仅在返回 false 时补做全额退款。 优先级:1. tiered snapshot → 2. adaptor 调整 → 3. token 重算。 表达式求值
service/task_polling.go:625
↓ 11 callers
Function
setupAuthSessionTestDB
(t *testing.T)
service/auth_session_test.go:22
↓ 11 callers
Function
setupOriginTaskDB
(t *testing.T)
middleware/task_plugin_origin_task_test.go:28
↓ 11 callers
Function
taskProtocolPluginSource
(key, version, models, endpoint, parseRequestBody string)
middleware/task_plugin_test.go:1630
↓ 11 callers
Function
useSidebar
()
web/src/components/ui/sidebar.tsx:67
↓ 11 callers
Function
useTheme
()
web/src/context/theme-provider.tsx:141
↓ 11 callers
Function
withHeaderNavModules
(t *testing.T, raw string)
middleware/header_nav_test.go:17
↓ 11 callers
Function
withSMTPSettings
(t *testing.T)
common/email_test.go:243
↓ 10 callers
Method
AddPin
(p ChannelPin)
dto/channel_constraints.go:55
↓ 10 callers
Function
ApplyParamOverrideWithRelayInfo
(jsonData []byte, info *RelayInfo)
relay/common/override.go:183
↓ 10 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
← previous
next →
201–300 of 10,934, ranked by callers