mime_type, size_bytes, and SHA-256 digest with files.retrieve(fileId).
Both examples upload report.pdf and save a separate copy to downloaded-report.pdf.
file part up to 16 MiB. To retry an upload safely, reuse the idempotency key with the same filename, media type, and bytes.
The CLI prints a generated Idempotency-Key to stderr before uploading. If the upload’s outcome is uncertain, rerun the command with --idempotency-key set to that value and keep the original file and options.
The HTTP example saves the completed download after curl succeeds. A failed transfer removes its temporary file. Choose an unused filename for each download.
Transfer bytes with the SDK
If-None-Match returns HTTP 304 with an empty body. Use Range for partial downloads and If-Range to receive the full file when the validator is stale. The SDK returns the bytes and can expose the HTTP status and headers.
The signed-in dashboard downloads saved Files from the Files panel of the session that captured them.
Attach a File to a Session
Pass afile resource when you create the Session:
/mnt/session/uploads/q3/report.pdf. A leading slash starts at the uploads directory. q3/report.pdf resolves to the same file path. Omit mount_path to use the filename, or pass null to use the file ID.
The agent’s file tools can read uploads directly. To pass an upload to bash, the agent first copies it into /workspace.
To reuse a saved File in the dashboard, choose Use in new session in the source session’s Files panel. Review the read-only mount and start the new session when you are ready. The new session references the same File.
Files from Session outputs
When a turn ends withend_turn, budget_reached, or refusal, Checkfu captures /mnt/session/outputs after the Session goes idle, subject to Session output limits. Other stop reasons produce no capture. The latest output record includes the turn and status of the most recent capture attempt.
- A lower
outputs.turnmeans the latest capture attempt precedes the turn you want. Check the turn’s stop reason before waiting for a capture. - A matching turn with status
savedlists the currently available Files from that turn’s capture. Unchanged files can retain their IDs. Theskippedarray lists individual paths omitted during the capture. - A matching turn with status
skippedhas areasonfor the whole capture. Its File list shows the currently available Files from the last successful capture. - A higher
outputs.turnmeans the latest record has advanced. Use the Session’s output history to find the earlier capture.
client.sessions.outputs.history(session.id, { order: "desc" }) to list captures from newest to oldest. Follow next_page until you find the requested turn or reach the end. A skipped history entry has a reason and an empty File list. The latest record and history both omit Files deleted after capture.
To refresh when an outcome is recorded, subscribe a Webhook to session.outputs_recorded.
For results too large to save as session outputs, have the agent save an Artifact with save_artifact.