Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
9,732 in github.com/QuantumNous/new-api
⨍
Functions
9,732
◇
Types & classes
1,519
↓ 12 callers
Function
genBaseRelayInfo
(c *gin.Context, request dto.Request)
relay/common/relay_info.go:473
↓ 12 callers
Function
getLobeIcon
( iconName: string | undefined | null, size: number = 20 )
web/src/lib/lobe-icon.tsx:82
↓ 12 callers
Function
makeRelayInfo
(expr string, groupRatio float64, estPrompt, estCompletion int)
service/tiered_settle_test.go:45
↓ 12 callers
Function
render
()
web/src/components/turnstile.tsx: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
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
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
↓ 11 callers
Function
DoTaskApiRequest
(a TaskAdaptor, c *gin.Context, info *common.RelayInfo, requestBody io.Reader)
relay/channel/api_request.go:561
↓ 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
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
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:366
↓ 11 callers
Function
GetMaxTokenAutoGroups
()
setting/auto_group.go:51
↓ 11 callers
Method
GetMaxTokens
()
relaykit/dto/openai_request.go:276
↓ 11 callers
Function
GetPricing
()
model/pricing.go:66
↓ 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
IncreaseUserQuota
(id int, quota int, db bool)
model/user.go:1270
↓ 11 callers
Function
MainDatabaseType
()
common/database.go:15
↓ 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
UpdateBalance
(balance float64)
model/channel.go:601
↓ 11 callers
Function
UpdateChannelUsedQuota
(id int, quota int)
model/channel.go:872
↓ 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
getLastLog
(t *testing.T)
service/task_billing_test.go:317
↓ 11 callers
Function
getUserCacheKey
getUserCacheKey returns the key for user cache
model/user_cache.go:50
↓ 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
setupAuthSessionTestDB
(t *testing.T)
service/auth_session_test.go:22
↓ 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
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
↓ 10 callers
Function
CreateLoginSession
(userID int, loginMethod, ip, userAgent string)
service/auth_session.go:45
↓ 10 callers
Function
CreateUserSession
(session *UserSession)
model/user_session.go:133
↓ 10 callers
Function
DeleteToolPriceForTest
DeleteToolPriceForTest removes an injected tool price and rebuilds the index. Tests only.
setting/operation_setting/tools.go:231
↓ 10 callers
Function
Done
(c *gin.Context)
relay/helper/common.go:136
↓ 10 callers
Method
Error
Error implements the error interface
pkg/ionet/types.go:274
↓ 10 callers
Function
GetAuthHeader
GetAuthHeader get auth header
controller/channel-billing.go:138
↓ 10 callers
Method
GetErrorCode
()
relaykit/types/error.go:109
↓ 10 callers
Method
GetFinalRequestRelayFormat
()
relay/common/relay_info.go:671
↓ 10 callers
Method
GetRequestURL
(info *relaycommon.RelayInfo)
relay/channel/advancedcustom/adaptor.go:189
↓ 10 callers
Function
GetResponseBody
(method, url string, channel *model.Channel, headers http.Header)
controller/channel-billing.go:152
↓ 10 callers
Method
HasErrors
()
relay/common/stream_status.go:70
↓ 10 callers
Function
LockOrder
LockOrder 尝试对给定订单号加锁
controller/topup.go:359
↓ 10 callers
Function
LogQuota
(quota int)
logger/logger.go:122
↓ 10 callers
Method
MarshalJSONString
()
types/rw_map.go:94
↓ 10 callers
Function
NewOAuthError
NewOAuthError creates a new OAuth error with the given message key
oauth/types.go:45
↓ 10 callers
Function
NewOAuthErrorWithRaw
NewOAuthErrorWithRaw creates a new OAuth error with raw error message for logging
oauth/types.go:53
↓ 10 callers
Function
NewStreamScanner
(reader io.Reader)
relay/helper/stream_scanner.go:43
↓ 10 callers
Function
PostTextConsumeQuota
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.Usage, extraContent []string)
service/text_quota.go:397
↓ 10 callers
Function
RebuildToolPriceIndex
RebuildToolPriceIndex rebuilds the lookup index from the current config. Called on init and after config updates. Not on the billing hot path.
setting/operation_setting/tools.go:149
↓ 10 callers
Function
ResponsesRequestToChatCompletionsRequest
(req *dto.OpenAIResponsesRequest)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:27
↓ 10 callers
Method
SetEndReason
(reason StreamEndReason, err error)
relay/common/stream_status.go:45
↓ 10 callers
Method
SetOtherSettings
(setting dto.ChannelOtherSettings)
model/channel.go:1031
↓ 10 callers
Method
Size
Size 获取数据大小
common/body_storage.go:20
↓ 10 callers
Function
TaskErrorWrapperLocal
(err error, code string, statusCode int)
service/error.go:194
↓ 10 callers
Method
TotalErrorCount
()
relay/common/stream_status.go:79
↓ 10 callers
Function
UnlockOrder
UnlockOrder 释放给定订单号的锁
controller/topup.go:374
↓ 10 callers
Function
advancedCustomGinContext
(path string)
relay/channel/advancedcustom/adaptor_test.go:850
↓ 10 callers
Method
close
()
web/src/features/playground/hooks/use-stream-request.test.ts:50
↓ 10 callers
Function
createSectionRegistry
(config: SectionRegistryConfig<TSectionId, TSettings, TExtraArgs>)
web/src/features/system-settings/utils/section-registry.ts:49
↓ 10 callers
Function
decodeAPIResponse
(t *testing.T, recorder *httptest.ResponseRecorder)
controller/token_test.go:208
↓ 10 callers
Function
getServerErrorMessageKey
(value: unknown)
web/src/lib/server-error-message.ts:51
↓ 10 callers
Function
insertUserForPaymentGuardTest
(t *testing.T, id int, quota int)
model/payment_method_guard_test.go:12
↓ 10 callers
Function
mustRawMessage
(t *testing.T, value any)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req_test.go:353
↓ 10 callers
Function
newAPIErrorFromParamOverride
(err error)
relay/param_override_error.go:8
↓ 10 callers
Function
performHeaderNavRequest
(t *testing.T, handler gin.HandlerFunc, authenticated bool)
middleware/header_nav_test.go:39
↓ 10 callers
Function
processHeaderOverride
processHeaderOverride applies channel header overrides, with placeholder substitution. Supported placeholders: - {api_key}: resolved to the channel AP
relay/channel/api_request.go:196
↓ 10 callers
Function
rawJSONPresent
(raw json.RawMessage)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:561
↓ 10 callers
Function
setupUserUpdateTestState
(t *testing.T)
model/user_update_test.go:15
↓ 10 callers
Function
sideDrawerFooterClassName
(className?: string)
web/src/components/drawer-layout.ts:42
↓ 10 callers
Function
triggerRefresh
()
web/src/features/users/components/users-provider.tsx:41
↓ 10 callers
Function
useSearch
()
web/src/context/search-provider.tsx:57
↓ 9 callers
Function
BuildTieredTokenParams
BuildTieredTokenParams constructs billingexpr.TokenParams from a dto.Usage, normalizing P and C so they mean "tokens not separately priced by the expr
service/tiered_settle.go:25
↓ 9 callers
Method
CloseIdleConnections
()
service/http_transport_sharded.go:97
↓ 9 callers
Function
ConvertRequest
(c *gin.Context, info *relaycommon.RelayInfo, target types.RelayFormat, request any)
service/request_converter.go:26
↓ 9 callers
Method
DialContext
(ctx context.Context, network, addr string)
service/protected_fetch_client.go:170
↓ 9 callers
Function
GetChannelAffinitySetting
()
setting/operation_setting/channel_affinity_setting.go:156
↓ 9 callers
Function
GetJsonString
(data any)
common/str.go:103
↓ 9 callers
Function
GetPasskeySettings
()
setting/system_setting/passkey.go:35
↓ 9 callers
Method
GetReasoningContent
()
relaykit/dto/openai_request.go:460
↓ 9 callers
Function
GetTokenByKey
(key string, fromDB bool)
model/token.go:280
↓ 9 callers
Function
GetUserQuota
GetUserQuota gets quota from Redis first, falls back to DB if needed
model/user.go:1182
↓ 9 callers
Function
Init
(db *gorm.DB)
service/authz/enforcer.go:33
↓ 9 callers
Function
InitSessionCookieSettings
()
common/session_cookie.go:44
↓ 9 callers
Function
IsPaymentComplianceConfirmed
()
setting/operation_setting/payment_setting.go:33
↓ 9 callers
Method
IsStringContent
()
relaykit/dto/claude.go:126
↓ 9 callers
Method
Keys
Keys returns keys with valid values. In Redis, it returns all matching keys.
pkg/cachex/hybrid_cache.go:132
↓ 9 callers
Function
MapToJsonStr
(m map[string]interface{})
common/str.go:39
↓ 9 callers
Function
NewStreamStatus
()
relay/common/stream_status.go:41
↓ 9 callers
Function
Password2Hash
(password string)
common/crypto.go:23
↓ 9 callers
Function
QuotaFromDecimalStrict
QuotaFromDecimalStrict converts an in-range decimal quota and rejects a value that would otherwise be saturated at the database's int32 boundary.
common/quota_math.go:152
← previous
next →
201–300 of 9,732, ranked by callers