gemini_upload_file
Upload an image, video, or audio file to Gemini Files API and receive a reusable file reference. Avoid sending large base64 data in conversations by using URLs, base64, or local file paths.
Instructions
Upload an image (or video/audio) to the Gemini Files API ONCE and get back a reusable files/<id> reference. 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. | |
| 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 |