openai

The openai credential can be used to access OpenAI resources.

credential "openai" "my_openai" {
api_key = "sk-jwgthNa..."
}

Arguments

NameTypeRequired?Description
api_keyStringOptionalAPI key

All arguments are optional, and an openai credential with no arguments will behave the same as the default credential.

Attributes (Read-Only)

AttributeTypeDescription
envMapA map of the resolved credential-related environment variables (OPENAI_API_KEY)

Default Credential

The openai credential type includes an implicit, default credential (credential.openai.default) that will be configured to set the api_key to the OPENAI_API_KEY environment variable.

credential "openai" "default" {
api_key = env("OPENAI_API_KEY")
}