Set the API key for image generation. Use this when the image-generation resource uses a different API key than your chat or embedding resource.
Details
If not set, foundry_image() will fall back to AZURE_FOUNDRY_KEY.
Examples
local({
old <- Sys.getenv("AZURE_FOUNDRY_IMAGE_KEY", unset = NA_character_)
on.exit({
if (is.na(old)) {
Sys.unsetenv("AZURE_FOUNDRY_IMAGE_KEY")
} else {
Sys.setenv(AZURE_FOUNDRY_IMAGE_KEY = old)
}
})
foundry_set_image_key("example-image-key-not-a-secret")
})
#> ✔ Image API key set successfully.