curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/file/download?path=/src/index.ts" \
-H "Authorization: Bearer runtm_xxx" \
-o index.ts
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/download",
headers={"Authorization": "Bearer runtm_xxx"},
params={"path": "/src/index.ts"},
)
with open("index.ts", "wb") as f:
f.write(response.content)
print(f"Downloaded {len(response.content)} bytes")
const params = new URLSearchParams({ path: "/src/index.ts" });
const response = await fetch(
`https://app.runtm.com/api/cloud/sessions/ses_abc123/file/download?${params}`,
{
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const blob = await response.blob();
console.log(`Downloaded ${blob.size} bytes`);
Raw file content (binary stream)
{
"detail": "File not found"
}
Files
Download File
Download raw file content from the sandbox
GET
/
api
/
sessions
/
{session_id}
/
file
/
download
curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/file/download?path=/src/index.ts" \
-H "Authorization: Bearer runtm_xxx" \
-o index.ts
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/download",
headers={"Authorization": "Bearer runtm_xxx"},
params={"path": "/src/index.ts"},
)
with open("index.ts", "wb") as f:
f.write(response.content)
print(f"Downloaded {len(response.content)} bytes")
const params = new URLSearchParams({ path: "/src/index.ts" });
const response = await fetch(
`https://app.runtm.com/api/cloud/sessions/ses_abc123/file/download?${params}`,
{
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const blob = await response.blob();
console.log(`Downloaded ${blob.size} bytes`);
Raw file content (binary stream)
{
"detail": "File not found"
}
Downloads the raw content of a file from the sandbox. Returns the file as a binary stream with the appropriate content type.
Required scope:
sessions:read
Path Parameters
string
required
The session ID (e.g.
ses_abc123).Query Parameters
string
required
Path of the file to download (e.g.
/src/index.ts).Headers
string
required
Bearer token. Example:
Bearer runtm_xxxResponse
Returns the raw file content withContent-Type and Content-Disposition headers.
curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/file/download?path=/src/index.ts" \
-H "Authorization: Bearer runtm_xxx" \
-o index.ts
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/file/download",
headers={"Authorization": "Bearer runtm_xxx"},
params={"path": "/src/index.ts"},
)
with open("index.ts", "wb") as f:
f.write(response.content)
print(f"Downloaded {len(response.content)} bytes")
const params = new URLSearchParams({ path: "/src/index.ts" });
const response = await fetch(
`https://app.runtm.com/api/cloud/sessions/ses_abc123/file/download?${params}`,
{
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const blob = await response.blob();
console.log(`Downloaded ${blob.size} bytes`);
Raw file content (binary stream)
{
"detail": "File not found"
}