Upload File
Parameters
Returns
Upload File
Python
from anthropic import Anthropic
client = Anthropic(
api_key="my-anthropic-api-key",
)
file_metadata = client.beta.files.upload(
file=b"raw file contents",
)
print(file_metadata.id){
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"filename": "x",
"mime_type": "x",
"size_bytes": 0,
"type": "file",
"downloadable": true
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"filename": "x",
"mime_type": "x",
"size_bytes": 0,
"type": "file",
"downloadable": true
}