diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-02-10 11:05:09 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-02-10 11:05:09 +0300 |
| commit | 875de679cf4732bbd70361d826d65d9d8b190add (patch) | |
| tree | e4ad90c2bdde747ad057e4e7d6e850c3173018fd /models/openrouter.go | |
| parent | 3b542421e35180db9b9f972ee973befc42f1a46f (diff) | |
| parent | 37b98ad36cd7e63d96a190017b78fe35143a2e6a (diff) | |
Merge branch 'feat/char-secrets'
Diffstat (limited to 'models/openrouter.go')
| -rw-r--r-- | models/openrouter.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/models/openrouter.go b/models/openrouter.go index 50f26b6..6196498 100644 --- a/models/openrouter.go +++ b/models/openrouter.go @@ -143,11 +143,14 @@ type ORModels struct { func (orm *ORModels) ListModels(free bool) []string { resp := []string{} - for _, model := range orm.Data { + for i := range orm.Data { + model := &orm.Data[i] // Take address of element to avoid copying 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) |
