{# Plan 61/2b W2 — "Provider keys" tab body of /admin/llm. Lifted from the old `admin/pages/llm_keys.html` body (drop {% extends %}). The page-header lives in the parent (`llm.html`) so we only render the business chrome here. #} {% from 'admin/components/ui.html' import card, input, select, modal, empty_state, tooltip %}

Provider keys

Per-server credentials. Plaintext keys are encrypted at rest and never returned by the API. The boot health-check probes each row at startup — rotate any row flagged corrupt below. For a guided walkthrough use Add LLM key.

Run cmdop-admin llm-keys migrate-secret-box to re-encrypt rows with the new key, or deactivate-corrupt to soft-revoke unrecoverable rows. See troubleshooting.

{% call modal('showModal', 'closeModal()', width='max-w-lg') %}

Add provider key

Where to get the key →
{{ input("name", label="Name", placeholder="primary", required=true, attrs='x-model="form.name"') }}

Human-readable label. Multiple keys per provider allowed.

{{ input("api_key", label="API key", type="password", required=true, attrs='x-model="form.api_key" :placeholder="currentProvider.keyPlaceholder" autocomplete="off" spellcheck="false"') }}

Saved encrypted. You won't see the full value again after submit.

{{ input("base_url", label="Base URL (optional)", attrs='x-model="form.base_url" :placeholder="currentProvider.baseUrl"') }}

Leave empty to use the provider default.

Only one default per provider — the current default will be demoted.

{% endcall %} {% call modal('revokeTarget !== null', 'revokeTarget = null', width='max-w-md') %}

Revoke provider key?

will be marked inactive. Any in-flight calls finish, but new dispatches skip it. This is a soft-revoke; the row remains for audit.

{% endcall %} {% call card() %}
Provider Name Preview Default {{ tooltip('Used for any model from this provider unless an alias overrides.') }} Status Created Actions
Loading…
{{ empty_state( "No provider keys yet", "Add an OpenAI, Anthropic, OpenRouter or DashScope key to start dispatching requests through the gateway.", icon="key", action_label="Add LLM key (wizard)", action_href="/admin/wizards/add-llm-key", ) }}
{% endcall %}