Upload and attach input files
Uploading stores the file in the workspace and returns an upload ID. Pass that ID inattached_file_ids / attachedFileIds to make the file available to a specific run.
Attachments are turn-scoped. Reusing a workspace does not automatically attach every uploaded file to every later run.
Retrieve files the agent creates
Ask the agent to save its output in the workspace, then list files with temporary download URLs:cursor / next_cursor (nextCursor in TypeScript) to paginate large workspaces.
Reuse a workspace
- Pass neither ID to
runs.create()to create a new session and workspace. - Pass
session_id/sessionIdto continue the same conversation and workspace. - Pass only
workspace_id/workspaceIdto start a fresh conversation with existing files.