(rawURL string)
| 700 | } |
| 701 | |
| 702 | func 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. |
no outgoing calls
no test coverage detected