Read a file
POST
https://api.vercel.com/v2/sandboxes/sessions/{sessionId}/fs/readDownloads the contents of a file from a session's filesystem. The file content is returned as a binary stream with appropriate Content-Disposition headers for file download.
https://api.vercel.com/v2/sandboxes/sessions/{sessionId}/fs/read
const response = await fetch('https://api.vercel.com/v2/sandboxes/sessions/sessionId/fs/read?teamId=string&slug=string', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ "cwd": "/home/vercel-sandbox", "path": "dist/agent-output.md" }),});
const data = await response.json();console.log(data);Response
"string"AuthorizationbearerToken
Default authentication mechanism