Skip to main content
This page shows how to download a file a run collects, such as a statement. The run’s result holds it as a $file object:

Download the file

Fetch download_url once, with the transfer_key in a Pomerado-Transfer-Key header:
-f makes curl fail on an error answer instead of saving it as the file. Instead of the transfer key, you can send the same API key or token that started the run as Authorization: Bearer. Only that key or token’s own reads of the job show transfer_key, and so does your own Dashboard for a run your API key or MCP client started. A download without either answers unauthorized, unless an older API key, one created before file links needed a key, started the run and the file came before the date in that key’s Sunset header: such links work without it (see File links need a key). Save the body before anything else. Pomerado erases the file as soon as one download sends its last byte, whether or not your client saved it. Compare the bytes with sha256 to confirm they are complete. A download that breaks off before its last byte may start again until expires_at. An undownloaded file is erased 10 minutes after the run stored it, so download it as soon as the run ends. Download from your server, script or agent, not from a web page. The download allows no cross-origin read except by Pomerado’s own Dashboard: a request from another website’s page answers forbidden and leaves the file for your next download. If Pomerado can’t confirm a file’s link at the moment you read the job, the read fails with temporarily_unavailable and the result is kept: read the job again. A link Pomerado didn’t issue for that job, or one already used or expired, is left out, and the $file keeps only its description.

On MCP

A tool result that holds a $file follows the job’s JSON with a line giving the curl command that downloads it with its transfer key, and a resource_link to its URL. Use the command: the link alone won’t download the file. A PNG, JPEG, GIF or WebP image of up to 256 KB also comes as the image itself, so the client can show it. Showing the image doesn’t use the link, which still downloads the file once.