powered by
Shortcut that creates an OpenAI client from the OPENAI_API_KEY environment variable and retrieves metadata for a specific file.
OPENAI_API_KEY
retrieve_file(file_id)
A file object with $id, $filename, $bytes, $purpose, $status, and $created_at.
$id
$filename
$bytes
$purpose
$status
$created_at
Character. Required. The file ID (e.g. "file-abc123").
"file-abc123"
if (FALSE) { Sys.setenv(OPENAI_API_KEY = "sk-xxxxxx") info <- retrieve_file("file-abc123") cat("Filename:", info$filename) cat("Status:", info$status) # "processed" }
Run the code above in your browser using DataLab