Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
9,195 in github.com/QuantumNous/new-api
⨍
Functions
9,195
◇
Types & classes
1,481
↓ 5 callers
Function
GetAudioRatio
(name string)
setting/ratio_setting/model_ratio.go:623
↓ 5 callers
Function
GetBodyStorage
GetBodyStorage 获取请求体存储对象(用于需要多次读取的场景)
common/gin.go:86
↓ 5 callers
Function
GetByTaskId
(userId int, taskId string)
model/task.go:337
↓ 5 callers
Method
GetCacheCreation1hTokens
()
dto/claude.go:582
↓ 5 callers
Method
GetCacheCreation5mTokens
()
dto/claude.go:575
↓ 5 callers
Function
GetCompletionRatio
(name string)
setting/ratio_setting/model_ratio.go:436
↓ 5 callers
Function
GetConsoleSetting
GetConsoleSetting 获取 ConsoleSetting 配置实例
setting/console_setting/config.go:37
↓ 5 callers
Function
GetDiskCacheDir
GetDiskCacheDir 获取统一的磁盘缓存目录 注意:每次调用都会重新计算,以响应配置变化
common/disk_cache.go:25
↓ 5 callers
Function
GetDiskCachePath
GetDiskCachePath 获取磁盘缓存目录
common/disk_cache_config.go:65
↓ 5 callers
Function
GetEpayClient
()
controller/topup.go:135
↓ 5 callers
Function
GetGroupGroupRatio
(userGroup, usingGroup string)
setting/ratio_setting/group_ratio.go:88
↓ 5 callers
Method
GetKeys
()
model/channel.go:175
↓ 5 callers
Method
GetMaskedKey
()
model/token.go:55
↓ 5 callers
Function
GetModelPrice
GetModelPrice 返回模型的价格,如果模型不存在则返回-1,false
setting/ratio_setting/model_ratio.go:360
↓ 5 callers
Method
GetModels
()
model/channel.go:289
↓ 5 callers
Function
GetMonitorSetting
()
setting/operation_setting/monitor_setting.go:33
↓ 5 callers
Method
GetNextEnabledKey
()
model/channel.go:199
↓ 5 callers
Function
GetOIDCSettings
()
setting/system_setting/oidc.go:23
↓ 5 callers
Method
GetPage
()
common/page_info.go:29
↓ 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
GetToolPrice
GetToolPrice is a convenience wrapper when no model name is needed.
setting/operation_setting/tools.go:217
↓ 5 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:192
↓ 5 callers
Function
GetTopupGroupRatio
(name string)
common/topup-ratio.go:32
↓ 5 callers
Function
GetUserAutoGroup
GetUserAutoGroup 根据用户分组获取自动分组设置
service/group.go:46
↓ 5 callers
Function
GetUserQuota
GetUserQuota gets quota from Redis first, falls back to DB if needed
model/user.go:1129
↓ 5 callers
Function
GetUsernameById
GetUsernameById gets username from Redis first, falls back to DB if needed
model/user.go:1372
↓ 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
IssueAccessToken
(identity AuthIdentity)
service/auth_token.go:60
↓ 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
NewUserSortOptions
(sortBy string, sortOrder string)
model/user.go:36
↓ 5 callers
Function
OaiResponsesStreamHandler
(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Response)
relay/channel/openai/relay_responses.go:75
↓ 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
Register
Register registers an OAuth provider with the given name
oauth/registry.go:19
↓ 5 callers
Method
Reset
Reset clears pending observations (used when a terminal response fails).
relay/common/tool_usage.go:129
↓ 5 callers
Function
ResponseChunkData
(c *gin.Context, resp dto.ResponsesStreamResponse, data string)
relay/helper/common.go:87
↓ 5 callers
Function
RevokeUserSession
(userID int, sid, reason string)
model/user_session.go:544
↓ 5 callers
Method
SetModelName
(modelName string)
dto/request_common.go:11
↓ 5 callers
Method
SetSetting
(setting dto.UserSetting)
model/user.go:153
↓ 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:352
↓ 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:532
↓ 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:712
↓ 5 callers
Function
UpdateConfigFromMap
UpdateConfigFromMap 从map更新配置对象(导出函数)
setting/config/config.go:281
↓ 5 callers
Function
UpdateOption
(key string, value string)
model/option.go:214
↓ 5 callers
Function
ValidateConsoleSettings
(settingsStr string, settingType string)
setting/console_setting/validation.go:62
↓ 5 callers
Function
abortWithOpenAiMessage
(c *gin.Context, statusCode int, message string, code ...types.ErrorCode)
middleware/utils.go:12
↓ 5 callers
Function
applyAuthBundle
( bundle: AuthBundle, synchronizeTabs = true )
web/src/lib/auth-session.ts:148
↓ 5 callers
Function
applyUsagePostProcessing
(info *relaycommon.RelayInfo, usage *dto.Usage, responseBody []byte)
relay/channel/openai/usage.go:10
↓ 5 callers
Function
authRotationData
(bundle *service.AuthBundle)
controller/auth_session.go:182
↓ 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/src/features/dashboard/lib/flow.ts:279
↓ 5 callers
Function
completeAssistantTiming
( message: Message, completedAt: number = Date.now() )
web/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
formatBillingCurrencyFromUSD
( amountUSD: number | null | undefined, options?: CurrencyFormatOptions )
web/src/lib/currency.ts:451
↓ 5 callers
Function
formatPricingNumber
(value: unknown)
web/src/features/system-settings/models/pricing-format.ts:55
↓ 5 callers
Function
formatQuotaWithCurrency
( quota: number | null | undefined, options?: CurrencyFormatOptions )
web/src/lib/currency.ts:496
↓ 5 callers
Function
getChannelAffinityMeta
(c *gin.Context)
service/channel_affinity.go:375
↓ 5 callers
Function
getMessageContent
(message: Message)
web/src/features/playground/lib/message/message-utils.ts:49
↓ 5 callers
Function
getSavedChartPreferences
()
web/src/features/dashboard/lib/filters.ts:94
↓ 5 callers
Function
getTaskQuota
(t *testing.T, id int64)
service/task_billing_test.go:273
↓ 5 callers
Function
getUserAvatarFallback
(name: string)
web/src/lib/avatar.ts:43
↓ 5 callers
Function
getUserAvatarStyle
(name: string)
web/src/lib/avatar.ts:31
↓ 5 callers
Function
isContentSizedColumn
(columnId: string)
web/src/components/data-table/core/content-sized-columns.ts:19
↓ 5 callers
Function
isDynamicPricingModel
(model: PricingModel)
web/src/features/pricing/lib/dynamic-price.ts:65
↓ 5 callers
Function
isJsonObjectValue
(value: unknown)
web/src/features/channels/lib/channel-form.ts:77
↓ 5 callers
Function
isPaymentComplianceConfirmed
()
controller/payment_webhook_availability.go:10
↓ 5 callers
Function
isRecord
(value: unknown)
web/src/lib/auth-session.ts:88
↓ 5 callers
Function
isTokenBasedModel
(model: PricingModel)
web/src/features/pricing/lib/model-helpers.ts:107
↓ 5 callers
Method
makeChunk
(delta dto.ChatCompletionsStreamResponseChoiceDelta, finishReason *string)
service/relayconvert/internal/oai_responses/to_oai_chat_stream_resp.go:519
↓ 5 callers
Function
mergeModelNames
(base []string, appended []string)
controller/channel_upstream_update.go:107
↓ 5 callers
Function
mustRawMessage
(t *testing.T, value any)
service/relayconvert/request_registry_test.go:734
↓ 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
normalizeVisualTier
( tier: Partial<VisualTier> = {} )
web/src/features/pricing/lib/tier-expr.ts:61
↓ 5 callers
Function
parseAdvancedCustomConfig
( value: string | undefined )
web/src/features/channels/lib/advanced-custom.ts:477
↓ 5 callers
Function
parseLooseValue
(valueText: string)
web/src/features/channels/components/dialogs/param-override-editor-dialog.tsx:464
← previous
next →
501–600 of 9,195, ranked by callers