Fix: openrouter model list

This commit is contained in:
Grail Finder
2026-02-02 14:29:31 +03:00
parent fcb4b99332
commit e3be45b023
3 changed files with 103 additions and 4 deletions

View File

@@ -145,9 +145,11 @@ func (orm *ORModels) ListModels(free bool) []string {
resp := []string{}
for _, model := range orm.Data {
if free {
if model.Pricing.Prompt == "0" && model.Pricing.Request == "0" &&
model.Pricing.Completion == "0" {
resp = append(resp, model.ID)
if model.Pricing.Prompt == "0" && model.Pricing.Completion == "0" {
// treat missing request as free
if model.Pricing.Request == "" || model.Pricing.Request == "0" {
resp = append(resp, model.ID)
}
}
} else {
resp = append(resp, model.ID)