Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
10,602 in github.com/QuantumNous/new-api
⨍
Functions
10,602
◇
Types & classes
1,425
↓ 5 callers
Function
GetTokenById
(id int)
model/token.go:245
↓ 5 callers
Function
GetTokenByKey
(key string, fromDB bool)
model/token.go:262
↓ 5 callers
Method
GetTokenCountMeta
()
dto/request_common.go:9
↓ 5 callers
Function
GetTopupGroupRatio
(name string)
common/topup-ratio.go:32
↓ 5 callers
Function
GetUserQuota
GetUserQuota gets quota from Redis first, falls back to DB if needed
model/user.go:950
↓ 5 callers
Function
GetUsernameById
GetUsernameById gets username from Redis first, falls back to DB if needed
model/user.go:1193
↓ 5 callers
Function
HasGeminiUsageMetadataTokens
(metadata *GeminiUsageMetadata)
dto/billing_usage.go:190
↓ 5 callers
Function
IncreaseTokenQuota
(tokenId int, key string, quota int)
model/token.go:382
↓ 5 callers
Method
Insert
()
model/subscription.go:230
↓ 5 callers
Method
IsToolCall
()
dto/openai_response.go:159
↓ 5 callers
Function
LoadFileSource
LoadFileSource 加载文件源数据 这是统一的入口,会自动处理缓存和不同的来源类型
service/file_service.go:47
↓ 5 callers
Function
MaskSensitiveInfo
MaskSensitiveInfo masks sensitive information like URLs, IPs, and domain names in a string Example: http://example.com -> http://***.com https://api.t
common/str.go:199
↓ 5 callers
Function
NewFileSourceFromData
(data string, mimeType string)
types/file_source.go:134
↓ 5 callers
Function
NewGeminiChatBillingUsage
(metadata *GeminiUsageMetadata)
dto/billing_usage.go:106
↓ 5 callers
Function
NewRWMap
()
types/rw_map.go:27
↓ 5 callers
Function
NewResponseStreamState
(from types.RelayFormat, target types.RelayFormat, options ResponseStreamOptions)
service/relayconvert/response_registry.go:270
↓ 5 callers
Function
OaiStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay-openai.go:104
↓ 5 callers
Function
OpenaiImageHandler
OpenaiImageHandler handles non-streaming OpenAI image responses (generations/edits), returning the parsed usage for billing.
relay/channel/openai/relay_image.go:34
↓ 5 callers
Function
PostConsumeQuota
(relayInfo *relaycommon.RelayInfo, quota int, preConsumedQuota int, sendEmail bool)
service/quota.go:411
↓ 5 callers
Function
RecordTopupLog
(userId int, content string, callerIp string, paymentMethod string, callbackPaymentMethod string)
model/log.go:254
↓ 5 callers
Function
ResponseChunkData
(c *gin.Context, resp dto.ResponsesStreamResponse, data string)
relay/helper/common.go:87
↓ 5 callers
Method
SetModelName
(modelName string)
dto/request_common.go:11
↓ 5 callers
Function
Sha1
(data []byte)
common/hash.go:22
↓ 5 callers
Method
ToResponse
()
model/system_task.go:416
↓ 5 callers
Function
TokenAuth
()
middleware/auth.go:314
↓ 5 callers
Function
TrimEffortSuffix
TrimEffortSuffix -> modelName level(low) exists
setting/reasoning/suffix.go:16
↓ 5 callers
Method
Update
()
model/topup.go:56
↓ 5 callers
Method
Update
()
model/subscription.go:237
↓ 5 callers
Method
Update
()
model/channel.go:526
↓ 5 callers
Method
UpdateAbilities
UpdateAbilities updates abilities of this channel. Make sure the channel is completed before calling this function.
model/ability.go:243
↓ 5 callers
Function
UpdateChannelStatus
(channelId int, usingKey string, status int, reason string)
model/channel.go:706
↓ 5 callers
Function
UpdateConfigFromMap
UpdateConfigFromMap 从map更新配置对象(导出函数)
setting/config/config.go:281
↓ 5 callers
Function
UpdateOption
(key string, value string)
model/option.go:207
↓ 5 callers
Function
ValidateNumericCode
ValidateNumericCode 验证数字验证码格式
common/totp.go:128
↓ 5 callers
Function
abortWithOpenAiMessage
(c *gin.Context, statusCode int, message string, code ...types.ErrorCode)
middleware/utils.go:12
↓ 5 callers
Function
applyUsagePostProcessing
(info *relaycommon.RelayInfo, usage *dto.Usage, responseBody []byte)
relay/channel/openai/usage.go:10
↓ 5 callers
Function
buildChannelAffinityTemplateContextForTest
(meta channelAffinityMeta)
service/channel_affinity_template_test.go:17
↓ 5 callers
Function
buildOpenAIStyleUsageFromClaudeUsage
(usage *dto.Usage)
relay/channel/claude/relay-claude.go:56
↓ 5 callers
Function
buildQueryParams
buildQueryParams builds query parameters for GET requests
pkg/ionet/client.go:161
↓ 5 callers
Function
canonicalUsageFromResponse
(response any)
service/relayconvert/response_registry.go:733
↓ 5 callers
Function
colorAt
(index: number, palette?: readonly string[])
web/default/src/features/dashboard/lib/flow.ts:279
↓ 5 callers
Function
completeAssistantTiming
( message: Message, completedAt: number = Date.now() )
web/default/src/features/playground/lib/message/message-timing-utils.ts:22
↓ 5 callers
Function
confirmPaymentComplianceForTest
(t *testing.T)
controller/payment_webhook_availability_test.go:11
↓ 5 callers
Function
decodeAPIResponse
(t *testing.T, recorder *httptest.ResponseRecorder)
controller/token_test.go:208
↓ 5 callers
Function
decodeData
(data []byte, target *T)
pkg/ionet/jsonutil.go:28
↓ 5 callers
Method
ensureStart
()
service/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:139
↓ 5 callers
Function
fetchDeployments
({ page, size, keyword, status })
web/classic/src/hooks/model-deployments/useDeploymentsData.jsx:176
↓ 5 callers
Function
formatBillingCurrencyFromUSD
( amountUSD: number | null | undefined, options?: CurrencyFormatOptions )
web/default/src/lib/currency.ts:451
↓ 5 callers
Function
formatLogQuota
(quota: number)
web/default/src/lib/format.ts:208
↓ 5 callers
Function
formatPricingNumber
(value: unknown)
web/default/src/features/system-settings/models/pricing-format.ts:55
↓ 5 callers
Function
formatQuotaWithCurrency
( quota: number | null | undefined, options?: CurrencyFormatOptions )
web/default/src/lib/currency.ts:496
↓ 5 callers
Function
getChannelAffinityMeta
(c *gin.Context)
service/channel_affinity.go:375
↓ 5 callers
Function
getFormValues
()
web/classic/src/hooks/channels/useChannelsData.jsx:310
↓ 5 callers
Function
getLogOther
(otherStr)
web/classic/src/helpers/log.js:20
↓ 5 callers
Function
getMessageContent
(message: Message)
web/default/src/features/playground/lib/message/message-utils.ts:49
↓ 5 callers
Function
getOAuthProviderIcon
(iconName, size = 20)
web/classic/src/helpers/render.jsx:558
↓ 5 callers
Function
getOAuthState
()
web/default/src/features/auth/api.ts:89
↓ 5 callers
Function
getPreferredSyncField
(model, ratioType, sourceName)
web/classic/src/pages/Setting/Ratio/UpstreamRatioSync.jsx:351
↓ 5 callers
Function
getQuotaPerUnit
()
web/classic/src/helpers/quota.js:21
↓ 5 callers
Function
getSavedChartPreferences
()
web/default/src/features/dashboard/lib/filters.ts:94
↓ 5 callers
Function
getUserAvatarFallback
(name: string)
web/default/src/lib/avatar.ts:43
↓ 5 callers
Function
getUserAvatarStyle
(name: string)
web/default/src/lib/avatar.ts:31
↓ 5 callers
Function
handleColumnVisibilityChange
(key, checked)
web/classic/src/components/table/model-deployments/modals/ColumnSelectorModal.jsx:43
↓ 5 callers
Function
initDefaultColumns
()
web/classic/src/hooks/mj-logs/useMjLogsData.js:144
↓ 5 callers
Function
isApiSuccess
(response: ApiResponse)
web/default/src/features/wallet/api.ts:51
↓ 5 callers
Function
isContentSizedColumn
(columnId: string)
web/default/src/components/data-table/core/content-sized-columns.ts:19
↓ 5 callers
Function
isDynamicPricingModel
(model: PricingModel)
web/default/src/features/pricing/lib/dynamic-price.ts:65
↓ 5 callers
Function
isJsonObjectValue
(value: unknown)
web/default/src/features/channels/lib/channel-form.ts:44
↓ 5 callers
Function
isPaymentComplianceConfirmed
()
controller/payment_webhook_availability.go:10
↓ 5 callers
Function
isSidebarSectionAllowed
(sectionKey)
web/classic/src/hooks/common/useUserPermissions.js:63
↓ 5 callers
Function
isTokenBasedModel
(model: PricingModel)
web/default/src/features/pricing/lib/model-helpers.ts:107
↓ 5 callers
Function
loadRedemptions
(page = 1, pageSize)
web/classic/src/hooks/redemptions/useRedemptionsData.jsx:74
↓ 5 callers
Function
loadTokens
(page = 1, size = pageSize)
web/classic/src/hooks/tokens/useTokensData.jsx:104
↓ 5 callers
Function
loadVendors
()
web/classic/src/hooks/models/useModelsData.jsx:110
↓ 5 callers
Method
makeChunk
(delta dto.ChatCompletionsStreamResponseChoiceDelta, finishReason *string)
service/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:502
↓ 5 callers
Function
mergeModelNames
(base []string, appended []string)
controller/channel_upstream_update.go:100
↓ 5 callers
Function
mustRawMessage
(t *testing.T, value any)
service/relayconvert/request_registry_test.go:734
↓ 5 callers
Function
mustStreamChunks
(t *testing.T, state *ResponsesToChatStreamState, event *dto.ResponsesStreamResponse)
service/relayconvert/internal/oai_responses/to_oai_chat_resp_test.go:385
↓ 5 callers
Function
newAuthenticatedContext
(t *testing.T, method string, target string, body any, userID int)
controller/token_test.go:184
↓ 5 callers
Function
newFakeSMTPServer
(t *testing.T)
common/email_test.go:35
↓ 5 callers
Function
normalizeCondition
(cond)
web/classic/src/pages/Setting/Ratio/components/requestRuleExpr.js:111
↓ 5 callers
Function
normalizeLanguage
(language)
web/classic/src/i18n/language.js:30
↓ 5 callers
Function
normalizeVisualTier
( tier: Partial<VisualTier> = {} )
web/default/src/features/pricing/lib/tier-expr.ts:61
↓ 5 callers
Function
parseAdvancedCustomConfig
( value: string | undefined )
web/default/src/features/channels/lib/advanced-custom.ts:465
↓ 5 callers
Function
parseLooseValue
(valueText: string)
web/default/src/features/channels/components/dialogs/param-override-editor-dialog.tsx:463
↓ 5 callers
Function
parseLooseValue
(valueText)
web/classic/src/components/table/channels/modals/ParamOverrideEditorModal.jsx:507
↓ 5 callers
Function
parseOptionalJson
(value: string | undefined)
web/default/src/features/channels/lib/channel-form.ts:39
↓ 5 callers
Function
parseRatioMap
(value: string)
web/default/src/features/system-settings/models/group-ratio-visual-editor.tsx:112
↓ 5 callers
Function
parseUsableMap
(value: string)
web/default/src/features/system-settings/models/group-ratio-visual-editor.tsx:119
↓ 5 callers
Function
paymentReturnPath
(suffix string)
controller/return_path.go:10
↓ 5 callers
Function
prepareOAuthState
(options = {})
web/classic/src/helpers/api.js:259
↓ 5 callers
Function
quotaUnitsToDollars
(units: number)
web/default/src/lib/format.ts:105
↓ 5 callers
Function
rateLimitFactory
(maxRequestNum int, duration int64, mark string)
middleware/rate-limit.go:76
↓ 5 callers
Function
redirectToOAuthUrl
(url, options = {})
web/classic/src/helpers/api.js:40
↓ 5 callers
Function
refresh
(page = activePage)
web/classic/src/hooks/model-deployments/useDeploymentsData.jsx:228
↓ 5 callers
Function
renderBillingArticle
(lines, { showReferenceNote = true } = {})
web/classic/src/helpers/render.jsx:1272
↓ 5 callers
Function
resetSession
()
web/default/src/features/auth/hooks/use-oauth-login.ts:61
↓ 5 callers
Function
rowMetrics
(row: FlowQuotaDataItem)
web/default/src/features/dashboard/lib/flow.ts:156
↓ 5 callers
Function
sankeyDatumValue
( datum: Record<string, unknown>, key: string )
web/default/src/features/dashboard/lib/flow.ts:1041
↓ 5 callers
Function
saveMessages
(messages)
web/classic/src/components/playground/configStorage.js:47
← previous
next →
501–600 of 10,602, ranked by callers