GET
/
studio
/
v1
/
library
/
files
/
{file_id}
/
download
from ai21 import AI21Client

# Initialize client
client = AI21Client(api_key="your_api_key_here")

# Get file metadata
try:
    file_metadata = client.library.files.get("your_file_id_here")
    print(file_metadata)
except Exception as e:
    print(f"Error: {e}")

Response 200

A successful response returns an array of file metadata items.
errorCode intThe error code, if any.
errorMessage string The error message, if any.

Response 422

No matching ID is found.

from ai21 import AI21Client

# Initialize client
client = AI21Client(api_key="your_api_key_here")

# Get file metadata
try:
    file_metadata = client.library.files.get("your_file_id_here")
    print(file_metadata)
except Exception as e:
    print(f"Error: {e}")