litellm/ui/litellm-dashboard/src
Jason Cook 9d0466ba6d feat(ui): oauth_credential_select field type for Add Model form
Previously the ChatGPT (OAuth) provider in the Add Model form rendered
a plain text input for ``api_key`` and expected the admin to type the
``oauth:<credential_name>`` marker by hand — easy to typo, and
discoverability depended on reading the tooltip.

Add a new ``field_type: "oauth_credential_select"`` that
``provider_specific_fields.tsx`` renders as an antd Select populated
from ``useCredentials()``, filtered to OAuth-backed credentials
(``credential_info.type`` in ``{chatgpt_oauth, copilot_oauth}``).
Picking a row stores ``oauth:<credential_name>`` as the form value, so
the downstream request path is unchanged.

Wire-up:

- ``ProviderCredentialField`` Literal (Python) and
  ``ProviderCredentialFieldMetadata`` union (TypeScript) both extended
  with the new type.
- ``provider_create_fields.json`` for ``ChatGPT`` updated to use it.
- Empty-state: if no OAuth credentials exist yet, the dropdown shows a
  "No OAuth credentials found" hint pointing at Credentials → Add
  Credential.

No change to Copilot's entry — Copilot's existing ``api_key``/``api_base``
text fields stay, since that provider still supports plain PAT auth
alongside OAuth. Admins who want the OAuth flow for Copilot can still
type ``oauth:<name>`` into the ``api_key`` field manually; the dropdown
will cover that too in a follow-up if you want symmetry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 11:21:02 -04:00
..
app Merge branch 'main' into litellm_oss_staging_04_04_2026 2026-04-14 20:23:06 +05:30
components feat(ui): oauth_credential_select field type for Add Model form 2026-04-23 11:21:02 -04:00
contexts [Fix] UI: Migrate AntD message API to use context-based MessageManager 2026-03-19 23:29:38 -07:00
data feat: Add Canadian PII protection (PIPEDA) (#22951) 2026-03-06 18:27:31 -08:00
hooks [Fix] UI: resolve CodeQL security alerts and Dockerfile.health_check hardening 2026-04-08 17:21:25 -07:00
lib added and ran prettier autoformatter 2025-10-04 18:19:48 -07:00
utils Merge branch 'main' into litellm_oss_staging_04_04_2026 2026-04-14 20:23:06 +05:30
types.ts added and ran prettier autoformatter 2025-10-04 18:19:48 -07:00