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
↓ 6 callers
Method
GetCacheCreation5mTokens
()
relaykit/dto/claude.go:705
↓ 6 callers
Method
GetChannelName
()
relay/channel/adapter.go:32
↓ 6 callers
Function
GetCompletionRatio
(name string)
setting/ratio_setting/model_ratio.go:436
↓ 6 callers
Function
GetEpayClient
()
controller/topup.go:138
↓ 6 callers
Method
GetIdentifier
()
relaykit/types/file_source.go:15
↓ 6 callers
Function
GetRandomSatisfiedChannel
( group string, model string, retry int, filters []dto.ChannelFilter, )
model/channel_cache.go:123
↓ 6 callers
Method
GetRetry
()
service/channel_select.go:58
↓ 6 callers
Function
GetSubscriptionPlanById
(id int)
model/subscription.go:397
↓ 6 callers
Function
GetTaskPluginOptions
(c *gin.Context)
controller/task_plugin.go:947
↓ 6 callers
Function
GetTaskPluginSyncSnapshot
GetTaskPluginSyncSnapshot returns the enabled override set together with a deterministic revision of every active database override. Nodes can compare
model/task_plugin.go:195
↓ 6 callers
Function
GetToolPriceForModel
GetToolPriceForModel returns the price ($/1K calls) for a tool given a model name. Lookup: longest prefix match → tool default → 0.
setting/operation_setting/tools.go:254
↓ 6 callers
Method
GetTools
GetTools 获取工具列表
relaykit/dto/claude.go:462
↓ 6 callers
Function
GetTopupGroupRatio
(name string)
common/topup-ratio.go:32
↓ 6 callers
Function
GetUserAccessToken
(userID, id int)
model/user_access_token.go:100
↓ 6 callers
Function
GetUserAccessTokenStatus
GetUserAccessTokenStatus reads last use of the legacy token from the access audit. Deprecated: 旧版面板访问令牌,仅在升级后的过渡期内使用;删除 users.access_token 列时一并移除。
model/audit_log.go:220
↓ 6 callers
Function
GetUserUsableGroups
(userGroup string)
service/group.go:14
↓ 6 callers
Function
GetUsernameById
GetUsernameById gets username from Redis first, falls back to DB if needed
model/user.go:1506
↓ 6 callers
Function
HandleClaudeResponseData
(c *gin.Context, info *relaycommon.RelayInfo, claudeInfo *ClaudeResponseInfo, httpResp *http.Response, data []
relay/channel/claude/relay-claude.go:358
↓ 6 callers
Function
HandleOAuth
HandleOAuth handles OAuth callback for all standard OAuth providers
controller/oauth.go:146
↓ 6 callers
Function
HeaderNavModulePublicOrUserAuth
(module string)
middleware/header_nav.go:130
↓ 6 callers
Function
IncreaseTokenQuota
(tokenId int, key string, quota int)
model/token.go:382
↓ 6 callers
Method
Insert
()
model/topup.go:55
↓ 6 callers
Method
Insert
()
model/midjourney.go:164
↓ 6 callers
Method
IsStringSystem
()
relaykit/dto/claude.go:588
↓ 6 callers
Function
ListTaskPluginVersions
(key string)
model/task_plugin.go:145
↓ 6 callers
Method
LookupDeclaredRoutes
LookupDeclaredRoutes returns every binding of a path shape, in ascending key order.
pkg/jsplugin/routing.go:202
↓ 6 callers
Function
MidjourneyErrorWrapper
(code int, desc string)
service/error.go:21
↓ 6 callers
Function
MigrateRetiredFrontendOptions
MigrateRetiredFrontendOptions normalizes options that belonged to the removed dashboard frontend. Each legacy console setting is migrated in its own t
model/frontend_option_migration.go:20
↓ 6 callers
Function
ObjectMember
ObjectMember returns a member of a JSON object exactly as written, or nil when the member is missing or null or data is not an object. A decoded map e
relaykit/relayconvert/kitutil/json.go:131
↓ 6 callers
Function
OpenaiImageHandler
OpenaiImageHandler handles non-streaming OpenAI image responses (generations/edits), returning the parsed usage for billing.
relay/channel/openai/relay_image.go:25
↓ 6 callers
Method
OverridePlugins
()
pkg/jsplugin/registry.go:260
↓ 6 callers
Function
ParseAccessTokenSessionID
(sid string)
model/user_access_token.go:239
↓ 6 callers
Function
ParseDashboardAccessToken
ParseDashboardAccessToken distinguishes new-api dashboard JWTs from opaque credentials. A token carrying the dashboard issuer, audience and a known to
service/auth_token.go:107
↓ 6 callers
Method
PluginsByChannelType
(channelType int)
pkg/jsplugin/registry.go:141
↓ 6 callers
Function
PrepareResponsesRequest
PrepareResponsesRequest applies the same model, conversion and channel rules for HTTP and WebSocket requests. The caller closes closer after the attem
relay/responses_request.go:25
↓ 6 callers
Function
PrepareTaskPluginSubmit
()
middleware/task_plugin.go:1799
↓ 6 callers
Method
PreservesJSONOrder
PreservesJSONOrder reports whether the plugin declared json-order@1: its hooks receive JSON request bodies with members in the order the client sent t
pluginkit/meta.go:393
↓ 6 callers
Function
QuotaRound
QuotaRound converts a float64 quota value to int using half-away-from-zero rounding with int32 saturation. Every tiered billing path (pre-consume, set
pkg/billingexpr/round.go:12
↓ 6 callers
Function
RecordChannelAffinity
(c *gin.Context, channelID int)
service/channel_affinity.go:729
↓ 6 callers
Function
RecordOperationAuditLog
RecordOperationAuditLog writes new operation/security events to the audit table. logUserId 为日志归属者,管理审计日志应归属实际操作者;目标资源/用户放入 action params。username 内部按
model/log.go:230
↓ 6 callers
Function
RecordRelayErrorLog
RecordRelayErrorLog writes the error log of a failed relay request when error logs are on. channelId is 0 for a request that reached no channel.
service/relay_error.go:81
↓ 6 callers
Function
RefreshExpiringPluginCredentials
RefreshExpiringPluginCredentials runs one background refresh scan.
service/provider_plugin.go:483
↓ 6 callers
Function
ResponseChunkData
(c *gin.Context, resp dto.ResponsesStreamResponse, data string)
relay/helper/common.go:240
↓ 6 callers
Function
SanitizeURLForLog
(rawURL string)
relay/common/relay_utils.go:40
↓ 6 callers
Function
SetApiRouter
(router *gin.Engine)
router/api-router.go:17
↓ 6 callers
Method
SetModelName
(modelName string)
relaykit/dto/request_common.go:11
↓ 6 callers
Method
SetScopes
(scopes []string)
model/user_access_token.go:71
↓ 6 callers
Function
SetUpLogger
(server *gin.Engine)
middleware/logger.go:21
↓ 6 callers
Function
SetVideoRouter
(router *gin.Engine)
router/video-router.go:10
↓ 6 callers
Function
SettleMidjourneyTaskBilling
SettleMidjourneyTaskBilling charges a persisted legacy task and records the applied stages.
service/midjourney.go:63
↓ 6 callers
Method
SupportedEndpointTypesForModel
(model string)
relaykit/dto/channel_settings.go:339
↓ 6 callers
Function
SyncTaskType
SyncTaskType is the system task type of a topic's sync tasks.
model/system_sync_task.go:29
↓ 6 callers
Function
TaskArtifactContent
(c *gin.Context)
controller/task.go:319
↓ 6 callers
Method
ToBaseUser
()
model/user.go:117
↓ 6 callers
Method
ToResponse
()
model/system_task.go:572
↓ 6 callers
Function
TryUserAuth
()
middleware/auth.go:98
↓ 6 callers
Method
Unwrap
()
pluginkit/engine.go:72
↓ 6 callers
Function
UpdateAbilityStatus
(channelId int, status bool)
model/ability.go:354
↓ 6 callers
Function
UpdateChannelLocked
UpdateChannelLocked lets update change a channel's key while no other node or goroutine can: MySQL and PostgreSQL hold the channel row lock across upd
model/channel_plugin_credential.go:55
↓ 6 callers
Function
UpdateModelPricing
(changes []ModelPricingChange)
model/model_pricing_config.go:630
↓ 6 callers
Function
UpdateScheduledChannelLocked
UpdateScheduledChannelLocked persists a completed scheduled result. update only compares the prepared key and applies validated data to the current ro
model/channel_plugin_credential.go:242
↓ 6 callers
Function
UsageFromChatUsage
(src *dto.Usage)
relaykit/relayconvert/response_compat.go:156
↓ 6 callers
Function
UsedUsageKeys
UsedUsageKeys returns literal keys referenced by u("...") calls. Calls with dynamic arguments are intentionally omitted because they cannot be validat
pkg/billingexpr/compile.go:340
↓ 6 callers
Function
ValidateAccessToken
ValidateAccessToken resolves a legacy plaintext access token. After the transition deadline it rejects every value without querying the database. Dep
model/user.go:1248
↓ 6 callers
Method
ValidateNetworkTarget
ValidateNetworkTarget validates the host and port before dialing.
common/ssrf_protection.go:286
↓ 6 callers
Method
WriteHeaderNow
()
relay/requestplugin/reply.go:824
↓ 6 callers
Method
acquire
( pluginKey string, userID int, tokenID int, )
controller/plugin_protocol_limiter.go:65
↓ 6 callers
Function
auditContentEN
auditContentEN 按 action 模板渲染英文兜底文本;未登记的 action 退回 action 本身。
controller/audit.go:106
↓ 6 callers
Function
auditOperatorInfo
auditOperatorInfo 从上下文构建操作者身份信息(管理员 id/用户名/角色)。
controller/audit.go:120
↓ 6 callers
Function
authRotationData
authRotationData is empty when the change came through an access token, which has no browser session to rotate.
controller/auth_session.go:184
↓ 6 callers
Function
cacheGetUserBase
(userId int)
model/user_cache.go:129
↓ 6 callers
Function
cancel
()
web/src/features/channels/hooks/use-channel-priority-drag.ts:744
↓ 6 callers
Function
canonicalUsageFromResponse
(response any)
relaykit/relayconvert/response_registry.go:844
↓ 6 callers
Function
clearAuthentication
( synchronizeTabs = true, bootstrapState: AuthBootstrapState = 'complete' )
web/src/lib/auth-session.ts:187
↓ 6 callers
Function
confirmPaymentComplianceForTest
(t *testing.T)
controller/payment_webhook_availability_test.go:26
↓ 6 callers
Function
createAppQueryClient
( onInternalServerError?: () => void )
web/src/lib/query-client.ts:36
↓ 6 callers
Function
createEpayTestOrder
(t *testing.T, userId int, tradeNo string, provider string, status string)
model/payment_method_guard_test.go:177
↓ 6 callers
Function
createLog
(log *Log)
model/log.go:100
↓ 6 callers
Function
createOAuthFlow
( provider: string, intent: 'login' | 'bind' | 'verify', operation?: VerificationOperation, signal?: A
web/src/features/auth/api.ts:216
↓ 6 callers
Function
createQuotaTestOperator
(t *testing.T, db *gorm.DB, role int)
controller/user_manage_test.go:231
↓ 6 callers
Function
dataURI
(mime string, data []byte)
relay/requestplugin/attachments_test.go:73
↓ 6 callers
Function
diagnosticCodes
(diagnostics []types.ConversionDiagnostic)
relaykit/relayconvert/reasoning/intent_test.go:219
↓ 6 callers
Method
encode
(out *bytes.Buffer)
pkg/requestpatch/patch.go:494
↓ 6 callers
Method
ensureStart
()
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:158
↓ 6 callers
Function
fetchInferenceStatus
fetchInferenceStatus reads only fixed paths on an operator-configured channel. Each endpoint can fail independently; upstream errors never echo creden
controller/channel_inference.go:83
↓ 6 callers
Function
fetchLogs
( endpoint: string, params: T, isAdmin: boolean )
web/src/features/usage-logs/api.ts:44
↓ 6 callers
Function
finishSystemTaskHandler
(task *model.SystemTask, runnerID string, status model.SystemTaskStatus, result any, runErr error)
controller/system_task_handlers.go:204
↓ 6 callers
Function
formatBytes
( bytes: number, locales?: Intl.LocalesArgument )
web/src/lib/format.ts:45
↓ 6 callers
Function
formatTaskUsageUnitPrice
( valuePerUnit: number, options: DynamicPriceOptions )
web/src/features/pricing/lib/dynamic-price.ts:233
↓ 6 callers
Function
formatTimestampRelative
( timestamp?: number, unit: 'seconds' | 'milliseconds' = 'seconds', locales?: Intl.LocalesArgument )
web/src/lib/format.ts:200
↓ 6 callers
Function
formatTokens
(value: number)
web/src/features/rankings/lib/format.ts:24
↓ 6 callers
Function
formatUserLogs
(logs []*Log, startIdx int)
model/log.go:115
↓ 6 callers
Function
getAuthenticatedUser
(c *gin.Context)
controller/passkey.go:627
↓ 6 callers
Function
getCurrentVersion
(message: Message)
web/src/features/playground/lib/message/message-utils.ts:42
↓ 6 callers
Function
getDynamicPricingSummary
( model: PricingModel, options: DynamicPriceOptions )
web/src/features/pricing/lib/dynamic-price.ts:389
↓ 6 callers
Function
getPaymentErrorTranslation
( response: unknown )
web/src/features/wallet/lib/payment.ts:38
↓ 6 callers
Function
getRouteIncomingPath
(route: AdvancedCustomRoute)
web/src/features/channels/components/dialogs/advanced-custom-editor-dialog.tsx:169
↓ 6 callers
Function
getSuccessRateTextClass
(rate: number)
web/src/features/performance-metrics/lib/format.ts:88
↓ 6 callers
Function
getUpstreamDisplayName
( sourceName: string, t: (key: string) => string )
web/src/features/system-settings/models/upstream-ratio-sync-helpers.ts:52
↓ 6 callers
Function
hasDiagnosticCode
(diagnostics []types.ConversionDiagnostic, code string)
relaykit/relayconvert/internal/toolconv/policy_test.go:26
← previous
next →
1,101–1,200 of 15,592, ranked by callers