files_create_upload_url
Get a URL to upload a local file DIRECTLY to storage, without passing its bytes through this conversation.
Use this for any file you already have on disk — it is the only way to send one without spending tokens on its contents, and the only way to send anything above ~50 KB at all.
Three steps:
files_create_upload_url(filename, mime_type, size_bytes, sha256)
curl -X PUT --data-binary @/path/to/file (send every header from
headersverbatim)files_complete_upload(file_id) -> the file is ready
Pass sha256 when you can: if the workspace already holds that exact file you get its file_id back immediately with deduplicated=true and no upload at all.
Returns: file_id, upload_url, method, headers, expires_at.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | No | Optional display title | |
| sha256 | No | Hex sha256 of the file (`sha256sum <path>`). Optional but recommended: enables dedup and verifies the upload arrived intact. | |
| filename | Yes | Filename with extension (e.g. 'photo.jpg') | |
| mime_type | No | MIME type (e.g. 'image/jpeg'). Guessed from the filename when omitted. | |
| size_bytes | Yes | EXACT byte length of the file (`stat -c %s <path>`). Checked before anything is transferred, so an oversize file is refused here rather than after the upload. Limit: 100 MB. | |
| in_workspace | No | Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected. |