import { SDK } from "@meetkai/mka1";
import { openAsBlob } from "node:fs";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.sandbox.uploadFile({
sessionId: "demo-python-20260316",
filePath: "inputs/config.json",
sessionToken: "sandbox_test_20260316_4f9c2b1a",
requestBody: await openAsBlob("example.file"),
});
console.log(result);
}
run();{
"status": "uploaded"
}Upload raw bytes into the session workspace at the given path.
import { SDK } from "@meetkai/mka1";
import { openAsBlob } from "node:fs";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.sandbox.uploadFile({
sessionId: "demo-python-20260316",
filePath: "inputs/config.json",
sessionToken: "sandbox_test_20260316_4f9c2b1a",
requestBody: await openAsBlob("example.file"),
});
console.log(result);
}
run();{
"status": "uploaded"
}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>.
The body is of type file.
Successful Response
Was this page helpful?