Resolves the API key to use for ONE AI driver class.
A shape for handing a scoped key-resolution capability to code that spends an AI key without
handing over the key list itself. A holder can ask for the one driver class it needs; it cannot
enumerate the run's credentials, and whoever built the resolver decides whether to answer.
Realtime uses it. @memberjunction/actions-base declares the same signature separately as
RuntimeAPIKeyResolver (it does not depend on this package), and the prompt runner still takes
the key list (AIPromptParams.apiKeys).
undefined means "no key for that driver class" — which is also how a deliberate refusal reads,
so a caller treats both the same way: fall back to the platform key, or skip that vendor. Under a
'RuntimeOnly'AICredentialScope the caller must skip it — falling back is what the scope forbids.
Resolves the API key to use for ONE AI driver class.
A shape for handing a scoped key-resolution capability to code that spends an AI key without handing over the key list itself. A holder can ask for the one driver class it needs; it cannot enumerate the run's credentials, and whoever built the resolver decides whether to answer. Realtime uses it.
@memberjunction/actions-basedeclares the same signature separately asRuntimeAPIKeyResolver(it does not depend on this package), and the prompt runner still takes the key list (AIPromptParams.apiKeys).undefinedmeans "no key for that driver class" — which is also how a deliberate refusal reads, so a caller treats both the same way: fall back to the platform key, or skip that vendor. Under a'RuntimeOnly'AICredentialScope the caller must skip it — falling back is what the scope forbids.Build one with MakeAIAPIKeyResolver.