powered by
Shortcut that creates an OpenAI client from the OPENAI_API_KEY environment variable and retrieves details for a specific model.
OPENAI_API_KEY
retrieve_model(model)
A named list with model metadata: $id, $object, $created (Unix timestamp), $owned_by.
$id
$object
$created
$owned_by
Character. Required. The model ID to look up. Examples: "gpt-4o", "gpt-3.5-turbo", "whisper-1", "text-embedding-3-small", "dall-e-3".
"gpt-4o"
"gpt-3.5-turbo"
"whisper-1"
"text-embedding-3-small"
"dall-e-3"
if (FALSE) { Sys.setenv(OPENAI_API_KEY = "sk-xxxxxx") info <- retrieve_model("gpt-4o") cat("ID:", info$id, "\n") cat("Owner:", info$owned_by, "\n") }
Run the code above in your browser using DataLab