#1226·freellmapi

CLI: add provider key management (keys add/list/remove/test)

Author: axisrowCreated Sep 15, 2026Updated Sep 15, 2026

Problem

Provider API keys can only be added through the dashboard UI (Keys page) or a manual authenticated POST /api/keys curl. The CLI has no command for it — freellmapi --help offers only setup-*, launch, launch-codex, doctor, list, and its --api-key flag refers to the unified proxy key written into client configs, not provider keys.

Proposal

Add key-management commands to the CLI, e.g.:

bash
freellmapi keys add <platform>          # prompts for the key (hidden input), validates it
freellmapi keys add <platform> --key <k>
freellmapi keys list                    # platform, model count, enabled/disabled, key status (never the key itself)
freellmapi keys remove <platform> [--id <key-id>]
freellmapi keys test <platform>         # run validateKey() against the stored key

Should reuse the existing /api/* dashboard-auth surface (session token via env var or --token, or a one-time freellmapi login flow), consistent with how setup-* already talks to --url.

Why

Headless setups (server over SSH, Docker, scripting) currently force users through the web UI or hand-rolled curl for the one credential step. doctor could also surface "provider X enabled but no valid key" more usefully once keys are CLI-manageable.

Source: tashfeenahmed/freellmapi