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
TestNormalizeCacheCreationSplit
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_resp_test.go:418
Function
TestNormalizeChannelModelMapping
(t *testing.T)
controller/channel_upstream_update_test.go:494
Function
TestNormalizeClickHouseDSN
(t *testing.T)
model/clickhouse_log_test.go:34
Function
TestNormalizeGeminiThinkingConfigRewritesNativeConfig
(t *testing.T)
relaykit/relayconvert/reasoning/gemini_test.go:144
Function
TestNormalizeHTTPTransportPolicyClampsWithoutPanic
(t *testing.T)
service/http_client_transport_test.go:572
Function
TestNormalizeModelNames
(t *testing.T)
controller/channel_upstream_update_test.go:421
Function
TestNormalizeOpenAIUsageMapsOutputImageTokens
(t *testing.T)
relay/channel/openai/image_stream_test.go:121
Function
TestNormalizeResponsesUsagePreservesImageCacheDetails
(t *testing.T)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp_test.go:12
Function
TestNormalizeResponsesWSCreateEventFlat
(t *testing.T)
relay/responses_websocket_test.go:441
Function
TestNormalizeResponsesWSCreateEventWrapper
(t *testing.T)
relay/responses_websocket_test.go:402
Function
TestNormalizeResponsesWSMaxOutputTokens
(t *testing.T)
relay/responses_websocket_test.go:44
Function
TestNormalizeTaskAction
(t *testing.T)
constant/task_test.go:9
Function
TestOAuth2JWTAuthCachesAndRefreshes
(t *testing.T)
relay/channel/task/jsplugin/auth_test.go:23
Function
TestOAuth2JWTContextDoesNotExposeServiceAccountKey
(t *testing.T)
relay/channel/task/jsplugin/auth_test.go:49
Function
TestOAuthBindIgnoresLegacyGitHubUsernames
(t *testing.T)
controller/auth_flow_test.go:1069
Function
TestOAuthBindProviderErrorConsumesSessionBoundFlow
(t *testing.T)
controller/auth_flow_test.go:795
Function
TestOAuthLoginConsumesFlowAfterProviderIdentityAndOnProviderError
(t *testing.T)
controller/auth_flow_test.go:761
Function
TestOAuthLoginConsumesFlowOnlyAfterProviderIdentity
(t *testing.T)
controller/auth_flow_test.go:725
Function
TestOAuthLoginLegacyGitHubBindingMigratesAfterLoginVerification
(t *testing.T)
controller/auth_flow_test.go:991
Function
TestOAuthLoginLegacyGitHubBindingRequiresAccountEvidence
(t *testing.T)
controller/auth_flow_test.go:886
Function
TestOAuthProviderWritesBumpTheirTopicInTheSameTransaction
An OAuth provider write and its topic bump share a transaction, as nothing else reloads the providers on other nodes: a write whose bump fails is not
service/node_sync_test.go:329
Function
TestOAuthRegistrationPersistsInviter
(t *testing.T)
controller/auth_flow_test.go:1127
Function
TestOIDCProvider_GetName
(t *testing.T)
oauth/oidc_test.go:10
Function
TestOIDCSettings_DisplayNamePersistenceRoundTrip
(t *testing.T)
setting/system_setting/oidc_test.go:31
Function
TestOIDCSettings_GetEffectiveDisplayName
(t *testing.T)
setting/system_setting/oidc_test.go:11
Function
TestOaiChatToResponsesStreamHandlerConvertsSSEOrderAndUsage
(t *testing.T)
relay/channel/openai/chat_via_responses_test.go:221
Function
TestOaiChatToResponsesStreamHandlerRestoresCodexCustomToolCall
(t *testing.T)
relay/channel/openai/chat_via_responses_test.go:273
Function
TestOaiResponsesHandlerCountsCompletedImageGenerationOutputs
(t *testing.T)
relay/channel/openai/relay_responses_billing_test.go:315
Function
TestOaiResponsesHandlerCountsImageGenerationOnIncompleteStatus
(t *testing.T)
relay/channel/openai/relay_responses_billing_test.go:361
Function
TestOaiResponsesHandlerCountsOutputCallsNotDeclarations
(t *testing.T)
relay/channel/openai/relay_responses_billing_test.go:224
Function
TestOaiResponsesHandlerDeclaredToolsWithoutOutputCountZero
(t *testing.T)
relay/channel/openai/relay_responses_billing_test.go:275
Function
TestOaiResponsesHandlerRewritesSGLangCreatedAtToInt
(t *testing.T)
relay/channel/openai/relay_responses_billing_test.go:526
Function
TestOaiResponsesHandlersKeepCacheWriteTTLSplit
The 12h cache-write split reaches billing from JSON, stream and compaction responses. The usage is the OpenAI prompt caching guide example.
relay/channel/openai/relay_responses_billing_test.go:474
Function
TestOaiResponsesStreamHandlerCompletionLifecycle
(t *testing.T)
relay/channel/openai/relay_responses_billing_test.go:105
Function
TestOaiResponsesStreamHandlerCountsImageOutputOnIncomplete
(t *testing.T)
relay/channel/openai/relay_responses_billing_test.go:452
Function
TestOaiResponsesStreamHandlerDeduplicatesCompletedImageOutput
(t *testing.T)
relay/channel/openai/relay_responses_billing_test.go:441
Function
TestOaiResponsesStreamHandlerDoesNotCountPartialImageEvent
(t *testing.T)
relay/channel/openai/relay_responses_billing_test.go:462
Function
TestOaiResponsesStreamHandlerKeepsNonSGLangCreatedAt
(t *testing.T)
relay/channel/openai/relay_responses_billing_test.go:584
Function
TestOaiResponsesStreamHandlerRewritesSGLangCreatedAtToInt
(t *testing.T)
relay/channel/openai/relay_responses_billing_test.go:548
Function
TestOaiResponsesToChatBufferedStreamHandlerPreservesInterleavedClaudeContent
(t *testing.T)
relay/channel/openai/chat_via_responses_test.go:177
Function
TestOaiResponsesToChatBufferedStreamHandlerReturnsJSONFromSSE
(t *testing.T)
relay/channel/openai/chat_via_responses_test.go:147
Function
TestOaiResponsesToChatStreamHandlerConvertsClaudeSSETerminalsAndUsage
(t *testing.T)
relay/channel/openai/chat_via_responses_test.go:93
Function
TestOaiResponsesToChatStreamHandlerConvertsSSEOrderAndUsage
(t *testing.T)
relay/channel/openai/chat_via_responses_test.go:45
Function
TestObserveChannelAffinityUsageCacheByRelayFormat_ClaudeMode
(t *testing.T)
service/channel_affinity_usage_cache_test.go:36
Function
TestObserveChannelAffinityUsageCacheByRelayFormat_MixedMode
(t *testing.T)
service/channel_affinity_usage_cache_test.go:62
Function
TestObserveChannelAffinityUsageCacheByRelayFormat_UnsupportedModeKeepsEmpty
(t *testing.T)
service/channel_affinity_usage_cache_test.go:91
Function
TestObserveResponsesOutcomeRecordsProtocolFacts
(t *testing.T)
service/responses_usage_test.go:114
Function
TestObserveStreamChoicesDedupesFunctionCallNames
(t *testing.T)
relay/channel/openai/stream_tool_billing_test.go:11
Function
TestOllamaChatHandlerNonStreamToolCalls
(t *testing.T)
relay/channel/ollama/stream_test.go:20
Function
TestOllamaStreamHandlerDoneToolCalls
(t *testing.T)
relay/channel/ollama/stream_test.go:189
Function
TestOnePluginMayOwnMultipleMethodsForSamePath
(t *testing.T)
router/plugin_router_test.go:660
Function
TestOnlyRelayHooksNeedRelayRoutes
(t *testing.T)
pkg/jsplugin/provider_test.go:99
Function
TestOpenAIChatRequestToClaudeMessagesMergesAdjacentAssistantToolCalls
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_req_test.go:115
Function
TestOpenAIChatRequestToClaudeMessagesNormalizesToolInputSchema
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_req_test.go:47
Function
TestOpenAIChatRequestToClaudeMessagesOmitsEmptyTools
(t *testing.T)
relaykit/relayconvert/claude_default_max_tokens_test.go:132
Function
TestOpenAIChatRequestToClaudeMessagesStopSequences
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_claude_messages_req_test.go:14
Function
TestOpenAIChatRequestToClaudeMessages_ClaudeOpus48HighUsesAdaptiveThinking
(t *testing.T)
relay/channel/claude/relay_claude_test.go:427
Function
TestOpenAIChatRequestToClaudeMessages_ClaudeOpus48ThinkingUsesAdaptiveHighEffort
(t *testing.T)
relay/channel/claude/relay_claude_test.go:454
Function
TestOpenAIChatSamplingCompatibility
(t *testing.T)
controller/channel_test_request_test.go:120
Function
TestOpenAIChatTokenLimitCompatibility
(t *testing.T)
controller/channel_test_request_test.go:203
Function
TestOpenAIImageProtocolClaimBindsBothEndpointsAndRequiresRender
The OpenAI Images protocol is claimed in bare-string form, binds both image endpoints for every declared model, and requires the render hook that shap
pkg/jsplugin/routing_test.go:110
Function
TestOpenAIPivotExplicitEffortOverridesPivotWithDiagnostic
(t *testing.T)
relaykit/relayconvert/reasoning/intent_test.go:258
Function
TestOpenAIPivotRetainsExactStrengthAndBudget
(t *testing.T)
relaykit/relayconvert/reasoning/intent_test.go:227
Function
TestOpenAIResponsesRequestDropsThinkingBudgetForNonQwenModel
(t *testing.T)
relaykit/dto/openai_request_zero_value_test.go:174
Function
TestOpenAIResponsesRequestPreserveExplicitZeroValues
(t *testing.T)
relaykit/dto/openai_request_zero_value_test.go:120
Function
TestOpenAIResponsesRequestPreserveQwQThinkingBudget
(t *testing.T)
relaykit/dto/openai_request_zero_value_test.go:160
Function
TestOpenAIResponsesRequestPreserveQwenThinkingBudget
(t *testing.T)
relaykit/dto/openai_request_zero_value_test.go:146
Function
TestOpenAIToGeminiSafetySettings
(t *testing.T)
relaykit/relayconvert/safety_settings_test.go:14
Function
TestOpenaiImageDoResponseUsesInfoIsStream
(t *testing.T)
relay/channel/openai/image_stream_test.go:148
Function
TestOpenaiImageHandlerUsesPositiveActualCountForFixedPrice
(t *testing.T)
relay/channel/openai/image_stream_test.go:427
Function
TestOpenaiImageHandlersReturnJSONError
TestOpenaiImageHandlersReturnJSONError covers JSON error responses for both entry points: the non-streaming handler and the stream handler's non-SSE f
relay/channel/openai/image_stream_test.go:551
Function
TestOpenaiImageStreamHandlerClientDisconnectKeepsRequestedCount
TestOpenaiImageStreamHandlerClientDisconnectKeepsRequestedCount guards the billing invariant: completed-event counting must not lower the charge when
relay/channel/openai/image_stream_test.go:333
Function
TestOpenaiImageStreamHandlerClientDisconnectRaisesCount
TestOpenaiImageStreamHandlerClientDisconnectRaisesCount covers the other direction of the abort guard: when completed events already exceed the record
relay/channel/openai/image_stream_test.go:364
Function
TestOpenaiImageStreamHandlerForwardsSSEAndUsage
TestOpenaiImageStreamHandlerForwardsSSEAndUsage covers the core SSE path: chunks are forwarded with rebuilt event lines, usage is extracted and normal
relay/channel/openai/image_stream_test.go:183
Function
TestOpenaiImageStreamHandlerRecordsUpstreamErrorEvent
TestOpenaiImageStreamHandlerRecordsUpstreamErrorEvent verifies that an error event inside the SSE stream is recorded as a soft error while the payload
relay/channel/openai/image_stream_test.go:600
Function
TestOpenaiImageStreamHandlerUsesCompletedEventCount
(t *testing.T)
relay/channel/openai/image_stream_test.go:221
Function
TestOpenaiImageStreamHandlerWrapsJSONResponse
TestOpenaiImageStreamHandlerWrapsJSONResponse covers the non-SSE fallback: a JSON upstream response is wrapped into pseudo-SSE completed events.
relay/channel/openai/image_stream_test.go:397
Function
TestOpenaiImageStreamHandlerWrapsNonStandardDataShapes
TestOpenaiImageStreamHandlerWrapsNonStandardDataShapes covers the JSON-to-SSE fallback when upstream returns data as an object, splits one image acros
relay/channel/openai/image_stream_test.go:496
Function
TestOptInSafeToolLossRejectedAsBadRequestWithAdminDiagnostics
(t *testing.T)
relay/convert_request_error_test.go:178
Function
TestOptionalManifestField
meta.optional is a boolean of a plugin with a request processing part.
pkg/jsplugin/registry_test.go:1418
Function
TestOriginKeyUsesSchemeAndHost
(t *testing.T)
service/http_client_transport_test.go:95
Function
TestOutboundEffectsAndAudit
(t *testing.T)
relay/requestplugin/requestplugin_test.go:149
Function
TestPDFStreamDecodeBounds
A stream is decoded only when the filters and decode parameters the library reads for it, through references too, stay within the bounds: a buffer siz
relay/requestplugin/pdf_test.go:158
Function
TestPDFToUnicodeBounds
A ToUnicode map is read in bounded work: a range expands to at most maxPDFCMapCodes codes in all, whether or not its target names text, and decoding s
relay/requestplugin/pdf_test.go:301
Function
TestParamOverridePlugin
(t *testing.T)
plugins/request_plugins_test.go:315
Function
TestParamOverrideReply
(t *testing.T)
relay/requestplugin/requestplugin_test.go:533
Function
TestParamProbeArrayLength
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:290
Function
TestParamProbeNestedBool
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:273
Function
TestParseCredentialLeavesOtherKeysAlone
(t *testing.T)
pkg/jsplugin/provider_test.go:245
Function
TestParseGeminiModelSuffixNoThinkingDisablesReasoning
(t *testing.T)
relaykit/relayconvert/reasoning/suffix_test.go:10
Function
TestParseHTTPStatusCodeRanges_CommaSeparated
(t *testing.T)
setting/operation_setting/status_code_ranges_test.go:9
Function
TestParseHTTPStatusCodeRanges_Invalid
(t *testing.T)
setting/operation_setting/status_code_ranges_test.go:28
Function
TestParseHTTPStatusCodeRanges_MergeAndNormalize
(t *testing.T)
setting/operation_setting/status_code_ranges_test.go:19
Function
TestParseHTTPStatusCodeRanges_NoComma_IsInvalid
(t *testing.T)
setting/operation_setting/status_code_ranges_test.go:33
Function
TestParseKnownProviderModelSuffix
(t *testing.T)
relaykit/relayconvert/reasoning/suffix_test.go:22
Function
TestParseOpenAIModelIDsStrictResponseContract
(t *testing.T)
controller/channel_upstream_update_test.go:41
Function
TestParseOpenAIReasoningEffortPreservesCodexMax
(t *testing.T)
setting/reasoning/suffix_test.go:113
Function
TestParsePasskeyFinishRequestDoesNotRewriteRequestBody
(t *testing.T)
controller/passkey_test.go:765
Function
TestParseThinkingModifier
(t *testing.T)
relaykit/relayconvert/reasoning/suffix_test.go:153
Function
TestParseVLLMMetricsPreservesSeriesAndHistogramTotals
(t *testing.T)
controller/channel_inference_test.go:112
← previous
next →
12,901–13,000 of 15,409, ranked by callers