gemini_upload_file
Upload an image, video, or audio file to Gemini Files API once and receive a reusable file_uri to attach to multiple generations without re-uploading.
Instructions
Upload a file — an image, reference photo, picture, screenshot, video or audio clip — to the Gemini Files API ONCE, and get back a reusable file_uri (files/<id>) to attach to later image, video or music generations. Keywords: upload, upload file, upload image, upload photo, attach, reference image, reference photo, file_uri, files api, image reference, reuse across calls. Use this instead of pasting base64 into a tool call: the reference is a short string, so no image bytes ever enter the conversation, and it can be reused across many generations until it expires (~48h). Provide exactly one of url (the server downloads it), data_base64, or path (a local file).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Public https URL the SERVER downloads and uploads (image/video/audio, up to 100MB). No bytes pass through the conversation. | |
| path | No | Path to a local file (absolute, or resolved against $GEMINI_INPUT_DIR). Confirm-gated like every other local-file input. | |
| r2_key | No | Unavailable on this server (media is written to local disk) — pass the file path via `path` instead. | |
| confirm | No | Must be true to proceed. Without this, the tool returns a preview. | |
| mime_type | No | Override the detected MIME type (sniffed from the bytes / taken from the server response otherwise) | |
| data_base64 | No | Raw base64 or a data: URI. Last resort — this is the one form that costs model context (~14k tokens for a modest JPEG). | |
| display_name | No | Human-readable name recorded against the upload |