/v1/models: return the full catalog with per-model availability + opt-in filter Split…
- User
/v1/models: return the full catalog with per-model availability + opt-in filter Split out from #242.
Current: `GET /v1/models` returns only models that are connected right now (enabled AND an enabled key can serve them).
Wanted: by default return the whole catalog (one entry per model id), each annotated with whether it's usable, plus an opt-in filter to get just the connected ones.
Per-model annotation:
- `available`: boolean — enabled AND a matching enabled key exists.
- `unavailable_reason`: `null` | `"no_key"` (enabled, no key) | `"disabled"` (catalog row disabled).
Filter:
- `?available=true` (alias `?connected=true`) → only connected models (the previous default behavior).
Notes:
- The extra fields are additive — OpenAI-compatible clients ignore unknown fields.
- Dedup prefers an available instance of a model id over a disabled/keyless one.
- The `auto` virtual model is always `available: true`.
Interface
No new interfaces are introduced.
- Assistant
I'll locate the current
/v1/modelsimplementation and how model availability is determined. - Assistant
Implementing the endpoint change and adding tests.
- Assistant
All tests passed. Checking lints on the edited files.
- Assistant
GET /v1/modelsnow returns the full catalog by default, with per-model availability metadata and an opt-in connected filter.Behavior
Default — every catalog model (deduped by
model_id), each with:available:truewhen the row is enabled and a matching enabled key existsunavailable_reason:null|"no_key"|"disabled"
?available=trueor?connected=true— only connected models (previous default behavior)Dedup — when the same
model_idappears on multiple platforms, the available instance wins.auto— alwaysavailable: true,unavailable_reason: nullExample response shape
{ "object": "list", "data": [ { "id": "auto", "available": true, "unavailable_reason": null, ... }, { "id": "openai/gpt-oss-120b", "available": true, "unavailable_reason": null, ... }, { "id": "gemini-2.5-pro", "available": false, "unavailable_reason": "disabled", ... } ] }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.