llm_key: Set LLM API Key

View source: R/config.R

llm_keyR Documentation

Set LLM API Key

Description

Stores an API key in the llm.api.api_key option, which chat prefers over environment variables.

Usage

llm_key(key)

Arguments

key

Character. API key for authentication.

Value

The previous value of the option, invisibly.

Examples

old <- llm_key("sk-not-a-real-key")
llm_key(old)  # restore

llm.api documentation built on April 16, 2026, 5:08 p.m.