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
Function
TestBuildTieredTokenParams_ParityWithRatio_Image
(t *testing.T)
service/tiered_settle_test.go:876
Function
TestBuildTieredTokenParams_UnpricedLongTTLCacheWrites
A long-lived cache write without its own price costs a fixed multiple of the short write price: 2x for OpenAI 12h, 6/3.75x for Claude 1h. The short pr
service/tiered_settle_test.go:981
Function
TestBuildUpstreamModelUpdateTaskNotificationContent_OmitOverflowDetails
(t *testing.T)
controller/channel_upstream_update_test.go:536
Function
TestBuiltInKlingResponsesNonStreamDecodesWithOfficialGoSDK
(t *testing.T)
controller/plugin_protocol_sdk_test.go:149
Function
TestBuiltInKlingResponsesStreamDecodesWithOfficialGoSDK
(t *testing.T)
controller/plugin_protocol_sdk_test.go:177
Function
TestBuiltInPluginRoutesAreServedBesideHostRoutes
(t *testing.T)
router/plugin_router_test.go:516
Function
TestBuiltInPluginsAddressNewAPIUpstreamOnNativeRoutes
(t *testing.T)
plugins/builtin_plugins_test.go:272
Function
TestBuiltInRequestPluginSamples
(t *testing.T)
plugins/request_plugins_test.go:978
Function
TestBuiltInRequestPluginsExportTheirStageHooks
(t *testing.T)
plugins/builtin_plugins_test.go:213
Function
TestBuiltInResponsesDecodersEchoChannelMappedAlias
(t *testing.T)
plugins/builtin_plugins_test.go:240
Function
TestBuiltInTaskPluginResponsesAndUsageContracts
(t *testing.T)
plugins/builtin_plugins_test.go:152
Function
TestBuiltInVendorPluginsDeclareNativeRoutesAndLegacyChannelTypes
(t *testing.T)
plugins/builtin_plugins_test.go:28
Function
TestBumpSyncTopicAddsAPendingTask
Every bump adds its own pending task, none of them deduplicated against the active ones, so no write is lost.
service/node_sync_test.go:44
Function
TestCASGuardedRefund_Lose
(t *testing.T)
service/task_billing_test.go:1299
Function
TestCASGuardedRefund_Win
(t *testing.T)
service/task_billing_test.go:1261
Function
TestCASGuardedSettle_Win
(t *testing.T)
service/task_billing_test.go:1336
Function
TestCacheAbsent_ZeroCacheTokens
--------------------------------------------------------------------------- Cache variables: absent (all zero) — same expression still works ---------
pkg/billingexpr/billingexpr_test.go:608
Function
TestCacheCreationInputTokensRoundTrip
(t *testing.T)
relaykit/dto/usage_merge_test.go:382
Function
TestCacheGetRandomSatisfiedChannelUsesTokenAutoGroupsWhenGlobalAutoIsEmpty
(t *testing.T)
service/channel_select_auto_groups_test.go:92
Function
TestCachePresent_LongContextTier
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:589
Function
TestCachePresent_StandardTier
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:574
Function
TestCacheUpdateChannelSyncsAdvancedCustomConfig
(t *testing.T)
model/pricing_endpoint_test.go:261
Function
TestCacheWriteTTLDetailsSurviveUsageSnapshots
(t *testing.T)
relaykit/dto/billing_usage_test.go:79
Function
TestCacheWriteTokensTotal
(t *testing.T)
service/text_quota_test.go:752
Function
TestCalcOpenRouterCacheCreateTokensDoesNotWrap
(t *testing.T)
service/quota_saturation_test.go:58
Function
TestCalcViolationFeeQuotaSaturates
(t *testing.T)
service/quota_saturation_test.go:50
Function
TestCalculateTextQuotaSummaryBillsCacheCreationInputTokens
(t *testing.T)
service/text_quota_test.go:867
Function
TestCalculateTextQuotaSummaryBillsOpenAICacheWriteTokens
(t *testing.T)
service/text_quota_test.go:811
Function
TestCalculateTextQuotaSummaryDoesNotApplyRequestMultipliersToToolSurcharge
(t *testing.T)
service/text_quota_test.go:1490
Function
TestCalculateTextQuotaSummaryFixedPriceAppliesImageCountOnceAndAllowsOverride
(t *testing.T)
service/text_quota_test.go:1273
Function
TestCalculateTextQuotaSummaryHandlesLegacyClaudeDerivedOpenAIUsage
(t *testing.T)
service/text_quota_test.go:776
Function
TestCalculateTextQuotaSummaryImageGenerationUsesStructuredSurcharge
(t *testing.T)
service/text_quota_test.go:1624
Function
TestCalculateTextQuotaSummaryKeepsPrePRClaudeOpenRouterBilling
(t *testing.T)
service/text_quota_test.go:1049
Function
TestCalculateTextQuotaSummaryNormalizesOpenAIResponsesBillingUsageDetails
(t *testing.T)
service/text_quota_test.go:660
Function
TestCalculateTextQuotaSummarySeparatesOpenRouterCacheCreationFromPromptBilling
(t *testing.T)
service/text_quota_test.go:1014
Function
TestCalculateTextQuotaSummarySeparatesOpenRouterCacheReadFromPromptBilling
(t *testing.T)
service/text_quota_test.go:977
Function
TestCalculateTextQuotaSummaryUnifiedForClaudeSemantic
(t *testing.T)
service/text_quota_test.go:313
Function
TestCalculateTextQuotaSummaryUsesAnthropicUsageSemanticFromUpstreamUsage
(t *testing.T)
service/text_quota_test.go:405
Function
TestCalculateTextQuotaSummaryUsesClaudeBillingUsageBeforeTopLevelUsage
(t *testing.T)
service/text_quota_test.go:446
Function
TestCalculateTextQuotaSummaryUsesGeminiBillingUsageBeforeTopLevelUsage
(t *testing.T)
service/text_quota_test.go:495
Function
TestCalculateTextQuotaSummaryUsesOpenAIBillingUsageBeforeTopLevelUsage
(t *testing.T)
service/text_quota_test.go:537
Function
TestCalculateTextQuotaSummaryUsesOpenAIResponsesInputTokenDetails
(t *testing.T)
service/text_quota_test.go:574
Function
TestCalculateTextQuotaSummaryUsesSplitClaudeCacheCreationRatios
(t *testing.T)
service/text_quota_test.go:366
Function
TestCalculateTextQuotaSummaryZeroTokensStillBillsToolSurcharge
A zero-token request (e.g. /v1/alpha/search returns no usage) must still bill a tool-call surcharge. Regression for the TotalTokens==0 gate zeroing ou
service/text_quota_test.go:1432
Function
TestCalculateTextToolCallSurchargeClampsCallCount
Every BuiltInTools count is bounded by MaxBillableToolCallCount at settlement, whatever recorded it (upstream-reported counts and per-item counts alik
service/text_quota_test.go:1394
Function
TestCalculateTextToolCallSurchargeDoesNotInferSearchForResponses
(t *testing.T)
service/text_quota_test.go:1370
Function
TestCalculateTextToolCallSurchargeGeminiFunctionCall
(t *testing.T)
service/text_quota_test.go:1539
Function
TestCalculateTextToolCallSurchargeGeminiGoogleSearch
(t *testing.T)
service/text_quota_test.go:1516
Function
TestCalculateTextToolCallSurchargeGeneralizedBuiltInTools
(t *testing.T)
service/text_quota_test.go:1301
Function
TestCalculateTextToolCallSurchargeImageGenerationDefaultPrice
(t *testing.T)
service/text_quota_test.go:1571
Function
TestCalculateTextToolCallSurchargeImageGenerationExplicitZeroDisables
(t *testing.T)
service/text_quota_test.go:1601
Function
TestCalculateTextToolCallSurchargeKeepsSearchPreviewFallbackWithCustomFunctions
(t *testing.T)
service/text_quota_test.go:1337
Function
TestCallReplyPassesContextAndOutputs
(t *testing.T)
pkg/jsplugin/provider_test.go:1088
Function
TestCallReplyResults
(t *testing.T)
pkg/jsplugin/provider_test.go:1105
Function
TestCallTransformPassesContextAndRequest
(t *testing.T)
pkg/jsplugin/provider_test.go:1015
Function
TestCallTransformResults
(t *testing.T)
pkg/jsplugin/provider_test.go:926
Function
TestCanonicalBillingModelNames
(t *testing.T)
setting/reasoning/suffix_test.go:11
Function
TestCanonicalGeminiUsageClampsNegativeCompletionFromTotalMinusPrompt
(t *testing.T)
relaykit/dto/billing_usage_test.go:124
Function
TestCanonicalOpenAIUsageMergesInputTokenDetailsFieldwise
(t *testing.T)
relaykit/dto/billing_usage_test.go:133
Function
TestCapRequestPluginRecordKeepsTheCount
A capped record keeps counting what a Realtime session already dropped.
relay/requestplugin/socket_test.go:462
Function
TestCapabilitiesUseCatalogShape
(t *testing.T)
service/authz/authz_test.go:275
Function
TestCeilFloor
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:393
Function
TestChainedConverterWithNativeResponse
A chained route converts the client request with its registered converter before the hooks, which see a Claude Messages body here. A nativeResponse re
router/provider_plugin_relay_test.go:958
Function
TestChannel
(c *gin.Context)
controller/channel-test.go:889
Function
TestChannelAffinityHitCodexTemplatePassHeadersEffective
(t *testing.T)
service/channel_affinity_template_test.go:291
Function
TestChannelAffinityRetryPriorities
(t *testing.T)
controller/channel_pin_retry_test.go:125
Function
TestChannelConfigIsValidatedAndReadWithDefaults
(t *testing.T)
pkg/jsplugin/channel_config_test.go:20
Function
TestChannelConfigSchemaRules
(t *testing.T)
pkg/jsplugin/channel_config_test.go:64
Function
TestChannelDefaultBaseURLsRequireReadPermission
(t *testing.T)
router/channel_router_test.go:16
Function
TestChannelDeleteRoutesUseSensitiveWritePermission
(t *testing.T)
router/channel_router_test.go:37
Function
TestChannelFieldsAreClassified
TestChannelFieldsAreClassified guards the fail-closed sensitivity check: every JSON field of PatchChannel (including the embedded model.Channel) must
controller/channel_authz_test.go:167
Function
TestChannelHasSensitiveChanges
(t *testing.T)
controller/channel_authz_test.go:18
Function
TestChannelKeyShowsCredentialSummaries
(t *testing.T)
controller/provider_plugin_test.go:223
Function
TestChannelMatchesExpectedTaskPluginRejectsUnindexedLegacyChannel
(t *testing.T)
middleware/distributor_test.go:130
Function
TestChannelMatchesExpectedTaskPluginUsesGenericChannelSetting
(t *testing.T)
middleware/distributor_test.go:99
Function
TestChannelMatchesExpectedTaskPluginUsesNewAPIExtensions
(t *testing.T)
middleware/distributor_test.go:429
Function
TestChannelMatchesExpectedTaskPluginUsesPinnedLegacyIndex
(t *testing.T)
middleware/distributor_test.go:108
Function
TestChannelNoticesFollowEachAdministratorsSwitch
Channel notices go to every enabled administrator whose channel switch is on, in that administrator's saved language. Until an administrator chooses,
service/user_notify_test.go:103
Function
TestChannelOtherInfoWritesKeepConcurrentChanges
A writer of other_info writes back only while no other writer, on any node, changed it since the read; otherwise it reads again, so both changes are k
model/channel_status_test.go:88
Function
TestChannelOtherSettingsValidateToolLossPolicy
(t *testing.T)
relaykit/dto/channel_settings_test.go:728
Function
TestChannelOwnerNameUsesAdaptorChannelName
(t *testing.T)
controller/model_owned_by_test.go:16
Function
TestChannelPriorityDatabaseMatrix
(t *testing.T)
model/channel_priority_test.go:58
Function
TestChannelPriorityPlan
(t *testing.T)
model/channel_priority_test.go:19
Function
TestChannelSatisfiesFilters
(t *testing.T)
model/channel_constraint_test.go:180
Function
TestChannelSettingsHTTPTransportJSONRoundTrip
(t *testing.T)
relaykit/dto/channel_settings_test.go:666
Function
TestChannelSettingsValidateHTTPTransport
(t *testing.T)
relaykit/dto/channel_settings_test.go:705
Function
TestChannelStatusRoutesRegisterWithoutConflict
(t *testing.T)
router/channel_router_test.go:53
Function
TestChannelStatusRoutesUseExpectedPermissions
(t *testing.T)
router/channel_router_test.go:27
Function
TestChannelStatusValidation
(t *testing.T)
controller/channel_authz_test.go:154
Function
TestChannelTLSInsecureSkipVerifyAcceptsUntrustedUpstream
(t *testing.T)
service/http_client_transport_test.go:321
Function
TestChannelTestOpenAIChatCompatibility
(t *testing.T)
controller/channel_test_request_test.go:78
Function
TestChannelValidateSettingsRejectsInvalidHTTPTransport
(t *testing.T)
model/channel_settings_test.go:21
Function
TestChatCompletionsRequestToResponsesRequestImageDetail
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_req_test.go:43
Function
TestChatCompletionsRequestToResponsesRequestInstructionsAndTools
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_req_test.go:16
Function
TestChatCompletionsRequestToResponsesRequestPreservesPenalties
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_req_test.go:151
Function
TestChatCompletionsRequestToResponsesRequestPreservesPromptCacheKey
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_req_test.go:74
Function
TestChatCompletionsRequestToResponsesRequestPreservesQwenThinkingBudget
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_req_test.go:106
Function
TestChatCompletionsRequestToResponsesRequestRejectsMultipleChoices
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_req_test.go:142
Function
TestChatCompletionsResponseToResponsesDropsEmptyNameToolCalls
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp_test.go:46
Function
TestChatCompletionsResponseToResponsesEmitsReasoningSummaryBeforeText
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp_test.go:104
← previous
next →
12,001–12,100 of 15,409, ranked by callers