testKey

fun testKey(providerId: ProviderId)(source)

Runs one real completion against providerId's saved key and records the typed AiFailure if it fails — so a wrong key reads "unauthorized" here instead of an empty reply three screens later.