Start a file upload
postkey_begin_uploadPostkey: Puts one file into the Library. A file attached to this chat: try this first, yourself, before postkey_request_file or postkey_list_library. It is usually in your own workspace, computer or sandbox: send its name, exact size in bytes and type. From a web address (a video or picture made on Higgsfield, fal, Sumi Studio, HeyGen and the like, or a Dropbox or Drive share link): send url alone, in the same turn, since those links run out. Postkey copies it in (up to 1 GB) and answers library_item_id: done. Any other file you can read with a command: the same. The answer's upload_url takes the bytes in one HTTP PUT with the same Content-Type (curl -X PUT -H "Content-Type: video/mp4" --data-binary @clip.mp4 "<upload_url>"), for 2 hours, up to 5 GB and no larger than the size sent. Then postkey_finish_upload with the path (finish_with spells it out). Nothing is published.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "postkey_begin_upload"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | The file's https address. Postkey fetches it and adds it to the Library in this one call. Send it without name, size and type. | |
| name | No | Without url: the file's name with its extension, for example episode-1.mp4. 1 to 300 characters. | |
| size | No | Without url: the file's exact size in bytes (from ls -l or stat), at most 5 GB. A file that turns out larger is refused at the PUT. | |
| type | No | Without url: the file's MIME type: video/mp4, video/quicktime, image/jpeg, image/png and so on. Left out: read from the name's extension. Send the same value as the PUT's Content-Type. | |
| title | No | With url: the file's title in the Library, 1 to 300 characters. Left out: the file's own name. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | false: refused (isError; code, message, guide_topic, url); no change. | |
| kind | No | With url: video, image or audio, read from the file itself. | |
| next | No | What to do next. | |
| path | No | Pass it to postkey_finish_upload. | |
| method | No | PUT. | |
| example | No | A curl command for the PUT. | |
| headers | No | The headers the PUT needs (Content-Type). | |
| max_bytes | No | The largest file the link takes. | |
| expires_at | No | When the link stops working. | |
| size_bytes | No | With url: the stored file's size. | |
| upload_url | No | Send the file's bytes here with one HTTP PUT. | |
| finish_with | No | The next call: { tool: postkey_finish_upload, args: { path, kind } }; add the title. | |
| library_item_id | No | With url: the new Library file's id. The file is in the Library; there is no finish step. |