NylorunDocsBeta
RunSessions

Files

Upload files, send them in a message, and export sandbox outputs.

const uploaded = await client.artifacts.upload(fileBytes, {
  name: "brief.pdf",
  sessionId: session.id,
  contentType: "application/pdf",
});

await session.inputParts(
  [
    { type: "text", text: "Summarise this brief." },
    { type: "file", artifactId: uploaded.id },
  ],
  { idempotencyKey },
);

A message has at most 32 parts. Images go to the model as images; text files go as text.

API

MethodRole
upload(body, { name, sessionId?, contentType?, labels? })Create an artifact.
uploadVersion(id, body)Add a version.
list({ sessionId? })List artifacts.
get(id)Metadata and versions.
download(id, { version?, range? })Bytes through the Runtime.
link(id, { expiresIn? })Credential-free URL, 5 to 15 minutes.
tree(id) / file(id, path)Folder contents.
diff(id, { version?, from? })Versions of a folder.
zip(id)Download a folder as a zip.
delete(id)Remove the artifact.

Routes and schemas are on the Runtime API.

Sandbox outputs

An agent with a sandbox gets save_artifact. At the end of each turn the Runtime exports /workspace/outputs as the session's outputs artifact.

Next step

On this page