Skip to main content
This page shows how to give a tool a file. A tool’s file field is a string that takes one of three values:
  • A file ID (file_...) from an upload. Use this for any file larger than a few hundred kilobytes.
  • An https URL. Pomerado fetches it when you submit the run.
  • A data: URI of at most 512 KB, such as data:application/pdf;base64,JVBERi0....

Upload a file

1

Create the upload

Send POST /v1/files with the file’s name and media type. In an MCP client, call create_file_upload, on the Pomerado MCP and every integration MCP; its answer adds the curl -T command for the upload_url, with its transfer key.
size is optional; when you give it, the upload must be exactly that long. sha256 is optional too: the file’s SHA-256 as 64 hex characters, in either case. When you give it, an upload of any other bytes is refused with file_digest_mismatch and nothing is stored. The answer has the file’s id, a one-time upload_url and that URL’s transfer_key.
2

Send the bytes

Within 15 minutes, PUT the file to upload_url once, with the transfer_key in a Pomerado-Transfer-Key header:
Instead of the transfer key, you can send the same API key or token that created the upload as Authorization: Bearer. The transfer key lets a device or worker that doesn’t hold your API key send the bytes, so keep it as private as the URL. An upload without either answers unauthorized, unless an older API key, one created before file links needed a key, made it before the date in that key’s Sunset header: such links work without it (see File links need a key).The answer is the file, now ready. If the upload fails, send it again before the URL expires. Three refused uploads, such as bytes that aren’t the declared type, size or SHA-256, close the URL; it then answers file_unavailable with reason upload_closed, and you create a new upload. A web page can’t send to upload_url; only programs and the Pomerado Dashboard can.
3

Pass the ID to the run

Use the file’s ID as the field’s value when you run the tool:
A file serves one run. GET /v1/files/{id} reads its metadata, never its bytes, and DELETE /v1/files/{id} erases it now. A tool’s file field may state the site’s own limits for the file, as maxBytes and extensions in its input schema, such as a résumé field that takes PDF or Word files up to 5 MB. Pomerado checks your file against them before the run starts and refuses one outside them with invalid_input, naming the field and the limit, so the run never stops partway through for a file the site would refuse.

On MCP

A tool’s file fields sit at the top level of its parameters, next to input, and are listed in _meta["openai/fileParams"], so ChatGPT can attach a file the user gave it; Pomerado fetches the attached file’s download_url as it fetches any https URL. A file field named like one of the call’s own parameters is called file_<name> there. Each still takes a file ID, an https URL or a data: URI, and a list of files keeps its own limits, such as maxItems.

Give a build an example file

A build runs one real example. When the example needs a file, upload it first and put its file ID anywhere in example_input, or put the file there as a data: URI of at most 512 KB:
The build takes the file as a run does and erases it when the build ends. A data: URI counts as a file when its type is not text or HTML, such as a PDF or an image, and Pomerado stores it like an upload. An https URL, or a text or HTML data: URI, stays the value it is, since it may be a page the task names. The model that builds the tool never sees the file’s bytes or its ID, only its name, type and size. A file the example downloads gives the build only its name, type, size and hash, and is kept nowhere. A build answers the same file_unavailable, file_limit_exceeded, file_too_large and file_type_refused errors as a run.
  • A URL must be https on the default port, with no username or password, and resolve to a public address. It may redirect at most three times, must answer within 20 seconds and must send a Content-Length.
  • Pomerado stores a URL’s or data URI’s bytes like an upload.
  • See limits for sizes and expiry.