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

client = AI21Client()
file_id = client.library.files.create(
    file_path="path/to/file",
    path="path/to/file/in/library",
    labels=["label1", "label2"],
    public_url="www.example.com"
)

Responses

Response 200

A successful response returns an array of file metadata items.

errorCode intThe error code, if any.

errorMessage stringThe error message, if any.

Response 422

No matching ID is found.

from ai21 import AI21Client

client = AI21Client()
file_id = client.library.files.create(
    file_path="path/to/file",
    path="path/to/file/in/library",
    labels=["label1", "label2"],
    public_url="www.example.com"
)