Upload File
POST/v1/files
Authorization
Authorizationstringrequired
Bearer token for API authentication. Format: `Bearer YOUR_API_KEY`
Request Body
filestring(binary)required
The file to upload
Response Body
idstringrequired
Unique identifier for the file
filenamestringrequired
Name of the file including extension
Constraints
•Minimum length: 1
bytesintegerrequired
Size of the file in bytes
Constraints
•Exclusive minimum: 0
mime_typestringrequired
MIME type of the file
versionintegerrequired
Version of the file
Constraints
•Minimum: 1
created_atstring(date-time)required
Timestamp when the file was created
updated_atstring(date-time)required
Timestamp when the file was last updated
Request
POST/v1/files
from mixedbread import Mixedbread
mxbai = Mixedbread(api_key="YOUR_API_KEY")
file_path = "document.pdf"
with open(file_path, "rb") as f:
res = mxbai.files.create(file=f)
print(res)Response
JSON
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"filename": "document.pdf",
"bytes": 1048576,
"mime_type": "application/pdf",
"version": 1,
"created_at": "2025-01-15T10:00:00.000Z",
"updated_at": "2025-01-15T10:00:00.000Z",
"object": "file"
}Last updated: January 7, 2026