Skip to content

Upload a file

POST
/files
curl --request POST \
--url https://api.katara.com/v1/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@file \
--form extracted_text=example

Keeps a picture, recording, video, PDF or text file of up to 20 MB for your account and returns its id. Name it in a chat message as a file part with file_id, on this turn and later ones, instead of sending the file again. Katara gives the model the file in the form it reads; for a model that cannot read that kind of file, it sends extracted_text when you gave one. Only your account can use, read or delete the file. Needs an API key; Long conversations shows the flow.

Media typemultipart/form-data
object
file
required
string format: binary
extracted_text

The file’s text, for models that cannot read the file itself.

string
<= 2097152 characters

The stored file.

Media typeapplication/json
object
id
required
string
object
required
string
Allowed value: file
bytes
required
integer
created_at

Unix seconds.

integer
filename
required
string
mime_type
required
string
sha256
string
purpose
string
Allowed value: user_data
extracted_text

Whether the file has text for models that cannot read it.

boolean
Example
{
"id": "file_3f9a1c0b7d2e5a6b8c9d0e1f",
"object": "file",
"mime_type": "application/pdf",
"purpose": "user_data"
}

missing_param, invalid_file (empty or over 20 MB), unsupported_file_type or invalid_param.