CLIProxyAPI icon indicating copy to clipboard operation
CLIProxyAPI copied to clipboard

OAuth model policy and capability metadata should remain visible to model selectors

Open ArmedHelicopter opened this issue 1 month ago • 1 comments

Problem

The OpenAI-compatible /v1/models response can discard explicit provider model capability metadata such as input/output modalities and supported parameters. The registry already contains this metadata, but the OpenAI model-list serializer retained only the standard identity fields.

Why this matters

The existing GUI model configuration and discovery flow already supports selecting/configuring models. It relies on /v1/models metadata to present accurate capabilities. If explicit metadata is dropped, clients see only a model ID and must either show incomplete capability information or make unsafe guesses from model names.

Proposed design

  • Preserve only capability metadata explicitly present in the registry through /v1/models.
  • Keep unknown capability unknown when the provider does not declare it.
  • Do not infer image/audio/video support from model names.
  • Do not change the existing model configuration/selection flow or replace it with a second configuration system.
  • Do not change global registry semantics for OAuth credentials in this issue. OAuth account/provider exclusions are policy handled by the existing client configuration paths and request enforcement; they are a separate concern from capability serialization.

Acceptance criteria

  • /v1/models preserves explicit input/output modality and supported-parameter metadata.
  • Internal registry-only fields are not leaked.
  • Existing GUI model discovery/configuration remains the single selection flow.
  • Unknown capabilities are not fabricated.
  • An end-to-end test covers registry registration through /v1/models serialization.

ArmedHelicopter avatar Oct 29 '26 00:10 ArmedHelicopter

Thanks for the detailed write-up and companion PR (#7091).

  1. Strict Standard Format on Default /v1/models: When called without a specific User-Agent header or query parameters, GET /v1/models intentionally follows the standard https://api.openai.com/v1/models schema (id, object, created, owned_by). By design, we do not add extra non-standard fields (input_modalities, output_modalities, supported_parameters, etc.) to the default OpenAI model list response.
  2. Full Model Metadata Endpoints: CLIProxyAPI already supports returning rich model catalog metadata (including input_modalities, token limits, and reasoning capabilities) when querying /v1/models with designated query parameters (such as /v1/models?client_version=cpa or /v1/models?client_version=<version>) or specific User-Agent headers. Please see internal/api/server_routes.go and sdk/api/handlers/openai/codex_client_models.go for details.
  3. OAuth Model Exclusions: Per-credential excluded_models and global oauth-excluded-models (including wildcard rules) are already applied when each credential registers its models into the registry (sdk/cliproxy/service_models.go) and enforced during routing. Because the global model registry represents the union of all active credentials, account-specific selector filtering in external agent configuration clients should be handled on the client side against the active credential policy.

Closing this issue as not planned to keep the default /v1/models response strictly aligned with the standard OpenAI schema.

luispater avatar Oct 29 '26 00:10 luispater