Create Gemini upload session
Create a short-lived upload instruction for a local file. Send the file bytes directly to the returned upload.url, using the returned method and headers, then complete the upload through LinkModel.
This workflow is only for Google Gemini models that support native fileData input. The resulting file URI cannot be used with OpenAI, Anthropic, compatibility, image-generation, or video-generation endpoints.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Use a portable ASCII basename containing letters, numbers, dots, hyphens, or underscores. Avoid spaces and non-ASCII punctuation because the filename becomes part of the Gemini file URI.
"sample.mp4"
"video/mp4"
Exact file size in bytes.
x >= 135077
Lowercase hexadecimal MD5 checksum of the complete file.
"4c7576b35abc9bde1a09a6a257937eb3"
vision "vision"