from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.files.upload(file={
"file_name": "example.file",
"content": open("example.file", "rb"),
}, purpose="assistants")
# Handle response
print(res){
"id": "file-abc123",
"object": "file",
"bytes": 125000,
"created_at": 1704067200,
"filename": "product-manual.pdf",
"purpose": "assistants",
"status": "processed"
}Upload a file that can be used with Assistants, Vector Stores, and other features. Files are uploaded to S3 for durable storage.
from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.files.upload(file={
"file_name": "example.file",
"content": open("example.file", "rb"),
}, purpose="assistants")
# Handle response
print(res){
"id": "file-abc123",
"object": "file",
"bytes": 125000,
"created_at": 1704067200,
"filename": "product-manual.pdf",
"purpose": "assistants",
"status": "processed"
}Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
OK
The file identifier
The size of the file in bytes
-9007199254740991 <= x <= 9007199254740991Unix timestamp when the file was created
-9007199254740991 <= x <= 9007199254740991The name of the file
The intended purpose of the file
assistants, batch, fine-tune, vision, user_data, evals Unix timestamp when the file expires
-9007199254740991 <= x <= 9007199254740991DEPRECATED: File processing status
uploaded, processed, error DEPRECATED: Details about file status
Was this page helpful?