IAiKeyStore

References
public interface IAiKeyStore
Persistent storage for LLM-provider API keys. Implementations use the platform's native secret store: macOS Keychain on macOS, DPAPI-encrypted file on Windows. Keys are scoped to the current OS user account and to a specific AiProvider, so an Anthropic key and a Google key can coexist.

Methods

DeleteKey

#
Removes the stored key for the given provider. Silent if no key was stored.
void DeleteKey(
provider
)

SetKey

#
Stores the given API key for the given provider, overwriting any existing entry. Throws on failure.
void SetKey(
provider,
apiKey
)

TryGetKey

#
Returns the stored API key for the given provider, or null if none is stored or it cannot be read.
string TryGetKey(
provider
)