MCPcopy
hub / github.com/QuantumNous/new-api / isModelsDevAPIEndpoint

Function isModelsDevAPIEndpoint

controller/ratio_sync.go:702–715  ·  view source on GitHub ↗
(rawURL string)

Source from the content-addressed store, hash-verified

700}
701
702func isModelsDevAPIEndpoint(rawURL string) bool {
703 parsedURL, err := url.Parse(rawURL)
704 if err != nil {
705 return false
706 }
707 if strings.ToLower(parsedURL.Hostname()) != modelsDevHost {
708 return false
709 }
710 path := strings.TrimSuffix(parsedURL.Path, "/")
711 if path == "" {
712 path = "/"
713 }
714 return path == modelsDevPath
715}
716
717// convertOpenRouterToRatioData parses OpenRouter's /v1/models response and converts
718// per-token USD pricing into the local ratio format.

Callers 1

FetchUpstreamRatiosFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected