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
↓ 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:568
↓ 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:979
↓ 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
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:1806
↓ 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
pkg/jsplugin/registry.go:304
↓ 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
Method
SetModelName
(modelName string)
relaykit/dto/request_common.go:11
↓ 6 callers
Function
SetRelayRouter
(router *gin.Engine)
router/relay-router.go:15
↓ 6 callers
Function
SetUpLogger
(server *gin.Engine)
middleware/logger.go:21
↓ 6 callers
Function
SettleMidjourneyTaskBilling
SettleMidjourneyTaskBilling charges a persisted legacy task and records the applied stages.
service/midjourney.go:63
↓ 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
Function
UTF16Len
UTF16Len is the length of text in UTF-16 code units, as JavaScript counts a string.
pkg/jsplugin/transform.go:583
↓ 6 callers
Function
UpdateAbilityStatus
(channelId int, status bool)
model/ability.go:342
↓ 6 callers
Function
UpdateAutoGroupsByJsonString
(jsonString string)
setting/auto_group.go:30
↓ 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:238
↓ 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:1232
↓ 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:820
↓ 6 callers
Method
acquire
( pluginKey string, userID int, tokenID int, )
controller/plugin_protocol_limiter.go:65
↓ 6 callers
Function
asciiFold
asciiFold maps only 'A'–'Z' onto 'a'–'z'. Every other byte is unchanged. Unicode case folding is intentionally not applied: U+212A (KELVIN SIGN) must
pkg/jsplugin/model_fold.go:6
↓ 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
buildOpenAIStyleUsageFromClaudeUsage
(usage *dto.Usage)
relay/channel/claude/relay-claude.go:59
↓ 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
createMiddlewarePATUser
(t *testing.T, username, token string)
middleware/auth_test.go:83
↓ 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
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:226
↓ 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
getChannelTypeLabel
(type: number)
web/src/features/channels/lib/channel-utils.ts:39
↓ 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:48
↓ 6 callers
Function
hashStringToSeed
(input: string)
web/src/features/pricing/lib/seed.ts:30
↓ 6 callers
Method
hookFetcher
hookFetcher sends a driver hook's utils.fetch requests to the hosts its request descriptors may use, through the channel's proxy like poll requests.
relay/channel/task/jsplugin/adaptor.go:884
↓ 6 callers
Function
insertOriginTaskChannel
(t *testing.T, status int)
middleware/task_plugin_origin_task_test.go:41
↓ 6 callers
Function
insertTaskPluginRouteTask
(t *testing.T, task *model.Task)
middleware/task_plugin_test.go:2047
↓ 6 callers
Function
isApiSuccess
(response: ApiResponse)
web/src/features/wallet/api.ts:51
↓ 6 callers
Function
isHttpUrl
(value: string)
web/src/lib/content-format.ts:19
↓ 6 callers
Function
isJsonObjectValue
(value: unknown)
web/src/features/channels/lib/channel-form.ts:118
↓ 6 callers
Function
isValidOtherRatio
(ratio float64)
types/price_data.go:115
↓ 6 callers
Function
isValidPricingCurrency
( currency: PricingCurrency | null )
web/src/features/model-pricing/currency.ts:51
↓ 6 callers
Method
makeChunk
(delta dto.ChatCompletionsStreamResponseChoiceDelta, finishReason *string)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:607
↓ 6 callers
Function
marshalSystemTaskJSON
(v any)
model/system_task.go:593
↓ 6 callers
Function
moderationResult
moderationResult is a moderation API reply with one result per categories map; a result is flagged when any of its categories is true.
plugins/request_plugins_test.go:591
↓ 6 callers
Function
mustRawMessage
(t *testing.T, value any)
relaykit/relayconvert/request_registry_test.go:1060
↓ 6 callers
Function
mustStreamChunks
(t *testing.T, state *ResponsesToChatStreamState, event *dto.ResponsesStreamResponse)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp_test.go:585
↓ 6 callers
Function
mustUnmarshalFixture
(raw string, out any)
relaykit/relayconvert/golden_test.go:460
↓ 6 callers
Function
newAdvancedCustomModelListChannel
(baseURL string, key string, upstreamPath string, auth *dto.AdvancedCustomRouteAuth)
controller/channel_upstream_update_test.go:21
↓ 6 callers
Function
newClientIPRouter
()
middleware/trusted_proxies_test.go:24
↓ 6 callers
Function
newFakeSMTPServerWithSTARTTLSAdvertisement
(t *testing.T, advertiseSTARTTLS bool)
common/email_test.go:39
↓ 6 callers
Function
newHTTPClientWithPolicyAndTLS
newHTTPClientWithPolicyAndTLS is a test seam that builds a never-used transport stack with the given policy and TLS config (for httptest certificate t
service/http_client.go:384
↓ 6 callers
Function
newResponsesChatTestContext
(t *testing.T, body string, isStream bool)
relay/channel/openai/chat_via_responses_test.go:22
↓ 6 callers
Function
newResponsesWSInvalidRequestError
(err error)
relay/responses_websocket.go:965
↓ 6 callers
Function
normalizeResponsesWSTestMessage
normalizeResponsesWSTestMessage runs the read-loop envelope parse followed by request normalization, exactly as the session does for one response.crea
relay/responses_websocket_test.go:35
← previous
next →
1,101–1,200 of 15,409, ranked by callers