Skip to contents

Retrieve the API key for an LLM provider from the environment

Usage

llm_api_key(provider)

Arguments

provider

character(1) provider name; see llm_env_var

Value

character(1) the key value; empty string for keyless providers (e.g. ollama)

Note

Stops with an informative error if the required environment variable is not set.

Examples

llm_api_key("ollama")  # always returns "" without checking any env var
#> [1] ""